nxtomomill nx-copy¶
since version xxx nxtomomill contains a function to easily copy an NXtomo from one place to another.
This is helpful mostly for NXtomo generated from bliss and that contains relative links to bliss / lima files. As it will update those.
from the CLI¶
nxtomomill nx-copy --help
usage: nxtomomill nx-copy [-h] [--entry ENTRIES] [--overwrite] [--debug] [--remove-vds] [nexus_file] [output_file]
copy one or several NXtomo to another location
positional arguments:
nexus_file file path to the nexus file containing NXtomo
output_file output nexus file
options:
-h, --help show this help message and exit
--entry ENTRIES, --entries ENTRIES
NXtomo path(s) to be copied. If none provided then all NXtomo entries will be copied
--overwrite Do not ask for user permission to overwrite output files
--debug Set logs to debug mode
--remove-vds Remove any Virtual dataset to the resulting NXtomo (duplicate detector data - warning: all data will be load in memory before dumping it)
!nxtomomill copy-nx bambou_hercules_0001.nx /other/location/new_nxtomo.nx
from python API¶
Even if the application is a nxtomomill
side the source code is part of nxtomo
module.
from nxtomo.application.nxtomo import copy_nxtomo_file as copy_nxtomo
input_file = "/path/to/input/nexus_file.nx"
output_file = "/path/to/output/nexus_file.nx"
copy_nxtomo(
input_file=input_file,
output_file=output_file,
# entries=("entry0000", "entry0001", ) # if we want to copy only a subset of the file
# overwrite=True,
# vds_resolution="update", # or "remove". Update will update relative link of the HDF5 Virtual Dataset, remove will replace the HDF5 Virtual Dataset by a default HDF5 dataet
)
In [ ]: