input.converter#
Defines the InputConverter class for converting input files to ValEnsPy complaint xarrays.
Classes
|
A class for converting input files or xarrays to ValEnsPy complaint xarrays. |
- class InputConverter(var_lookup_table: str | dict | Path, converter: Callable = None, metadata_info: dict = None)[source]#
A class for converting input files or xarrays to ValEnsPy complaint xarrays.
- convert_input(data_sources: Path | list[Path] | Dataset, metadata_info: dict = {}) Dataset [source]#
Convert the input file(s) or xarray dataset to CF convention.
- Parameters:
data_sources (Path or list(Path) or xarray.Dataset) – The input file or list of input files or an xarray dataset to convert.
metadata_info (dict, optional) – A dictionary containing additional metadata information for the netCDF file.
- Returns:
An xarray dataset in CF convention.
- Return type:
- property cordex_variables: set#
Return all the CORDEX variables in the lookup table.
- get_CORDEX_variable(raw_variable: str) str [source]#
Get the CORDEX variable name from the raw variable name.
- Parameters:
raw_variable (str) – The raw variable name or long name.
- Returns:
The CORDEX variable name.
- Return type:
str
- get_raw_variable(cordex_variable: str) str [source]#
Get the raw variable name from the CORDEX variable name.
- Parameters:
cordex_variable (str) – The CORDEX variable name.
- Returns:
The raw variable name.
- Return type:
str
- property raw_variables: set#
Return all the raw variables in the lookup table.
- property raw_variables_long_names: set#
Return all the raw variables long names in the lookup table.