earthkit.data.xr_engine.dim

Attributes

Classes

CompoundKey

CompoundKeyDim

Represent a dimension.

CustomForecastRefDim

Represent a dimension.

DateDim

Represent a dimension.

Dim

Represent a dimension.

DimBuilder

DimHandler

DimRole

ForecastRefTimeDim

Represent a dimension.

IndexingTimeDim

Represent a dimension.

LevelAndTypeDim

Represent a dimension.

LevelAndTypeDimMode

LevelDim

Represent a dimension.

LevelDimBuilder

LevelDimMode

LevelPerTypeDim

Represent a dimension.

LevelPerTypeDimMode

LevelTypeDim

Represent a dimension.

MemberDim

Represent a dimension.

MemberDimBuilder

OtherDim

Represent a dimension.

ParamLevelKey

ReferenceTimeDim

Represent a dimension.

RemappingDim

Represent a dimension.

StepDim

Represent a dimension.

TimeDim

Represent a dimension.

TimeDimBuilder

Build time dimensions based on the time_dims list.

ValidTimeDim

Represent a dimension.

Functions

ensure_dim_map(d)

find_alias(key[, drop])

get_keys(keys[, drop])

make_dim(owner, *args[, name, key])

Module Contents

earthkit.data.xr_engine.dim.ALL_TIME_ROLES = ['forecast_reference_time', 'step', 'valid_time', 'date', 'time']
earthkit.data.xr_engine.dim.BASE_DATETIME_KEYS
earthkit.data.xr_engine.dim.COMPOUND_KEYS
class earthkit.data.xr_engine.dim.CompoundKey
keys = []
static make(key)
name = None
remapping()
class earthkit.data.xr_engine.dim.CompoundKeyDim(owner, ck)

Bases: RemappingDim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
build_drop(keys)
check()
ck
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
keys
label = None
name
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.CustomForecastRefDim(owner, keys, *args, active=True, name=None, **kwargs)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop = None
enforce_unique = False
get_simple_name()
key = None
label = None
name = None
owner
profile
remapping_keys()
update(ds)
earthkit.data.xr_engine.dim.DATETIME_KEYS
earthkit.data.xr_engine.dim.DATE_KEYS
earthkit.data.xr_engine.dim.DIM_BUILDERS
class earthkit.data.xr_engine.dim.DateDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
name = 'date'
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.Dim(owner, name=None, key=None, alias=None, drop=None, active=True)

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop = None
enforce_unique = False
get_simple_name()
key = None
label = None
name = None
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.DimBuilder
dims()
ignored
used
class earthkit.data.xr_engine.dim.DimHandler(profile, extra_dims, drop_dims, ensure_dims, fixed_dims, split_dims, rename_dims, dim_roles, dim_name_from_role_name, dims_as_attrs, time_dims, level_dim_mode, squeeze)
property active_dim_keys
property active_time_dim_names

Return the names of the active time dimensions in dim order.

Handles both the normal case (dims built via TimeDimBuilder) and the fixed_dims case where dim names are raw metadata keys.

deactivate(keys, ignore_dim=None, others=False, collect=False)
dim_roles
dims_as_attrs = []
drop_dims = []
ensure_dims = []
extra_dims
fixed_dims
get_dims(names)
level_dim_mode
make_coords()
profile
register_remapping(remapping, patch=None)
remove(keys, ignore_dim=None, others=False, collect=False)
rename_dataset_dims(dataset)
rename_dims_map
split_dims = []
squeeze
time_dims = []
to_list()
update(ds)
var_dim_found_error_message(keys)
var_key_dim = None
class earthkit.data.xr_engine.dim.DimRole(d, name_as_key=True)
NAMES = ('member', 'date', 'time', 'step', 'level', 'level_type', 'forecast_reference_time', 'valid_time')
d
name_as_key = True
role(name, default=None, raise_error=True)
earthkit.data.xr_engine.dim.ENS_KEYS
class earthkit.data.xr_engine.dim.ForecastRefTimeDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = ['time.base_datetime']
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
name = 'forecast_reference_time'
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.IndexingTimeDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
name = 'indexing_time'
owner
profile
remapping_keys()
update(ds)
earthkit.data.xr_engine.dim.KEYS
earthkit.data.xr_engine.dim.LEVEL_DIM_MODES
earthkit.data.xr_engine.dim.LEVEL_KEYS
earthkit.data.xr_engine.dim.LEVEL_TYPE_KEYS
class earthkit.data.xr_engine.dim.LevelAndTypeDim(owner, level_key, level_type_key, active=True, *args, **kwargs)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
level_key
level_type_key
name = 'level_and_type'
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.LevelAndTypeDimMode
build(profile, owner, **kwargs)
dim
name = 'level_and_type'
class earthkit.data.xr_engine.dim.LevelDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop = None
enforce_unique = False
get_simple_name()
key = None
label = None
name = None
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.LevelDimBuilder(profile, owner)

Bases: DimBuilder

dims()
ignored
name = 'level'
used
class earthkit.data.xr_engine.dim.LevelDimMode
build(profile, owner, **kwargs)
name = 'level'
class earthkit.data.xr_engine.dim.LevelPerTypeDim(owner, level_key, level_type_key, *args, **kwargs)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key
label = None
level_key
level_type_key
name = '<level_per_type>'
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.LevelPerTypeDimMode

Bases: LevelAndTypeDimMode

build(profile, owner, **kwargs)
dim
name = 'level_per_type'
class earthkit.data.xr_engine.dim.LevelTypeDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop = None
enforce_unique = True
get_simple_name()
key = None
label = None
name = None
owner
profile
remapping_keys()
update(ds)
earthkit.data.xr_engine.dim.MONTH_KEYS
class earthkit.data.xr_engine.dim.MemberDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop = None
enforce_unique = False
get_simple_name()
key = None
label = None
name = None
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.MemberDimBuilder(profile, owner)

Bases: DimBuilder

dims()
ignored
name = 'member'
used
class earthkit.data.xr_engine.dim.OtherDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop = None
enforce_unique = False
get_simple_name()
key = None
label = None
name = None
owner
profile
remapping_keys()
update(ds)
earthkit.data.xr_engine.dim.PREDEFINED_DIMS
class earthkit.data.xr_engine.dim.ParamLevelKey

Bases: CompoundKey

keys = ['param', 'level', 'levelist']
static make(key)
name = 'param_level'
remapping()
class earthkit.data.xr_engine.dim.ReferenceTimeDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
name = 'reference_time'
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.RemappingDim(owner, name, keys, **kwargs)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
build_drop(keys)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
keys
label = None
name
owner
profile
remapping_keys()
update(ds)
earthkit.data.xr_engine.dim.STEP_KEYS
class earthkit.data.xr_engine.dim.StepDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = ['step', 'step_timedelta']
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
name = None
owner
profile
remapping_keys()
update(ds)
earthkit.data.xr_engine.dim.TIME_KEYS
class earthkit.data.xr_engine.dim.TimeDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
name = 'time'
owner
profile
remapping_keys()
update(ds)
class earthkit.data.xr_engine.dim.TimeDimBuilder(profile, owner)

Bases: DimBuilder

Build time dimensions based on the time_dims list.

Each element of time_dims is a role name (e.g. "forecast_reference_time", "step", "valid_time", "date", "time"). For every requested role the corresponding dimension is created as active; all other known time roles are created as inactive (ignored).

dims()
ignored
name = 'time'
used
earthkit.data.xr_engine.dim.VALID_DATETIME_KEYS
class earthkit.data.xr_engine.dim.ValidTimeDim(owner, name=None, key=None, alias=None, drop=None, active=True)

Bases: Dim

Represent a dimension.

Parameters:
  • name (str) – Name of the dimension.

  • key (str) – Metadata key to be used to get the values of the dimension.

  • alias (list) – List of metadata keys that has the same meaning as the key.

  • drop (list) – List of metadata keys used to identify the dimensions that cannot be used when the current dimension is active. When this dimension is active and the dimension consistency is checked all the other dimensions containing any keys from drop as name, key or alias should be deactivated.

  • active (bool) – Status. Only active dimensions are used in the dataset construction.

active = True
alias = None
as_coord(values, source)
check()
condition()
coords
deactivate_drop_list()
dim_key(source)
drop
enforce_unique = False
get_simple_name()
key = None
label = None
name = 'valid_time'
owner
profile
remapping_keys()
update(ds)
earthkit.data.xr_engine.dim.ensure_dim_map(d)
earthkit.data.xr_engine.dim.find_alias(key, drop=None)
earthkit.data.xr_engine.dim.get_keys(keys, drop=None)
earthkit.data.xr_engine.dim.make_dim(owner, *args, name=None, key=None, **kwargs)