swxsoc_reach.util.schema#

REACH-specific schema metadata derivations.

Extends SWXSchema with REACH-specific global and variable attribute schema layers (YAML) and custom derivation functions.

This follows the same pattern established by the HERMES mission in hermes_core.util.schema.HermesDataSchema.

Classes

REACHDataSchema([global_schema_layers, ...])

Schema for REACH CDF data requirements and formatting.

class swxsoc_reach.util.schema.REACHDataSchema(global_schema_layers: list[Path] | None = None, variable_schema_layers: list[Path] | None = None, use_defaults: bool | None = True)[source]#

Schema for REACH CDF data requirements and formatting.

Layers REACH-specific global and variable attribute YAML schemas on top of the SWxSOC defaults. Overrides derivation functions for Logical_source and Logical_file_id to produce REACH-appropriate values.

Parameters:
  • global_schema_layers (list[Path] or None, optional) – Additional global attribute schema files layered after the REACH defaults.

  • variable_schema_layers (list[Path] or None, optional) – Additional variable attribute schema files layered after the REACH defaults.

  • use_defaults (bool, optional) – Whether to include the SWxSOC/SAMMI base defaults (default True).

_get_logical_file_id(data)[source]#

Derive the Logical_file_id global attribute for REACH.

The attribute stores the name of the CDF File without the file extension (e.g. ‘.cdf’). This attribute is requires to avoid loss of the originial source in case of renaming.

Parameters:

data (SWXData) – The assembled SWXData instance.

Returns:

strLogical_file_id value (CDF filename without extension).

_get_logical_source(data)[source]#

Derive the Logical_source global attribute for REACH.

The logical source is the combination of the data source, data type, and instrument mode.

Parameters:

data (SWXData) – The assembled SWXData instance.

Returns:

strLogical_source value.

_get_reach_version(data)[source]#

Return the swxsoc_reach package version used to generate the CDF.

Parameters:

data (SWXData) – The assembled SWXData instance.

Returns:

str – Package version string.