darfix.core.dimension.Dimension#
- class darfix.core.dimension.Dimension(kind, name, size=None, _range=None, tolerance=1e-09, unique_values=None)[source]#
Bases:
object
Define a dimension used during the dataset
- Parameters:
kind (str | int) – metadata type in fabioh5 mapping
name (str) – name of the dimension (should fit the fabioh5 mapping for now)
size (int | None) – length of the dimension.
kind –
name –
size –
tolerance (float) –
unique_values (Sequence[float] | None) –
- static from_dict(_dict)[source]#
- Parameters:
_dict (
dict
) – dict defining the dimension. Should contains the following keys: name, kind, size. Unique values are not stored into it because it depends on the metadata and should be obtained from a fit / set_dims_dict –
- Returns:
Dimension corresponding to the dict given
- Return type:
- property kind#
- property name: str#
- property range#
- set_unique_values(values)[source]#
Sets the unique values of the dimension. If the size of the dimension is fixed, it automatically sets the first size values, else it finds the unique values.
- Parameters:
values (
Sequence
[float
]) – list of values.values –
- property size: int | None#
- property tolerance: float#
- property unique_values: list[float]#