Commit 7f27fd00 authored by Loïc Musy's avatar Loïc Musy
Browse files

Change to ibw2hdf5 to work with linescan


Signed-off-by: Loïc Musy's avatarLoic.Musy1 <loic.musy@unige.ch>
parent 8ac741fa
image: python:3.9.2-buster
stages:
- deploy_stage
- deploy_prod
before_script:
- pip install twine
- python setup.py sdist
deploy_production:
stage: deploy_prod
stage: deploy
variables:
TWINE_USERNAME: __token__
TWINE_PASSWORD: $PRODUCTION_PASSWORD
script:
- twine upload --repository-url https://upload.pypi.org/legacy/ dist/* --verbose
only:
- tags
\ No newline at end of file
......@@ -9,5 +9,6 @@
- Updated dependencies in setup.py
- Replaced interpolated_features by generate_interpolation
- Moved sample_fraction, all_sample_fractions, interpolated_features to deprecated
- Function ibw2hf5 changed to work with linescan
### Removed
\ No newline at end of file
......@@ -52,23 +52,28 @@ def ibw2hdf5(filename, filepath=None):
datagrp.attrs.__setattr__('type', filename.split('.')[-1])
for i, k in enumerate(label_list):
if len(np.shape(tmpdata['wData'])) == 2:
datagrp.create_dataset(k, data=flipud(tmpdata['wData'][:, i].T))
datagrp[label_list[i]].attrs['shape'] = tmpdata['wData'][:, i].T.shape
datagrp[label_list[i]].attrs['scale_m_per_px'] = fastsize/tmpdata['wData'][:, i].T.shape[0]
else:
datagrp.create_dataset(k, data=flipud(tmpdata['wData'][:, :, i].T))
datagrp[label_list[i]].attrs['name'] = k.decode('utf8')
datagrp[label_list[i]].attrs['shape'] = tmpdata['wData'][:, :, i].T.shape
datagrp[label_list[i]].attrs['size'] = (fastsize, slowsize)
datagrp[label_list[i]].attrs['offset'] = (xoffset, yoffset)
datagrp[label_list[i]].attrs['path'] = ("datasets/" + filename.split('.')[0]+"/"+str(k).split('\'')[1])
datagrp[label_list[i]].attrs['scale_m_per_px'] = fastsize/tmpdata['wData'][:, :, i].T.shape[0]
datagrp[label_list[i]].attrs['name'] = k.decode('utf8')
datagrp[label_list[i]].attrs['size'] = (fastsize, slowsize)
datagrp[label_list[i]].attrs['offset'] = (xoffset, yoffset)
datagrp[label_list[i]].attrs['path'] = ("datasets/" + filename.split('.')[0]+"/"+str(k).split('\'')[1])
if "Phase" in str(k):
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'deg')
elif "Amplitude" in str(k):
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'V')
elif "Height" in str(k):
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'm')
else:
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'unknown')
# f.create_dataset("channelsdata/pxs", data=sizes)
if "Phase" in str(k):
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'deg')
elif "Amplitude" in str(k):
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'V')
elif "Height" in str(k):
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'm')
else:
datagrp[label_list[i]].attrs['unit'] = ('m', 'm', 'unknown')
# f.create_dataset("channelsdata/pxs", data=sizes)
print('file successfully converted')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment