savu.data.data_structures.plugin_data module

class PluginData(data_obj, plugin=None)[source]

The PluginData class contains plugin specific information about a Data object for the duration of a plugin. An instance of the class is encapsulated inside the Data object during the plugin run

get_core_dimensions()[source]

Return the position of the core dimensions in relation to the data handed to the plugin.

get_core_shape()[source]

Get the shape of the core dimensions only.

Returns

shape of core dimensions

Return type

tuple

get_current_frame_idx()[source]

Returns the index of the frames currently being processed.

get_data_dimension_by_axis_label(label, contains=False)[source]

Return the dimension of the data in the plugin that has the specified axis label.

get_frame_limit()[source]
get_padded_shape()[source]

Get the shape of the data (with padding) that is passed to the plugin process_frames method.

get_pattern()[source]

Get the current pattern.

Returns

dict of the pattern name against the pattern.

Return type

dict

get_pattern_name()[source]

Get the pattern name.

Returns

the pattern name

Return type

str

get_shape()[source]

Get the shape of the data (without padding) that is passed to the plugin process_frames method.

get_shape_transfer()[source]

Get the shape of the plugin data to be transferred each time.

get_slice_dimension()[source]

Return the position of the slice dimension in relation to the data handed to the plugin.

get_total_frames()[source]

Get the total number of frames to process (all MPI processes).

Returns

Number of frames

Return type

int

plugin_data_setup(pattern, nFrames, split=None, slice_axis=None, getall=None, fixed_length=True)[source]

Setup the PluginData object.

Parameters
  • pattern (str) – A pattern name

  • nFrames (int) – How many frames to process at a time. Choose from ‘single’, ‘multiple’, ‘fixed_multiple’ or an integer (an integer should only ever be passed in exceptional circumstances)

Keyword Arguments
  • slice_axis (str) – An axis label associated with the fastest changing (first) slice dimension.

  • axis_label] getall (list[pattern,) – A list of two values. If the requested pattern doesn’t exist then use all of “axis_label” dimension of “pattern” as this is equivalent to one slice of the original pattern.

  • fixed_length – Data passed to the plugin is automatically padded to ensure all plugin data has the same dimensions. Set this value to False to turn this off.

plugin_data_transfer_setup(copy=None, calc=None)[source]

Set up the plugin data transfer frame parameters. If copy=pData (another PluginData instance) then copy

set_bytes_per_frame()[source]

Return the size of a single frame in bytes.

set_fixed_dimensions(dims, values)[source]

Fix a data direction to the index in values list.

Parameters
  • dims (list(int)) – Directions to fix

  • value (list(int)) – Index of fixed directions

set_slicing_order(order)[source]

Reorder the slice dimensions. The fastest changing slice dimension will always be the first one stated in the pattern key slice_dir. The input param is a tuple stating the desired order of slicing dimensions relative to the current order.