hydro.utils¶
Functions¶
|
|
|
Test if all the values of an ndarray are the same value |
|
Adds a profile_type string variable to the dataset. |
|
Adds a CF-1.8 Geometry container variable to the dataset |
|
Find all the paraters in the cdom group and add their wavelength in a new coordinate |
|
Takes the a dataset with a CDOM wavelength and explocdes it back into individual variables |
Get the numeric precision of a printed decimal number |
|
|
Set the CF axis attribute on our axis variables (XYZT) |
|
Sets the _FillValue encoidng to None for 1D coordinate vars |
Module Contents¶
- hydro.utils._is_all_dataarray(val)[source]¶
- Parameters:
val (list[Any])
- Return type:
TypeGuard[list[xarray.DataArray]]
- hydro.utils.all_same(ndarr)[source]¶
Test if all the values of an ndarray are the same value
- Parameters:
ndarr (numpy.ndarray)
- Return type:
numpy.bool_
- hydro.utils.add_profile_type(dataset, ftype)[source]¶
Adds a profile_type string variable to the dataset.
This is for ODV compatability
Warning
Currently mixed profile types are not supported
- Parameters:
dataset (xarray.Dataset)
ftype (cchdo.hydro.types.FileTypeType)
- Return type:
- hydro.utils.add_geometry_var(dataset)[source]¶
Adds a CF-1.8 Geometry container variable to the dataset
This allows for compatabiltiy with tools like gdal
- Parameters:
dataset (xarray.Dataset)
- Return type:
- hydro.utils.add_cdom_coordinate(dataset)[source]¶
Find all the paraters in the cdom group and add their wavelength in a new coordinate
- Parameters:
dataset (xarray.Dataset)
- Return type:
- hydro.utils.flatten_cdom_coordinate(dataset)[source]¶
Takes the a dataset with a CDOM wavelength and explocdes it back into individual variables
- Parameters:
dataset (xarray.Dataset)
- Return type:
- hydro.utils.extract_numeric_precisions(data)[source]¶
Get the numeric precision of a printed decimal number
- hydro.utils.set_axis_attrs(dataset)[source]¶
Set the CF axis attribute on our axis variables (XYZT)
longitude = “X”
latitude = “Y”
pressure = “Z”, addtionally, positive is down
time = “T”
- Parameters:
dataset (xarray.Dataset)
- Return type:
- hydro.utils.set_coordinate_encoding_fill(dataset)[source]¶
Sets the _FillValue encoidng to None for 1D coordinate vars
- Parameters:
dataset (xarray.Dataset)
- Return type: