nxtomomill merge requestshttps://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests2020-11-20T17:22:43+01:00https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/35move to h5py 3.x2020-11-20T17:22:43+01:00paynomove to h5py 3.xThis reverts merge request !34This reverts merge request !340.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/41[converter-hdf5] Add NXdata management.2020-11-20T15:09:57+01:00payno[converter-hdf5] Add NXdata management.0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/40[patch-nx] add an option embed to include dataset not in the file2020-11-20T15:08:11+01:00payno[patch-nx] add an option embed to include dataset not in the file0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/39[utils][_insert_frame_data] fix virtual dataset creation. Cannot use...2020-11-19T17:27:27+01:00payno[utils][_insert_frame_data] fix virtual dataset creation. Cannot use...[utils][_insert_frame_data] fix virtual dataset creation. Cannot use SapceID.shape but should use bounds[utils][_insert_frame_data] fix virtual dataset creation. Cannot use SapceID.shape but should use bounds0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/38[h5_to_nx] handle zserie2020-11-19T17:23:01+01:00payno[h5_to_nx] handle zserieDescription / Goal
==================
handle zseries by creating one entry per z found. /close #13
We can still create one file per entry (default behavior of tomoh52x) or create one file per entry and one master file (`--single-file` ...Description / Goal
==================
handle zseries by creating one entry per z found. /close #13
We can still create one file per entry (default behavior of tomoh52x) or create one file per entry and one master file (`--single-file` option)
TODO
====
- [x] add a new parameter in settings 'H5_ZSERIE_INIT_TITLES'
will be merge with 'H5_INIT_TITLES' when h5_to_nx is call
- [x] split _Acquisition into a base class (_BaseAcquisition and _ZSerieAcquisition). PR of ID15 data will need to be rework due to this I guess.
- [x] add `_ZSerieAcquisition` class: represents a serie of _StandardAcquisition. 'write_as_nxtomo' is now only part of StandardAcquisition
- [x] doc
- [x] test
NOTE
====
Split `H5_INIT_TITLES` to `H5_INIT_TITLES` and `H5_ZSERIE_INIT_TITLES` to distinguish zseries and 'standard acquisition'
No API modification at command line level. Only adding an `init_zserie_titles` option to define zseries title if necessary0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/37Get rid of camera names2020-11-10T12:36:09+01:00paynoGet rid of camera names- [x] add function to find detectors from the instrument group.
- [x] replace camera name by auto-detection functions. Camera name must always be provided from command line or from the setting file
- [x] add Bliss mock from tomwer.
- ...- [x] add function to find detectors from the instrument group.
- [x] replace camera name by auto-detection functions. Camera name must always be provided from command line or from the setting file
- [x] add Bliss mock from tomwer.
- [x] add an option to set or not the NXdetector flag
- [x] add an option to define the camera name to be used
- [x] test
- [x] doc0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/26Add function redefine dark flats2020-11-10T08:23:59+01:00paynoAdd function redefine dark flatsThe goal is to provide a function able to add some darks or flats to an existing dataset.
For now we will only focus on creating a new NXTomo entry and won't manage any overwrite.
Done
====
- [x] create a generic function to insert nu...The goal is to provide a function able to add some darks or flats to an existing dataset.
For now we will only focus on creating a new NXTomo entry and won't manage any overwrite.
Done
====
- [x] create a generic function to insert numpy array or a new source to an existing Virtual dataset (at the beginning or end of the current array)
- [x] update all necessary dataset for adding a dark or flat (`instrument/detector/data`, `instrument/detector/rotation_angle`...)
- [x] insure no links are affected: for now we copy anyother data that is not 'instrument/detector/data'. Might be improved later
- [x] add tests
- [x] provide a command for it
- [x] documentation
Info
====
The command line takes a file path and a file entry as mandatory entries.
Users should provide url for darks, and flats.
This only manage 'inplace' modifications. If the users wants to have to files: one 'orginal' and one 'with the modifications' then this is up to him to first copy the file.
Example of usage:
=================
Provided API is:
```
nxtomomill patch-nx [my_file my_entry] [[--darks dark_path@dark_file --initial-flats ini_flat_path@ini_flat_file --final-flats fin_flat_path@fin_flat_file]]
```
Tested example:
```
nxtomomill patch-nx /tmp/tmpzk3v37h_/simple_case/simple_case.h5 entry --darks-at-start data2@/tmp/tmpzk3v37h_/dark.hdf5 --flats-at-start silx:///tmp/tmpzk3v37h_/simple_case/simple_case.h5?path=flat&slice=1,2
```
Note
====
for now we cannot provide any 'extra' parameter from the command line. This can only be done calling a python script.
This could be possible but some work at the command line has to be done. But I don't think this is an option 'casual' users want to have.0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/36Several minor fix2020-11-10T08:23:19+01:00paynoSeveral minor fix- [x] use fnmatch for camera name (/closes #29)
- [x] look at more location when try to get a dataset. At the current one and the 'root entry'. This way users can give path relative to scan entry.
- [x] create the file anyway. this way t...- [x] use fnmatch for camera name (/closes #29)
- [x] look at more location when try to get a dataset. At the current one and the 'root entry'. This way users can give path relative to scan entry.
- [x] create the file anyway. this way the user can change it manually (/closes #27)
instead of the force option do an option `exit-if-issues` It seems users prefer to have the file even with issues
- [x] homogeneity on entry names. Should all be call entryXXXX (/closes #26)0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/31[converter][tomoh52nx] remove magnified pixel size2020-10-26T08:43:55+01:00payno[converter][tomoh52nx] remove magnified pixel size- only write pixel size. A path can still be provided by the user. Otherwise we will try the following path to get the pixel size to be store in the NXTomo (with this order):
"technique/optic/sample_pixel_size ",
"technique/optic/sample...- only write pixel size. A path can still be provided by the user. Otherwise we will try the following path to get the pixel size to be store in the NXTomo (with this order):
"technique/optic/sample_pixel_size ",
"technique/optic/sample_pixel_size",
"technique/detector/pixel_size"0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/30Better management of file2020-10-13T16:46:00+02:00paynoBetter management of file- [x] insure conversion can also be done from the 'proposal file': ih* file for example.
- [x] display warning or get user confirmation for translation if the input hdf5 file contains NXTomo valid entries- [x] insure conversion can also be done from the 'proposal file': ih* file for example.
- [x] display warning or get user confirmation for translation if the input hdf5 file contains NXTomo valid entries0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/29Patch image key2020-10-13T14:56:51+02:00paynoPatch image keyPropose option to modify image_key and image_key_control from:
- [x] a function: `utils.change_image_key_control`
- [x] command line: from `patch-nx`
INFO
----
example of usage:
``` bash
# force frames 26 and 27 to be dark
nxtomomill...Propose option to modify image_key and image_key_control from:
- [x] a function: `utils.change_image_key_control`
- [x] command line: from `patch-nx`
INFO
----
example of usage:
``` bash
# force frames 26 and 27 to be dark
nxtomomill patch-nx --update-to-dark 26:28 simple_case.h5 entry
# force frames 10, 13, 16 and 19 to be flatfield
nxtomomill patch-nx --update-to-flat 10:20:3 simple_case.h5 entry
# force frame 0, 1 and to 4 to be projections
nxtomomill patch-nx --update-to-proj 0,1,4 simple_case.h5 entry
# force first frame to be alignment projection
nxtomomill patch-nx --update-to-alignment 0 simple_case.h5 entry
# force all frames to be invalid
nxtomomill patch-nx --invalid-frames : simple_case.h5 entry
```0.4https://gitlab.esrf.fr/tomotools/nxtomomill/-/merge_requests/27[tomoh5to2nx] create directories if output directories does not exists create...2020-10-12T15:13:33+02:00payno[tomoh5to2nx] create directories if output directories does not exists create it.Insure users have rights to write on files if already exists
Some PEP8 modifications too
Signed-off-by: payno <payno@linazimov.esrf.fr>Insure users have rights to write on files if already exists
Some PEP8 modifications too
Signed-off-by: payno <payno@linazimov.esrf.fr>0.4