ewokstomo.tasks.online.reducedarkflat.OnlineReduceDarkFlat#

class ewokstomo.tasks.online.reducedarkflat.OnlineReduceDarkFlat(inputs=None, varinfo=None, node_id=None, node_attrs=None, execinfo=None, profile_directory=None)[source]#

Bases: Task

Parameters:
get_image_stream_name(scan)[source]#

Returns the image stream name from the scan.

get_reduction_function(method)[source]#

Returns the reduction method to be used.

read_stream(scan, stream_name, output_dtype=<class 'numpy.float32'>)[source]#

Reads data from a stream in the scan.

Return type:

list[ndarray]

run()[source]#

(ESRF-only) Reduce frames from an online scan stream (darks or flats).

This task can work in two modes:

  1. Online: connects to a beacon data stream and reads frames in real-time.

  2. Offline: reads frames from an existing HDF5 scan file.

index: int

The index to assign to the reduced frame in the output file, needed for Nabu.

reduction_method: str

The method to use for reduction (“mean” or “median”).

output_file_path: str

The path to the output HDF5 file where the reduced frame will be saved.

scan_key: str

The identifier key for the scan in the data store. Required for online mode.

scan_file_path: str

The path to the existing HDF5 scan file (for offline mode).

scan_number: int

The scan number within the HDF5 file (for offline mode).

overwrite: bool, optional

Whether to overwrite the output file if it exists (default: True).

output_dtype: numpy data-type, optional

The desired data type for the output frame, needed for Nabu (default: np.float32).