From cc26611d1e605e31fed9829c79d0bdb35f9ea266 Mon Sep 17 00:00:00 2001 From: owenlittlejohns Date: Sat, 28 Sep 2024 15:33:26 -0400 Subject: [PATCH] DAS-1601 - Remove PNG and GIF tests from HGA suite. --- test/hga/HGA_Regression.ipynb | 440 +--------------------------------- test/hga/version.txt | 2 +- 2 files changed, 3 insertions(+), 439 deletions(-) diff --git a/test/hga/HGA_Regression.ipynb b/test/hga/HGA_Regression.ipynb index 9f6ded6..fdae3cd 100644 --- a/test/hga/HGA_Regression.ipynb +++ b/test/hga/HGA_Regression.ipynb @@ -12,7 +12,6 @@ "* [ALOS AVNIR OBS ORI](https://cmr.earthdata.nasa.gov/search/concepts/C1808440897-ASF.html)\n", "* [Sentinel 1 Interferograms](https://cmr.earthdata.nasa.gov/search/concepts/C1595422627-ASF.html)\n", "* [UAVSAR POLSAR Pauli](https://cmr.uat.earthdata.nasa.gov/search/concepts/C1244141264-EEDTEST.html)\n", - "* [GHRSST Level 4 MUR Global Foundation Sea Surface Temperature Analysis (v4.1)](https://podaac.jpl.nasa.gov/dataset/MUR-JPL-L4-GLOB-v4.1)\n", "\n", "## Set the Harmony environment:\n", "\n", @@ -720,129 +719,6 @@ " print('Skipping test: HGA regression tests not configured for this environment.')" ] }, - { - "cell_type": "markdown", - "id": "8167880c", - "metadata": {}, - "source": [ - "### AVNIR test case 10:\n", - "\n", - "This test combines a bounding box spatial subset, across the Equator, with a variable subset for a single variable. The output should be in a `.png` format.\n", - "\n", - "The input `.zip` file contains 4 Image GeoTIFFs, one per band each representing a spectrum range. \n", - "\n", - "For a `.png` output, the authority and projection can't be derived from the output file, so several of the tested properties are `None` for this test case.\n", - "\n", - "## Test Disabled\n", - "\n", - "TODO [06/21/2022]: We noticed some strange behavior with creating png output\n", - "when the input has multiple bands. Any of these requests will return same\n", - "output: ` ['Band3', 'Band2', 'Band1'], ['Band2', 'Band1'], ['Band1']` and we\n", - "think that the code is only writing the last band in the request to the png.\n", - "We will follow up and see if this is functionality that people need or not and\n", - "either prevent these types of requests or fix the output in the future. The\n", - "new test should also verify against a reference image. (same note as for UAVSAR test case 10.)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c70a42c2", - "metadata": {}, - "outputs": [], - "source": [ - "# if environment_information is not None:\n", - "# granule_id = get_test_granule_id(environment_information['env'], 'G1813212660-ASF',\n", - "# 'G1244144597-EEDTEST')\n", - "#\n", - "# avnir_directory_ten = 'avnir_test_ten'\n", - "#\n", - "# avnir_request_ten = Request(collection=environment_information['avnir_collection'],\n", - "# spatial=BBox(-51.0, -0.05, -50.75, 0.25), variables=['Band2'],\n", - "# granule_id=granule_id, format='image/png')\n", - "#\n", - "# avnir_output_ten = make_request_and_download_result(harmony_client, avnir_request_ten,\n", - "# avnir_directory_ten)\n", - "#\n", - "# avnir_variables_ten = {'Band1', 'Band2', 'Band3', 'Band4'}\n", - "#\n", - "# expected_avnir_results_ten = {'authority': None,\n", - "# 'cs': None,\n", - "# 'file_type': 'png',\n", - "# 'gcs': None,\n", - "# 'gcs_epsg': None,\n", - "# 'n_bands': 4,\n", - "# 'proj_cs': None,\n", - "# 'proj_epsg': None,\n", - "# 'spatial_extent': None,\n", - "# 'variables': avnir_variables_ten,\n", - "# 'width': 3410,\n", - "# 'height': 3238}\n", - "#\n", - "# check_request_output(avnir_output_ten[0], expected_avnir_results_ten)\n", - "# clean_test_artefacts(avnir_directory_ten)\n", - "# else:\n", - "# print('Skipping test: HGA regression tests not configured for this environment.')" - ] - }, - { - "cell_type": "markdown", - "id": "673869c4", - "metadata": {}, - "source": [ - "### AVNIR test case 11:\n", - "This test combines a bounding box spatial subset, across the Equator, with a variable subset for a single variable. The output should be in a `.gif` format.\n", - "\n", - "The input `.zip` file contains 4 Image GeoTIFFs, one per band each representing a spectrum range. \n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "70a006e6", - "metadata": {}, - "outputs": [], - "source": [ - "if environment_information is not None:\n", - " granule_id = get_test_granule_id(\n", - " environment_information['env'], 'G1813212660-ASF', 'G1244144597-EEDTEST'\n", - " )\n", - "\n", - " avnir_directory_eleven = 'avnir_test_eleven'\n", - "\n", - " avnir_request_eleven = Request(\n", - " collection=environment_information['avnir_collection'],\n", - " spatial=BBox(-51.0, -0.05, -50.75, 0.25),\n", - " variables=['Band2'],\n", - " granule_id=granule_id,\n", - " format='image/gif',\n", - " )\n", - "\n", - " avnir_output_eleven = make_request_and_download_result(\n", - " harmony_client, avnir_request_eleven, avnir_directory_eleven\n", - " )\n", - " expected_avnir_results_eleven = {\n", - " 'authority': None,\n", - " 'cs': None,\n", - " 'file_type': 'gif',\n", - " 'gcs': None,\n", - " 'gcs_epsg': None,\n", - " 'n_bands': 1,\n", - " 'proj_cs': None,\n", - " 'proj_epsg': None,\n", - " 'spatial_extent': None,\n", - " 'variables': {},\n", - " 'reference_image': 'reference_images/avnir_reference_eleven.gif',\n", - " 'width': 3410,\n", - " 'height': 3238,\n", - " }\n", - "\n", - " check_request_output(avnir_output_eleven[0], expected_avnir_results_eleven)\n", - " clean_test_artefacts(avnir_directory_eleven)\n", - "else:\n", - " print('Skipping test: HGA regression tests not configured for this environment.')" - ] - }, { "cell_type": "markdown", "id": "d6dde860", @@ -1506,133 +1382,12 @@ " print('Skipping test: HGA regression tests not configured for this environment.')" ] }, - { - "cell_type": "markdown", - "id": "46de0d76", - "metadata": {}, - "source": [ - "### Sentinel test case 11:\n", - "\n", - "This test combines a bounding box spatial subset with a variable subset (`/science/grids/data/amplitude`). The output file format will be a `.png`.\n", - "\n", - "The input NetCDF-4 file contains many variables (in a hierarchical structure).\n", - "\n", - "## Test Disabled\n", - "\n", - "TODO [06/22/2022]: We noticed some strange behavior with creating png output\n", - "when the input has multiple bands. It seems this test passes the same as UAVSAR and AVNIR png tests." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4d9cb725", - "metadata": {}, - "outputs": [], - "source": [ - "# if environment_information is not None:\n", - "# granule_id = get_test_granule_id(environment_information['env'], 'G1715962900-ASF',\n", - "# 'G1244144618-EEDTEST')\n", - "#\n", - "# sentinel_directory_eleven = 'sentinel_test_eleven'\n", - "#\n", - "# sentinel_request_eleven = Request(collection=environment_information['sentinel_collection'],\n", - "# spatial=BBox(-115.5, 33, -115.45, 33.05),\n", - "# variables=[ 'science/grids/data/amplitude'],\n", - "# granule_id=granule_id, format='image/png')\n", - "#\n", - "# sentinel_output_eleven = make_request_and_download_result(harmony_client, sentinel_request_eleven,\n", - "# sentinel_directory_eleven)\n", - "#\n", - "# sentinel_variables_eleven = {'Band1', 'Band2', 'Band3', 'Band4'}\n", - "#\n", - "# expected_sentinel_results_eleven = {'authority': None,\n", - "# 'cs': None,\n", - "# 'file_type': 'png',\n", - "# 'gcs': None,\n", - "# 'gcs_epsg': None,\n", - "# 'n_bands': 4,\n", - "# 'proj_cs': None,\n", - "# 'proj_epsg': None,\n", - "# 'reference_image': 'reference_images/sentinel_reference_eleven.png',\n", - "# 'spatial_extent': None,\n", - "# 'variables': sentinel_variables_eleven,\n", - "# 'width': 60,\n", - "# 'height': 60}\n", - "#\n", - "# check_request_output(sentinel_output_eleven[0], expected_sentinel_results_eleven)\n", - "# clean_test_artefacts(sentinel_directory_eleven)\n", - "# else:\n", - "# print('Skipping test: HGA regression tests not configured for this environment.')" - ] - }, - { - "cell_type": "markdown", - "id": "c81e4d49", - "metadata": {}, - "source": [ - "## Sentinel test case 12:\n", - "\n", - "This test combines a bounding box spatial subset with a variable subset (`/science/grids/data/amplitude`). The requested output is a `.gif`.\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5904320c", - "metadata": {}, - "outputs": [], - "source": [ - "if environment_information is not None:\n", - " granule_id = get_test_granule_id(\n", - " environment_information['env'], 'G1715962900-ASF', 'G1244144618-EEDTEST'\n", - " )\n", - "\n", - " sentinel_directory_twelve = 'sentinel_test_twelve'\n", - "\n", - " sentinel_request_twelve = Request(\n", - " collection=environment_information['sentinel_collection'],\n", - " spatial=BBox(-115.5, 33, -115.45, 33.05),\n", - " variables=['science/grids/data/amplitude'],\n", - " granule_id=granule_id,\n", - " format='image/gif',\n", - " )\n", - "\n", - " sentinel_output_twelve = make_request_and_download_result(\n", - " harmony_client, sentinel_request_twelve, sentinel_directory_twelve\n", - " )\n", - "\n", - " sentinel_variables_twelve = {}\n", - "\n", - " expected_sentinel_results_twelve = {\n", - " 'authority': None,\n", - " 'cs': None,\n", - " 'file_type': 'gif',\n", - " 'gcs': None,\n", - " 'gcs_epsg': None,\n", - " 'n_bands': 1,\n", - " 'proj_cs': None,\n", - " 'proj_epsg': None,\n", - " 'reference_image': 'reference_images/sentinel_reference_twelve.gif',\n", - " 'spatial_extent': None,\n", - " 'variables': sentinel_variables_twelve,\n", - " 'width': 60,\n", - " 'height': 60,\n", - " }\n", - "\n", - " check_request_output(sentinel_output_twelve[0], expected_sentinel_results_twelve)\n", - " clean_test_artefacts(sentinel_directory_twelve)\n", - "else:\n", - " print('Skipping test: HGA regression tests not configured for this environment.')" - ] - }, { "cell_type": "markdown", "id": "788f22ac", "metadata": {}, "source": [ - "### Sentinel test case 13:\n", + "### Sentinel test case 11:\n", "\n", "The Sentinel data has 7 variables with two different sets of grid sizes. This test requests a bounding box spatial subset while specifying two variables with different grids. This leads to a request that cannot be fulfilled by HGA and an exception should be raised. The internal exception type is an `IncompatibleVariableError`, which can be identified via the string reported to the end-user." ] @@ -2246,197 +2001,6 @@ "else:\n", " print('Skipping test: HGA regression tests not configured for this environment.')" ] - }, - { - "cell_type": "markdown", - "id": "ab81272e", - "metadata": {}, - "source": [ - "### UAVSAR test case 10:\n", - "\n", - "This test combines a bounding box spatial subset with a variable subset (`Band1`). The requested output will be a `.png` format file.\n", - "\n", - "Each input variable for the UAVSAR POLSAR Pauli collection is a science variable (e.g., \"HH - VV\") and has four colour bands, so the output is expected to have a total of 4 bands.\n", - "\n", - "## Test Disabled\n", - "\n", - "TODO [06/21/2022]: We noticed some strange behavior with creating png output\n", - "when the input has multiple bands. Any of these requests will return same\n", - "output: ` ['Band3', 'Band2', 'Band1'], ['Band2', 'Band1'], ['Band1']` and we\n", - "think that the code is only writing the last band in the request to the png.\n", - "We will follow up and see if this is functionality that people need or not and\n", - "either prevent these types of requests or fix the output in the future. The\n", - "new test should also verify against a reference image. (same note as for AVNIR test case 10.)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bcaf964e", - "metadata": {}, - "outputs": [], - "source": [ - "# if environment_information is not None:\n", - "# granule_id = get_test_granule_id(environment_information['env'], 'G1422449017-ASF',\n", - "# 'G1244144733-EEDTEST')\n", - "#\n", - "# uavsar_directory_ten = 'uavsar_test_ten'\n", - "#\n", - "# uavsar_request_ten = Request(collection=environment_information['uavsar_collection'],\n", - "# variables=['Band1'], spatial=BBox(-145.75, 64.0, -145.70, 64.1),\n", - "# granule_id=granule_id, format='image/png')\n", - "#\n", - "# uavsar_output_ten = make_request_and_download_result(harmony_client, uavsar_request_ten,\n", - "# uavsar_directory_ten)\n", - "#\n", - "# uavsar_variables_ten = {'Band1', 'Band2', 'Band3', 'Band4'}\n", - "#\n", - "# expected_uavsar_results_ten = {'authority': None,\n", - "# 'cs': None,\n", - "# 'file_type': 'png',\n", - "# 'gcs': None,\n", - "# 'gcs_epsg': None,\n", - "# 'n_bands': 4,\n", - "# 'proj_cs': None,\n", - "# 'proj_epsg': None,\n", - "# 'reference_image': 'reference_images/uavsar_reference_ten.png',\n", - "# 'spatial_extent': [64.0, 64.1, -145.75, -145.70],\n", - "# 'variables': uavsar_variables_ten,\n", - "# 'width': 450,\n", - "# 'height': 1800}\n", - "#\n", - "# check_request_output(uavsar_output_ten[0], expected_uavsar_results_ten)\n", - "# clean_test_artefacts(uavsar_directory_ten)\n", - "# else:\n", - "# print('Skipping test: HGA regression tests not configured for this environment.')" - ] - }, - { - "cell_type": "markdown", - "id": "c781a7ee", - "metadata": {}, - "source": [ - "### UAVSAR test case 11:\n", - "\n", - "This test combines a bounding box spatial subset with a variable subset (`Band1`). The requested output will be a `.gif` format file.\n", - "\n", - "Each input variable for the UAVSAR POLSAR Pauli collection is a science variable (e.g., \"HH - VV\")." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7e7e277c", - "metadata": {}, - "outputs": [], - "source": [ - "if environment_information is not None:\n", - " granule_id = get_test_granule_id(\n", - " environment_information['env'], 'G1422449017-ASF', 'G1244144733-EEDTEST'\n", - " )\n", - "\n", - " uavsar_directory_eleven = 'uavsar_test_eleven'\n", - "\n", - " uavsar_request_eleven = Request(\n", - " collection=environment_information['uavsar_collection'],\n", - " variables=['Band1'],\n", - " spatial=BBox(-145.75, 64.0, -145.70, 64.1),\n", - " granule_id=granule_id,\n", - " format='image/gif',\n", - " )\n", - "\n", - " uavsar_output_eleven = make_request_and_download_result(\n", - " harmony_client, uavsar_request_eleven, uavsar_directory_eleven\n", - " )\n", - "\n", - " expected_uavsar_results_eleven = {\n", - " 'authority': None,\n", - " 'cs': None,\n", - " 'file_type': 'gif',\n", - " 'gcs': None,\n", - " 'gcs_epsg': None,\n", - " 'n_bands': 1,\n", - " 'proj_cs': None,\n", - " 'proj_epsg': None,\n", - " 'reference_image': 'reference_images/uavsar_reference_eleven.tiff',\n", - " 'spatial_extent': [64.0, 64.1, -145.75, -145.70],\n", - " 'variables': {},\n", - " 'width': 450,\n", - " 'height': 1800,\n", - " }\n", - "\n", - " check_request_output(uavsar_output_eleven[0], expected_uavsar_results_eleven)\n", - " clean_test_artefacts(uavsar_directory_eleven)\n", - "else:\n", - " print('Skipping test: HGA regression tests not configured for this environment.')" - ] - }, - { - "cell_type": "markdown", - "id": "cbef55ec", - "metadata": {}, - "source": [ - "## GHRSST Level 4 MUR Global Foundation Sea Surface Temperature Analysis\n", - "\n", - "The tests below will use the GHRSST Level 4 MUR Global Foundation Sea Surface Temperature Analysis from PO.DAAC.\n", - "\n", - "### MUR Test Case 1:\n", - "\n", - "This test combines a resampled output with a variable subset (`analysed_sst`) format will be a `.png`.\n", - "\n", - "**TODO:** When regression tests are enabled for production, the MUR collection concept ID and the granule concept ID will need to be added to this notebook." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1d3f90e2", - "metadata": {}, - "outputs": [], - "source": [ - "if environment_information is not None:\n", - " granule_id = get_test_granule_id(\n", - " environment_information['env'], None, 'G1240564919-POCLOUD'\n", - " )\n", - "\n", - " mur_directory_one = 'mur_test_one'\n", - "\n", - " mur_request_one = Request(\n", - " collection=environment_information['mur_collection'],\n", - " variables=['analysed_sst'],\n", - " granule_id=granule_id,\n", - " format='image/png',\n", - " width=900,\n", - " height=450,\n", - " )\n", - "\n", - " mur_output_one = make_request_and_download_result(\n", - " harmony_client, mur_request_one, mur_directory_one\n", - " )\n", - "\n", - " mur_variables_one = {'Band1', 'Band2', 'Band3', 'Band4'}\n", - "\n", - " expected_mur_results_one = {\n", - " 'authority': None,\n", - " 'cs': None,\n", - " 'file_type': 'png',\n", - " 'gcs': None,\n", - " 'gcs_epsg': None,\n", - " 'n_bands': 4,\n", - " 'proj_cs': None,\n", - " 'proj_epsg': None,\n", - " 'reference_image': 'reference_images/mur_reference_one.png',\n", - " 'spatial_extent': None,\n", - " 'variables': mur_variables_one,\n", - " 'width': 900,\n", - " 'height': 450,\n", - " }\n", - "\n", - " check_request_output(mur_output_one[0], expected_mur_results_one)\n", - " clean_test_artefacts(mur_directory_one)\n", - "else:\n", - " print('Skipping test: HGA regression tests not configured for this environment.')" - ] } ], "metadata": { @@ -2456,7 +2020,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.9.20" }, "name": "HGA_Regression.ipynb" }, diff --git a/test/hga/version.txt b/test/hga/version.txt index c946ee6..1180819 100644 --- a/test/hga/version.txt +++ b/test/hga/version.txt @@ -1 +1 @@ -0.1.6 +0.1.7