integrator.hdf5 module
integrator.hdf5 module#
- integrator.hdf5.get_string(str_or_bytes)#
- integrator.hdf5.get_h5obj_value(h5_obj, name, default=None)#
- integrator.hdf5.is_dataset_entry(entry)#
- integrator.hdf5.list_datasets(fname)#
List the entries in the form X.1 in a file
- integrator.hdf5.list_datasets_with_attributes(fname, attrs, default=None)#
- integrator.hdf5.get_data_sources(fname, data_path)#
- class integrator.hdf5.HDF5Dataset(fname, entry=None, detector_name=None, logger=None)#
Bases:
object
A simple class for parsing (ESRF) HDF5 datasets
Build a Dataset object. Each object is tied to only one entry.
- fname: str
Path to the HDF5 file.
- entry: str, optional
HDF5 entry. If not provided, the first entry is taken.
- detector_name: str, optional
Detector name
- logger: Logger, optional
Logging object
- property exposure_time#
Get the exposure time in seconds
- class integrator.hdf5.ID15Dataset(fname, entry=None, detector_name=None, logger=None)#
Bases:
integrator.hdf5.HDF5Dataset
Build a Dataset object. Each object is tied to only one entry.
- fname: str
Path to the HDF5 file.
- entry: str, optional
HDF5 entry. If not provided, the first entry is taken.
- detector_name: str, optional
Detector name
- logger: Logger, optional
Logging object
- get_virtual_sources()#
Return a dict with the virtual sources of the current dataset.
- get_stack_size(use_file_n=0)#
Get the current dataset stack size
- Parameters
use_file_n (integer) – Which file to take to get stack size. Default is first file.
- get_all_stacks_sizes()#
- class integrator.hdf5.ID11Dataset(fname, entry=None, detector_name=None, logger=None)#
Bases:
integrator.hdf5.HDF5Dataset
Build a Dataset object. Each object is tied to only one entry.
- fname: str
Path to the HDF5 file.
- entry: str, optional
HDF5 entry. If not provided, the first entry is taken.
- detector_name: str, optional
Detector name
- logger: Logger, optional
Logging object
- integrator.hdf5.guess_detector_name(fname, entry)#
- integrator.hdf5.get_metadata_for_tomography_reconstruction_id15a(dataset, on_error='print')#
Get the necessary metadata to perform a XRD-CT reconstruction
- Parameters
dataset (ID15Dataset) – Data structure containing information on the current dataset
on_error (str) – What to do when an error occurs (eg. missing metadata). Possible values are “print”, “raise”, “ignore”
- Returns
can_perform_tomo (bool) – Whether a tomography reconstruction can be performed based on the obtained metadata
common_params (dict) – Dictionary with parameters common to all acquisition types
fscan_params (dict) – Dictionary with parameters specific to the current scan type