From 94cea1648fa549ed29ef59af2648f8563a33e802 Mon Sep 17 00:00:00 2001 From: Matthew Griffith <93525584+mjg41@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:23:26 +0000 Subject: [PATCH] ECC-1832: GRIB2: Destination Earth On-Demand ExtremesDT metadata support (#267) * ECC-1832: Moved templates into templates directory --- .../grib2/local.destine.on-demand-extremes-dt.def | 6 ++++++ tests/grib_destine_mars_keys.sh | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 definitions/grib2/local.destine.on-demand-extremes-dt.def diff --git a/definitions/grib2/local.destine.on-demand-extremes-dt.def b/definitions/grib2/local.destine.on-demand-extremes-dt.def new file mode 100644 index 000000000..1d7e8ff81 --- /dev/null +++ b/definitions/grib2/local.destine.on-demand-extremes-dt.def @@ -0,0 +1,6 @@ +# DestinE MARS On-Demand ExtremesDT keywords + +# Default is lat,long 0.0,0.0 to 8 chars precision from geolib + +ascii[8] georef = "s0000000" : dump ; +alias mars.georef = georef; diff --git a/tests/grib_destine_mars_keys.sh b/tests/grib_destine_mars_keys.sh index dc24677a8..1c38e665b 100755 --- a/tests/grib_destine_mars_keys.sh +++ b/tests/grib_destine_mars_keys.sh @@ -97,5 +97,18 @@ ${tools_dir}/grib_ls -jm $temp_grib_a ${tools_dir}/grib_set -s productionStatusOfProcessedData=12 $sample_grib2 $temp_grib_a ${tools_dir}/grib_compare -b productionStatusOfProcessedData $sample_grib2 $temp_grib_a +# ECC-1832 On-Demand DT metadata +# Check setting dataset to on-demand-extremes-dt (4). Check keys are present and equal defaults +${tools_dir}/grib_set -s dataset=4 $destine_sample $temp_grib_a + +grib_check_key_exists $temp_grib_a dataset,georef +grib_check_key_equals $temp_grib_a "dataset,dataset:s,georef,mars.georef" "4 on-demand-extremes-dt s0000000 s0000000" + +# Check an example where a few additional things are set in on-demand-extremes-dt + +${tools_dir}/grib_set -s dataset=4,georef=gcpkd2eu $destine_sample $temp_grib_a + +grib_check_key_equals $temp_grib_a "georef" "gcpkd2eu" + # Clean up rm -f $temp_grib_a $temp_grib_b $destine_sample