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: 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: 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.repack_output(output_file, detector_name, entry, result_files=None, legacy_file=None, logger=None)#

Transform a output file containing virtual dataset, to a output file containing all the data. This was written for ID15A where using too many files (partial results) was problematic for data archival. This function will:

  • “repack” the output file “output_id15a.h5”

  • update the virtual dataset in output file “output.nx”

  • delete the many partial result files

Parameters
  • output_file (str) – Absolute path to the output (NX) file

  • detector_name (str) – Name of the detector, eg. “pilatus”

  • entry (str) – Entry name in the HDF5 files, usually “1.1”

  • results_files (list of str, optional) – List of files linked by the output file virtual dataset. If not provided, the function will attempt at guessing it.

  • legacy_file (str, optional) – Absolute path to the HDF5 legacy file (.h5). If not provided, the function will attempt at guessing it.

  • logger (logging object, optional) – Logger object.