geoh5py.data¶
geoh5py.data.blob_data¶
geoh5py.data.color_map¶
- class geoh5py.data.color_map.ColorMap(**kwargs)[source]¶
Bases:
object
Records colors assigned to value ranges (where Value is the start of the range).
- property name: str¶
str
: Name of the colormap
- property parent¶
Parent data type
- property values: ndarray | None¶
numpy.array
: Colormap defined by values and corresponding RGBA:values = [ [V_1, R_1, G_1, B_1, A_1], ..., [V_i, R_i, G_i, B_i, A_i] ]
where V (Values) are sorted floats defining the position of each RGBA. R (Red), G (Green), B (Blue) and A (Alpha) are integer values between [0, 255].
geoh5py.data.data¶
- class geoh5py.data.data.Data(data_type: DataType, **kwargs)[source]¶
Bases:
Entity
Base class for Data entities.
- property association: DataAssociationEnum | None¶
DataAssociationEnum
: Relationship made between thevalues()
and elements of theparent
object. Association can be set from astr
chosen from the list of availableDataAssociationEnum
options.
- copy(parent=None, copy_children: bool = True, clear_cache: bool = False, mask: ndarray | None = None, **kwargs) Data [source]¶
Function to copy data to a different parent entity.
- Parameters:
parent – Target parent to copy the entity under. Copied to current
parent
if None.copy_children – (Optional) Create copies of all children entities along with it.
clear_cache – Clear array attributes after copy.
mask – Array of bool defining the values to keep.
kwargs – Additional keyword arguments to pass to the copy constructor.
- Return entity:
Registered Entity to the workspace.
- property extent: ndarray | None¶
Geography bounding box of the parent object.
- Returns:
shape(2, 3) Bounding box defined by the bottom South-West and top North-East coordinates.
- mask_by_extent(extent: ndarray, inverse: bool = False) ndarray | None [source]¶
Sub-class extension of
mask_by_extent()
.Uses the parent object’s vertices or centroids coordinates.
- property modifiable: bool¶
bool
Entity can be modified.
- property n_values: int | None¶
int
: Number of expected data values based onassociation
- property nan_value: None¶
Value used to represent missing data in python.
- abstract classmethod primitive_type() PrimitiveTypeEnum [source]¶
- property values¶
Data values
geoh5py.data.data_association_enum¶
geoh5py.data.data_type¶
- class geoh5py.data.data_type.DataType(workspace: workspace.Workspace, **kwargs)[source]¶
Bases:
EntityType
DataType class
- property color_map: ColorMap | None¶
ColorMap
: Colormap used for plottingThe colormap can be set from a
dict
of sorted values with corresponding RGBA color.color_map = { val_1: [r_1, g_1, b_1, a_1], ..., val_i: [r_i, g_i, b_i, a_i] }
- classmethod create(workspace: workspace.Workspace, data_class: type[data.Data]) DataType [source]¶
Creates a new instance of
DataType
with correspondingPrimitiveTypeEnum
.
- classmethod find_or_create(workspace: workspace.Workspace, **kwargs) DataType [source]¶
Find or creates an EntityType with given UUID that matches the given Group implementation class.
- Parameters:
workspace – An active Workspace class
- Returns:
A new instance of DataType.
- classmethod for_x_data(workspace: workspace.Workspace) DataType [source]¶
- classmethod for_y_data(workspace: workspace.Workspace) DataType [source]¶
- classmethod for_z_data(workspace: workspace.Workspace) DataType [source]¶
bool
: Hidden data [False]
- property mapping: str¶
str
: Color stretching type chosen from: ‘linear’, [‘equal_area’], ‘logarithmic’, ‘cdf’, ‘missing’
- property number_of_bins: int | None¶
int
: Number of bins used by the histogram [50]
- property primitive_type: PrimitiveTypeEnum | None¶
- property transparent_no_data: bool¶
bool
: Use transparent for no-data-value [True]
- property units: str | None¶
str
: Data units
- property value_map: ReferenceValueMap | None¶
ReferenceValueMap
: Reference value map forReferenceData
The value_map can be set from a
dict
of sorted values with correspondingstr
description.value_map = { val_1: str_1, ..., val_i: str_i }
geoh5py.data.data_unit¶
geoh5py.data.datetime_data¶
geoh5py.data.filename_data¶
- class geoh5py.data.filename_data.FilenameData(data_type: DataType, file_name=None, **kwargs)[source]¶
Bases:
Data
- property file_name: str | None¶
str
Text value.
- classmethod primitive_type() PrimitiveTypeEnum [source]¶
- save_file(path: str | Path = PosixPath('.'), name=None)[source]¶
Save the file to disk.
- Parameters:
path – Directory to save the file to.
name – Name given to the file.
- property values: bytes | None¶
Binary
str
value representation of a file.
geoh5py.data.float_data¶
- class geoh5py.data.float_data.FloatData(data_type: DataType, **kwargs)[source]¶
Bases:
NumericData
Data container for floats values
- format_type(values: ndarray) ndarray [source]¶
Check if the type of values is valid and coerse to type float64. :param values: numpy array to modify. :return: the formatted values.
- property nan_value¶
Nan-Data-Value
- property ndv: float¶
No-Data-Value
- classmethod primitive_type() PrimitiveTypeEnum [source]¶
geoh5py.data.geometric_data_constants¶
geoh5py.data.integer_data¶
- class geoh5py.data.integer_data.IntegerData(data_type: DataType, **kwargs)[source]¶
Bases:
NumericData
- format_type(values: ndarray) ndarray [source]¶
Check if the type of values is valid and coerse to type int32. :param values: numpy array to modify. :return: the formatted values.
- property nan_value¶
Nan-Data-Value
- property ndv: int¶
No-Data-Value
- classmethod primitive_type() PrimitiveTypeEnum [source]¶
geoh5py.data.numeric_data¶
- class geoh5py.data.numeric_data.NumericData(data_type: DataType, **kwargs)[source]¶
Bases:
Data
,ABC
Data container for floats values
- format_length(values: ndarray) ndarray [source]¶
Check for possible mismatch between the length of values :param values: the values to check. :return: the values with the right length.
- abstract format_type(values: ndarray) ndarray [source]¶
Check if the type of values is valid and convert it to right dtype. :param values: numpy array to modify. :return: the formatted values.
- format_values(values: ndarray | None) ndarray [source]¶
Check for possible mismatch between the length of values stored and the expected number of cells or vertices.
- Parameters:
values – Array of values to check
- Returns:
values: An array of float values of length n_values or None
- abstract property ndv¶
No-data-value
- classmethod primitive_type() PrimitiveTypeEnum [source]¶
- property values: ndarray | None¶
- Returns:
values: An array of values
geoh5py.data.primitive_type_enum¶
geoh5py.data.reference_value_map¶
geoh5py.data.referenced_data¶
- class geoh5py.data.referenced_data.ReferencedData(data_type: DataType, **kwargs)[source]¶
Bases:
IntegerData
Reference data described by indices and associated strings.
- classmethod primitive_type() PrimitiveTypeEnum [source]¶
- property value_map¶
Pointer to the
data.data_type.DataType.value_map
geoh5py.data.text_data¶
- class geoh5py.data.text_data.CommentsData(data_type: DataType, **kwargs)[source]¶
Bases:
Data
Comments added to an Object or Group. Stored as a list of dictionaries with the following keys:
comments = [ { "Author": "username", "Date": "2020-05-21T10:12:15", "Text": "A text comment." }, ]
- classmethod primitive_type() PrimitiveTypeEnum [source]¶
- property values: list[dict] | None¶
list
List of comments
geoh5py.data.unknown_data¶
- class geoh5py.data.unknown_data.UnknownData(data_type: DataType, association: DataAssociationEnum, name: str, uid: UUID | None = None)[source]¶
Bases:
Data
- classmethod primitive_type() PrimitiveTypeEnum [source]¶