Skip to content

Commit

Permalink
Merge pull request #47 from ecmwf-projects/add_attributes_to_cdm_lite
Browse files Browse the repository at this point in the history
Add attributes to CDM lite
  • Loading branch information
aperezpredictia authored Nov 26, 2024
2 parents 731d4d7 + db73ef0 commit ccca30e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cdsobs/api_rest/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ def get_dataset_service_definition(dataset: str) -> ServiceDefinition:


@router.get("/cdm/lite_variables")
def get_cdm_lite_variables() -> dict[str, list[str]]:
def get_cdm_lite_variables() -> dict[str, list[str] | dict]:
return cdm_lite_variables
29 changes: 28 additions & 1 deletion cdsobs/cdm/lite.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Any

global_attributes_names = [
"comments",
"description",
Expand Down Expand Up @@ -92,8 +94,33 @@
"humidity_bias_estimate",
"wind_bias_estimate",
]
cdm_lite_variables = dict(


cdm_lite_variables: dict[str, list[str] | dict[str, dict[str, Any]]] = dict(
mandatory=variable_names,
optional=optional_variable_names,
auxiliary=auxiliary_variable_names,
attributes={
"uncertainty_value_1": {"long_name": "random_uncertainty"},
"uncertainty_value_10": {"long_name": "negative_systematic_uncertainty"},
"uncertainty_value_11": {"long_name": "positive_systematic_uncertainty"},
"uncertainty_value_12": {"long_name": "negative_quasisystematic_uncertainty"},
"uncertainty_value_13": {"long_name": "positive_quasisystematic_uncertainty"},
"uncertainty_value_14": {"long_name": "negative_structured_random_uncertainty"},
"uncertainty_value_15": {"long_name": "positive_structured_random_uncertainty"},
"uncertainty_value_16": {"long_name": "negative_total_uncertainty"},
"uncertainty_value_17": {"long_name": "positive_total_uncertainty"},
"uncertainty_value_2": {"long_name": "systematic_uncertainty"},
"uncertainty_value_3": {"long_name": "quasisystematic_uncertainty"},
"uncertainty_value_4": {"long_name": "structured_random_uncertainty"},
"uncertainty_value_5": {"long_name": "total_uncertainty"},
"uncertainty_value_6": {
"long_name": "ozone_partial_pressure_total_uncertainty_uncertainty"
},
"uncertainty_value_7": {
"long_name": "ozone_partial_pressure_percentage_uncertainty_uncertainty"
},
"uncertainty_value_8": {"long_name": "negative_random_uncertainty"},
"uncertainty_value_9": {"long_name": "positive_random_uncertainty"},
},
)

0 comments on commit ccca30e

Please sign in to comment.