Add function redefine dark flats

Merged payno requested to merge add_function_redefine_dark_flats into master

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.


  • 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)
  • update all necessary dataset for adding a dark or flat (instrument/detector/data, instrument/detector/rotation_angle...)
  • insure no links are affected: for now we copy anyother data that is not 'instrument/detector/data'. Might be improved later
  • add tests
  • provide a command for it
  • documentation


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


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.

Edited by payno

Merge request reports