matflow.param_classes.orientations.Orientations#

class matflow.param_classes.orientations.Orientations(data: numpy.ndarray, unit_cell_alignment: matflow.param_classes.orientations.UnitCellAlignment, representation: matflow.param_classes.orientations.OrientationRepresentation)#

Bases: ParameterValue

Methods

dump_to_HDF5_group

Write this parameter value to an HDF5 group.

from_JSON_like

For custom initialisation via YAML or JSON.

from_file

from_random

prepare_JSON_dump

Prepare this parameter value for serialisation as JSON.

quat_sample_random

Generate random uniformly distributed unit quaternions.

save_from_HDF5_group

Save orientation data from an HDF5 group to a persistent workflow.

save_from_JSON

Extract a parameter value from JSON data.

to_dict

Serialise this parameter value as a dictionary.

Attributes

data

unit_cell_alignment

representation

Parameters:
data: ndarray#
dump_to_HDF5_group(group)#

Write this parameter value to an HDF5 group.

classmethod from_JSON_like(data, ori_format)#

For custom initialisation via YAML or JSON.

classmethod from_file(path, representation, unit_cell_alignment, number=None, start_index=0, delimiter=' ')#
classmethod from_random(number)#
prepare_JSON_dump()#

Prepare this parameter value for serialisation as JSON.

Return type:

Dict

static quat_sample_random(number)#

Generate random uniformly distributed unit quaternions.

Parameters:

number (int) – How many quaternions to generate.

Returns:

quats

Return type:

ndarray of shape (number, 4)

References

https://stackoverflow.com/a/44031492/5042280 http://planning.cs.uiuc.edu/node198.html

representation: OrientationRepresentation#
classmethod save_from_HDF5_group(group, param_id, workflow)#

Save orientation data from an HDF5 group to a persistent workflow.

We avoid loading the data into memory all at once by firstly generating an Orientations object with a small data array, and then copying from the HDF5 group directly into the newly created Zarr group.

Parameters:

param_id (int) –

classmethod save_from_JSON(data, param_id, workflow)#

Extract a parameter value from JSON data.

Parameters:

param_id (int) –

to_dict()#

Serialise this parameter value as a dictionary.

unit_cell_alignment: UnitCellAlignment#