Skip to content

Commit

Permalink
Merge pull request #48 from ecmwf-projects/fix-uncertainty-names-in-c…
Browse files Browse the repository at this point in the history
…dm-core

fix the uncertainty names for the attributes
  • Loading branch information
aperezpredictia authored Dec 10, 2024
2 parents ccca30e + b028509 commit c69f5f6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
34 changes: 17 additions & 17 deletions cdsobs/cdm/lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,26 @@
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": {
"uncertainty_value1": {"long_name": "random_uncertainty"},
"uncertainty_value10": {"long_name": "negative_systematic_uncertainty"},
"uncertainty_value11": {"long_name": "positive_systematic_uncertainty"},
"uncertainty_value12": {"long_name": "negative_quasisystematic_uncertainty"},
"uncertainty_value13": {"long_name": "positive_quasisystematic_uncertainty"},
"uncertainty_value14": {"long_name": "negative_structured_random_uncertainty"},
"uncertainty_value15": {"long_name": "positive_structured_random_uncertainty"},
"uncertainty_value16": {"long_name": "negative_total_uncertainty"},
"uncertainty_value17": {"long_name": "positive_total_uncertainty"},
"uncertainty_value2": {"long_name": "systematic_uncertainty"},
"uncertainty_value3": {"long_name": "quasisystematic_uncertainty"},
"uncertainty_value4": {"long_name": "structured_random_uncertainty"},
"uncertainty_value5": {"long_name": "total_uncertainty"},
"uncertainty_value6": {
"long_name": "ozone_partial_pressure_total_uncertainty_uncertainty"
},
"uncertainty_value_7": {
"uncertainty_value7": {
"long_name": "ozone_partial_pressure_percentage_uncertainty_uncertainty"
},
"uncertainty_value_8": {"long_name": "negative_random_uncertainty"},
"uncertainty_value_9": {"long_name": "positive_random_uncertainty"},
"uncertainty_value8": {"long_name": "negative_random_uncertainty"},
"uncertainty_value9": {"long_name": "positive_random_uncertainty"},
},
)
6 changes: 5 additions & 1 deletion cdsobs/retrieve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ def retrieve_observations(
global_attributes = get_service_definition(
retrieve_args.dataset
).global_attributes
cdm_lite_vars = list(itertools.chain.from_iterable(cdm_lite_variables.values()))
field_attributes = cdm_lite_variables["attributes"]
cdm_lite_vars = list(
set(itertools.chain.from_iterable(cdm_lite_variables.values()))
)
context = Context()
output_path = retrieve_data(
retrieve_args.dataset,
retrieve_args.params.model_dump(),
output_dir,
object_urls,
cdm_lite_vars,
field_attributes,
global_attributes,
context,
)
Expand Down
1 change: 1 addition & 0 deletions tests/retrieve/test_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def test_adaptor_gnss(tmp_path):
"rename": {"network_type": "dataset_source", "variable": "variables"},
"force": {},
},
"licences": ["licence-to-use-copernicus-products", "gnss-data-policy"],
}
adaptor = ObservationsAdaptor(test_form, **test_adaptor_config)
result = adaptor.retrieve(test_request)
Expand Down

0 comments on commit c69f5f6

Please sign in to comment.