nabu.pipeline.fallback_utils module

This module is meant to contain classes which are in the process of being superseed by new classes depending on recent packages with fast development cycles in order to be able to fall-back in two cases :

– the new packages, or one of their parts, break from one version to another. – For parts of Nabu which need some extra time to adapt.

class nabu.pipeline.fallback_utils.WriterConfigurator(output_dir, file_prefix, file_format='hdf5', overwrite=False, start_index=None, logger=None, nx_info=None, write_histogram=False, histogram_entry='entry', writer_options=None, extra_options=None)[source]

Bases: object

No dependency on tomoscan for this class. The new class would be WriterManager which depend on tomoscan.

Create a Writer from a set of parameters.

Parameters:
  • output_dir (str) – Directory where the file(s) will be written.

  • file_prefix (str) – File prefix (without leading path)

  • start_index (int, optional) – Index to start the files numbering (filename_0123.ext). Default is 0. Ignored for HDF5 extension.

  • logger (nabu.resources.logger.Logger, optional) – Logger object

  • nx_info (dict, optional) – Dictionary containing the nexus information.

  • write_histogram (bool, optional) – Whether to also write a histogram of data. If set to True, it will configure an additional “writer”.

  • histogram_entry (str, optional) – Name of the HDF5 entry for the output histogram file, if write_histogram is True. Ignored if the output format is already HDF5 : in this case, nx_info[“entry”] is taken.

  • writer_options (dict, optional) – Other advanced options to pass to Writer class.

get_histogram_writer()[source]
write_data(data)[source]