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
Write this parameter value to an HDF5 group.
For custom initialisation via YAML or JSON.
Prepare this parameter value for serialisation as JSON.
Generate random uniformly distributed unit quaternions.
Save orientation data from an HDF5 group to a persistent workflow.
Extract a parameter value from JSON data.
Serialise this parameter value as a dictionary.
Attributes
- Parameters:
data (ndarray) –
unit_cell_alignment (UnitCellAlignment) –
representation (OrientationRepresentation) –
- 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)#
- 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#