NEDAS.core.types module

class NEDAS.core.types.VarDesc(name: str | tuple[str, str], is_vector: bool, dtype: str = 'float', dt: float = 1, levels: Annotated[Union[numpy.ndarray, Sequence], 'z levels'] = <factory>, units: Annotated[str | float, 'physical unit'] = 1, z_units: Annotated[str | float, 'physical unit'] = 1)[source]

Bases: object

name: str | tuple[str, str]
is_vector: bool
dtype: str = 'float'
dt: float = 1
levels: Annotated[ndarray | Sequence, 'z levels']
units: Annotated[str | float, 'physical unit'] = 1
z_units: Annotated[str | float, 'physical unit'] = 1
asdict() dict[source]
class NEDAS.core.types.FieldRecord(name: str, model_src: str, dtype: str, is_vector: bool, units: Annotated[str | float, 'physical unit'], err_type: str, time: datetime, dt: float, k: Annotated[int, 'z level index'], pos: int)[source]

Bases: object

Represents a single 2D slice in the state vector.

Variables:
  • name (str) – name of the state variable

  • model_src (str) – name of the model source module for this variable

  • dtype (str) – data type

  • is_vector (bool) – if this variable is a vector

  • units (str|float) – physical units of this variable

  • err_type (str) – type of error model to use for this variable

  • time (datetime) – time coordinate for this field

  • dt (float) – representative time interval (hours) for this field

  • k (int) – vertical z coordinate index for this field

  • pos (int) – seek position (number of bytes) for the start of this field in the binary file

name: str
model_src: str
dtype: str
is_vector: bool
units: Annotated[str | float, 'physical unit']
err_type: str
time: datetime
dt: float
k: Annotated[int, 'z level index']
pos: int
asdict() dict[source]
class NEDAS.core.types.ErrorModel(type: str, std: float, hcorr: float, vcorr: float, tcorr: float, cross_corr: tuple[float, ...], infl: float = 1.0)[source]

Bases: object

Parameters defining an error model

Variables:
  • type (str) – type of error distribution

  • std (float) – error standard deviation, in variable units

  • hcorr (float) – horizontal correlation scale, in grid.x units

  • vcorr (float) – vertical correlation scale, in z units

  • tcorr (float) – temporal correlation scale, in hours

  • cross_corr (tuple[float, ...]) – cross-variable correlation with each variable in ObsInfo.variables, in that same order (positional, not name-keyed – see ObsInfo.add_obs_record). A plain dict here previously made ErrorModel instances unhashable, which crashed any lru_cache’d function fed **obs_rec.asdict() as kwargs (e.g. a model’s z_coords); a tuple is hashable and frozen=True makes the whole ErrorModel hashable as long as every field is.

  • infl (float) – multiplier on std applied only when packed into obs_data for the assimilator’s R, not to the generated obs noise itself

type: str
std: float
hcorr: float
vcorr: float
tcorr: float
cross_corr: tuple[float, ...]
infl: float = 1.0
asdict() dict[source]
class NEDAS.core.types.ObsRecord(name: str, dataset_src: str, model_src: str, nobs: int, obs_window_min: int, obs_window_max: int, dtype: str, is_vector: bool, units: Annotated[str | float, 'physical unit'], z_units: Annotated[str | float, 'physical unit'], time: datetime, dt: float, err: ErrorModel, hroi: float, vroi: float, troi: float, impact_on_variable: tuple[float, ...], pos: int = 0)[source]

Bases: object

Represents a single observation record in the full list of observations

Variables:
  • name (str) – name of the observation record

  • dataset_src (str) – name of dataset source module for this observation

  • model_src (str) – name of the model source module for this observation

  • nobs (int) – number of individual observations in this record

  • obs_window_min (int) – offset from analysis time for the start of the observation window (hours)

  • obs_window_max (int) – offset from analysis time for the end of the observation window (hours)

  • err (ErrorModel) – error model used for this observation

  • dtype (str) – data type

  • is_vector (bool) – if this variable is a vector

  • units (str) – physical units of this observation

  • z_units (str) – vertical coordinate units

  • time (datetime) – time coordinate for this observation

  • dt (float) – representative time interval (hours) for this observation

  • impact_on_variable (tuple[float, ...]) – impact of this obs record on each state variable in state.info.variables, in that same order (positional, not name-keyed – see ObsInfo.add_obs_record). Was a dict; same hashability rationale as ErrorModel.cross_corr.

name: str
dataset_src: str
model_src: str
nobs: int
obs_window_min: int
obs_window_max: int
dtype: str
is_vector: bool
units: Annotated[str | float, 'physical unit']
z_units: Annotated[str | float, 'physical unit']
time: datetime
dt: float
err: ErrorModel
hroi: float
vroi: float
troi: float
impact_on_variable: tuple[float, ...]
pos: int = 0
asdict() dict[source]
class NEDAS.core.types.ScalarRecord(name: str, model_src: str, dtype: str, units: Annotated[str | float, 'physical unit'], err_type: str)[source]

Bases: object

Represents a scalar parameter in the augmented state vector (SSPE).

Variables:
  • name (str) – name of the parameter

  • model_src (str) – name of the model source module for this parameter

  • dtype (str) – data type

  • units (str|float) – physical units

  • err_type (str) – type of error model to use for this parameter

name: str
model_src: str
dtype: str
units: Annotated[str | float, 'physical unit']
err_type: str
asdict() dict[source]