From c207be7801414a8b16f365f478aeff73dea68000 Mon Sep 17 00:00:00 2001 From: Kevin Nobel Date: Mon, 20 Jan 2025 12:51:35 +0000 Subject: [PATCH] Add comparison test for nested HEALPix 1024 interpolation --- .../interpolate-healpix-nested/CMakeLists.txt | 61 +++++++++++-------- .../mapping_1024.yaml | 1 + ...uced_gg_to_HEALPix_1024_nested_direct.yaml | 20 ++++++ ...ed_gg_to_HEALPix_1024_nested_original.yaml | 24 ++++++++ 4 files changed, 80 insertions(+), 26 deletions(-) create mode 120000 tests/multio/action/interpolate-healpix-nested/mapping_1024.yaml create mode 100644 tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_direct.yaml create mode 100644 tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_original.yaml diff --git a/tests/multio/action/interpolate-healpix-nested/CMakeLists.txt b/tests/multio/action/interpolate-healpix-nested/CMakeLists.txt index d152620a2..8a412a5c7 100644 --- a/tests/multio/action/interpolate-healpix-nested/CMakeLists.txt +++ b/tests/multio/action/interpolate-healpix-nested/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PREFIX multio_tests_action_interpolate_reduced_gg_to_HEALPix_32_nested) +set(DATA_PREFIX multio_tests_action_interpolate_reduced_gg_to_HEALPix_nested) ecbuild_get_test_multidata( TARGET ${PREFIX}_get_data_interpolate @@ -12,34 +12,43 @@ ecbuild_get_test_multidata( DIRNAME multio/tests/actions/healpix_ring2nest DIRLOCAL ${CMAKE_CURRENT_BINARY_DIR} NAMES "Reference_HEALPix_32_nested.grib" + "Reference_HEALPix_1024_nested.grib" "HEALPix_ring2nest.atlas" ) -ecbuild_add_test( - TARGET ${PREFIX}_original - TEST_DEPENDS ${PREFIX}_get_data_interpolate ${PREFIX}_get_data_healpix_ring2nest - COMMAND multio-feed - ARGS ${CMAKE_CURRENT_BINARY_DIR}/MARS_reduced_gg.grib --decode --plans=${CMAKE_CURRENT_SOURCE_DIR}/reduced_gg_to_HEALPix_32_nested_original.yaml -) -set_tests_properties(${PREFIX}_original PROPERTIES - FIXTURES_SETUP ${PREFIX}_original +foreach (_n + 32 + 1024 ) + set(PREFIX multio_tests_action_interpolate_reduced_gg_to_HEALPix_${_n}_nested) -ecbuild_add_test( - TARGET ${PREFIX}_direct - TEST_DEPENDS ${PREFIX}_get_data_interpolate ${PREFIX}_get_data_healpix_ring2nest - COMMAND multio-feed - ARGS ${CMAKE_CURRENT_BINARY_DIR}/MARS_reduced_gg.grib --decode --plans=${CMAKE_CURRENT_SOURCE_DIR}/reduced_gg_to_HEALPix_32_nested_direct.yaml -) -set_tests_properties(${PREFIX}_direct PROPERTIES - FIXTURES_SETUP ${PREFIX}_direct -) + ecbuild_add_test( + TARGET ${PREFIX}_original + TEST_DEPENDS ${DATA_PREFIX}_get_data_interpolate ${DATA_PREFIX}_get_data_healpix_ring2nest + COMMAND multio-feed + ARGS ${CMAKE_CURRENT_BINARY_DIR}/MARS_reduced_gg.grib --decode --plans=${CMAKE_CURRENT_SOURCE_DIR}/reduced_gg_to_HEALPix_${_n}_nested_original.yaml + ) + set_tests_properties(${PREFIX}_original PROPERTIES + FIXTURES_SETUP ${PREFIX}_original + ) -ecbuild_add_test( - TARGET ${PREFIX}_compare - COMMAND grib_compare - ARGS MultIO_reduced_gg_to_HEALPix_32_nested_original.grib MultIO_reduced_gg_to_HEALPix_32_nested_direct.grib -) -set_tests_properties(${PREFIX}_compare PROPERTIES - FIXTURES_REQUIRED "${PREFIX}_original;${PREFIX}_direct" -) + ecbuild_add_test( + TARGET ${PREFIX}_direct + TEST_DEPENDS ${DATA_PREFIX}_get_data_interpolate ${DATA_PREFIX}_get_data_healpix_ring2nest + COMMAND multio-feed + ARGS ${CMAKE_CURRENT_BINARY_DIR}/MARS_reduced_gg.grib --decode --plans=${CMAKE_CURRENT_SOURCE_DIR}/reduced_gg_to_HEALPix_${_n}_nested_direct.yaml + ) + set_tests_properties(${PREFIX}_direct PROPERTIES + FIXTURES_SETUP ${PREFIX}_direct + ) + + ecbuild_add_test( + TARGET ${PREFIX}_compare + COMMAND grib_compare + ARGS MultIO_reduced_gg_to_HEALPix_${_n}_nested_original.grib MultIO_reduced_gg_to_HEALPix_${_n}_nested_direct.grib + ) + set_tests_properties(${PREFIX}_compare PROPERTIES + FIXTURES_REQUIRED "${PREFIX}_original;${PREFIX}_direct" + ) + +endforeach() \ No newline at end of file diff --git a/tests/multio/action/interpolate-healpix-nested/mapping_1024.yaml b/tests/multio/action/interpolate-healpix-nested/mapping_1024.yaml new file mode 120000 index 000000000..0981b04d7 --- /dev/null +++ b/tests/multio/action/interpolate-healpix-nested/mapping_1024.yaml @@ -0,0 +1 @@ +../renumber-healpix/mapping_1024.yaml \ No newline at end of file diff --git a/tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_direct.yaml b/tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_direct.yaml new file mode 100644 index 000000000..74bc162b6 --- /dev/null +++ b/tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_direct.yaml @@ -0,0 +1,20 @@ +plans: + - name: reduced_gg_to_HEALPix_1024_nested_direct + actions: + - type: select + match: + - paramId: 133 + - type: interpolate + input: O1280 + grid: H1024_nested + options: + caching: false + - type: encode + format: grib + template: Reference_HEALPix_1024_nested.grib + - type: sink + sinks: + - type: file + append: false + per-server: false + path: MultIO_reduced_gg_to_HEALPix_1024_nested_direct.grib diff --git a/tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_original.yaml b/tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_original.yaml new file mode 100644 index 000000000..0f9e07d8c --- /dev/null +++ b/tests/multio/action/interpolate-healpix-nested/reduced_gg_to_HEALPix_1024_nested_original.yaml @@ -0,0 +1,24 @@ +plans: + - name: reduced_gg_to_HEALPix_1024_nested_original + actions: + - type: select + match: + - paramId: 133 + - type: interpolate + input: O1280 + grid: H1024 + options: + caching: false + - type: metadata-mapping + mapping: '{~}/mapping_1024.yaml' + - type: renumber-healpix + cache-file-name: HEALPix_ring2nest.atlas + - type: encode + format: grib + template: Reference_HEALPix_1024_nested.grib + - type: sink + sinks: + - type: file + append: false + per-server: false + path: MultIO_reduced_gg_to_HEALPix_1024_nested_original.grib