savu.data.data_structures.data module

class Data(name, exp)[source]

The Data class dynamically inherits from transport specific data class and holds the data array, along with associated information.

add_pattern(dtype, **kwargs)[source]

Add a pattern.

Params str dtype

The type of pattern to add, which can be anything from the savu.data.data_structures.utils.pattern_list pattern_list savu.data.data_structures.utils.pattern_list pattern_list:

Keyword Arguments
  • core_dims (tuple) – Dimension indices of core dimensions

  • slice_dims (tuple) – Dimension indices of slice dimensions

add_volume_patterns(x, y, z)[source]

Adds volume patterns

Params int x

dimension to be associated with x-axis

Params int y

dimension to be associated with y-axis

Params int z

dimension to be associated with z-axis

amend_axis_label_values(slice_list)[source]

Amend all axis label values based on the slice_list parameter. This is required if the data is reduced.

get_axis_label_keys()[source]

Get axis_label names

Returns

A list containing associated axis names for each dimension

Return type

list(str)

get_axis_labels()[source]

Get axis labels.

Returns

Axis labels

Return type

list(dict)

get_core_dimensions()[source]

Get the core data dimensions associated with the current pattern.

Returns

value associated with pattern key core_dims

Return type

tuple

get_data_dimension_by_axis_label(name, contains=False, exists=False)[source]

Get the dimension of the data associated with a particular axis_label.

Parameters

name (str) – The name of the axis_label

Keyword Arguments
  • contains (bool) – Set this flag to true if the name is only part of the axis_label name

  • exists (bool) – Set to True to return False rather than Exception

Returns

The associated axis number

Return type

int

get_data_patterns()[source]

Get data patterns associated with this data object.

Returns

A dictionary of associated patterns.

Return type

dict

get_itemsize()[source]

Returns bytes per entry

get_name(orig=False)[source]

Get data name.

Keyword Arguments

orig (bool) – Set this flag to true to return the original cloned dataset name if this dataset is a clone

Returns

the name associated with the dataset

Return type

str

get_original_shape()[source]

Returns the original shape of the data before previewing

Returns

Original data shape.

Return type

tuple

get_preview()[source]

Get the Preview instance associated with the data object

get_previous_pattern()[source]
get_shape()[source]

Get the dataset shape

Returns

data shape

Return type

tuple

get_slice_dimensions()[source]

Get the slice data dimensions associated with the current pattern.

Returns

value associated with pattern key slice_dims

Return type

tuple

set_axis_labels(*args)[source]

Set the axis labels associated with each data dimension.

Parameters

str – Each arg should be of the form name.unit. If name is a data_obj.meta_data entry, it will be output to the final .nxs file.

set_original_shape(shape)[source]

Set the original data shape before previewing

set_shape(shape)[source]

Set the dataset shape.