dpyverification.datasources.netcdf#
Read and write NetCDF files in a fews compatible format.
Classes
|
A datasource for reading NetCDF files compatible with the internal datamodel. |
|
A NetCDF config element. |
- class dpyverification.datasources.netcdf.NetCDF(config)[source]#
A datasource for reading NetCDF files compatible with the internal datamodel.
You can validate that the NetCDF file satisfies the internal datamodel using the following example:
import xarray as xr from dpyverification.datasources import validate_input_data data_array = xr.open_dataarray("path/to/netcdf/file/example.nc") validated_data = validate_input_data(data_array)
Note
The NetCDF file must contain exactly one data variable. The data variable must also have a
data_typeattribute that matches one of the supported data types.- Parameters:
config (NetCDFConfig)
- config_class#
alias of
NetCDFConfig
- class dpyverification.datasources.netcdf.NetCDFConfig(*, directory, filename_glob, import_adapter, source, data_type, general, id_mapping=None, **extra_data)[source]#
A NetCDF config element.
- Parameters:
directory (str)
filename_glob (str)
import_adapter (Literal[DataSourceKind.NETCDF])
source (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_]*$), MinLen(min_length=1)])
data_type (DataType)
general (Annotated[GeneralInfoConfig, SkipJsonSchema()])
id_mapping (Annotated[IdMappingConfig, SkipJsonSchema()] | None)
extra_data (Any)