integrator.watcherv0 module#

class integrator.watcherv0.HDF5AcquisitionEventHandlerv0(logger=None)#

Bases: LoggingEventHandler

on_moved(event)#

Called when a file or a directory is moved or renamed.

Parameters

event (DirMovedEvent or FileMovedEvent) – Event representing file/directory movement.

on_created(event)#

Called when a file or directory is created.

Parameters

event (DirCreatedEvent or FileCreatedEvent) – Event representing file/directory creation.

on_deleted(event)#

Called when a file or directory is deleted.

Parameters

event (DirDeletedEvent or FileDeletedEvent) – Event representing file/directory deletion.

on_modified(event)#

Called when a file or directory is modified.

Parameters

event (DirModifiedEvent or FileModifiedEvent) – Event representing file/directory modification.

class integrator.watcherv0.ScanMonitorIntegrator(watch_path)#

Bases: object

start_acq_watcher()#
stop_acq_watcher()#
integrator.watcherv0.wait_until_h5_is_valid(filename, entry, timeout=100, sleep_step=1, extra_wait_time=5)#

Blocks until a HDF5 acquisition file is deemed complete.

Parameters
  • filename (str) – Path to the HDF5 file to watch.

  • entry (str) – Entry to in the HDF5 file

  • timeout (float, optional) – Time in seconds to wait that HDF5 file is complete.

  • sleep_step (float, optional) – Time in seconds to sleep between each probe of the file

  • extra_wait_time (float, optional) – Extra time to wait (in seconds) after the file is deemed complete. This can be useful on network file systems.

Returns

is_complete – True if the HDF5 file is complete before timeout, False otherwise.

Return type

bool

class integrator.watcherv0.HDF5AcquisitionEventHandler(path, file_pattern)#

Bases: FileSystemEventHandler

on_created(event)#

Called when a file or directory is created.

Parameters

event (DirCreatedEvent or FileCreatedEvent) – Event representing file/directory creation.

integrator.watcherv0.convert_bliss_hdf5_to_nx(input_file, output_file, nxt_conf_file, nxt_plugin_dir)#
integrator.watcherv0.create_integrator_conf_file(conf_fname, input_location, output_location)#