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
For custom initialisation via YAML or JSON.
Generate random uniformly distributed unit quaternions.
Save orientation data from an HDF5 group to a persistent workflow.
Attributes
- Parameters:
data (ndarray) –
unit_cell_alignment (UnitCellAlignment) –
representation (OrientationRepresentation) –
- dump_to_HDF5_group(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) –
- to_dict()#
- unit_cell_alignment: UnitCellAlignment#