Skip to content

Commit

Permalink
Merge pull request #85 from nasa/harmony-1746
Browse files Browse the repository at this point in the history
HARMONY-1746: As a Harmony developer I want a regression test for the Harmony OGC EDR API.
  • Loading branch information
ygliuvt committed Jun 3, 2024
2 parents f13f90e + e69de78 commit 1e06094
Showing 1 changed file with 72 additions and 18 deletions.
90 changes: 72 additions & 18 deletions test/harmony-regression/HarmonyRegression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"outputs": [],
"source": [
"coverages_root = '{root}/{collection}/ogc-api-coverages/1.0.0/collections/{variable}/coverage/rangeset'\n",
"edr_root = '{root}/ogc-api-edr/1.1.0/collections/{collection}/cube'\n",
"\n",
"if harmony_host_url == 'https://harmony.earthdata.nasa.gov':\n",
" is_not_prod = False\n",
Expand Down Expand Up @@ -119,7 +120,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Sample Sync Request - Bounding Box and Temporal Subsetting with Reformatting\n",
"### Sample OGC Coverages Sync Request - Bounding Box and Temporal Subsetting with Reformatting\n",
"\n",
"harmony/service-example only working in UAT due to Harmony-600."
]
Expand All @@ -136,8 +137,8 @@
" #By default, this reformats to tiff\n",
" params = {\n",
" 'subset': [\n",
" 'lon(-20:90)', \n",
" 'lat(0:60)', \n",
" 'lon(-20:90)',\n",
" 'lat(0:60)',\n",
" 'time(\"2020-01-15T00:00:00Z\":\"2020-01-15T01:00:00Z\")'\n",
" ]\n",
" }\n",
Expand All @@ -157,9 +158,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"if is_not_prod:\n",
Expand All @@ -175,6 +174,61 @@
" show(response, color_index=1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Sample OGC EDR Sync Request - Bounding Box and Temporal Subsetting with Reformatting\n",
"\n",
"harmony/service-example only working in UAT due to Harmony-600."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"if is_not_prod:\n",
" #By default, this reformats to tiff\n",
" response = get(\n",
" edr_root.format(\n",
" root=harmony_host_url,\n",
" collection=l3_collection\n",
" ),\n",
" params={\n",
" 'bbox': '-20,0,90,60',\n",
" 'datetime': '2020-01-15T00:00:00Z/2020-01-15T01:00:00Z'\n",
" }\n",
" )\n",
"\n",
" show(response, example_vars)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if is_not_prod:\n",
" response = get(\n",
" edr_root.format(\n",
" root=harmony_host_url,\n",
" collection=l3_collection\n",
" ),\n",
" params={\n",
" 'bbox': '-20,0,90,60',\n",
" 'datetime': '2020-01-15T00:00:00Z/2020-01-15T01:00:00Z',\n",
" 'parameter-name': 'green_var'\n",
" }\n",
" )\n",
"\n",
" show(response, color_index=1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -196,13 +250,13 @@
" response = get(\n",
" coverages_root.format(\n",
" root=harmony_host_url,\n",
" collection=l3_collection, \n",
" collection=l3_collection,\n",
" variable='all'\n",
" ), \n",
" ),\n",
" params={\n",
" 'subset': [\n",
" 'lon(-20:90)', \n",
" 'lat(0:60)', \n",
" 'lon(-20:90)',\n",
" 'lat(0:60)',\n",
" 'time(\"2020-01-01T00:00:00Z\":\"2020-01-05T01:00:00Z\")'\n",
" ]\n",
" }\n",
Expand Down Expand Up @@ -289,9 +343,9 @@
"zarr_response = get(\n",
" coverages_root.format(\n",
" root=harmony_host_url,\n",
" collection=l3_zarr_collection, \n",
" collection=l3_zarr_collection,\n",
" variable='all'\n",
" ), \n",
" ),\n",
" params={\n",
" 'subset': 'time(\"2020-01-15T00:00:00Z\":\"2020-01-16T01:00:00Z\")',\n",
" 'maxResults': '3'\n",
Expand Down Expand Up @@ -407,13 +461,13 @@
"response = get(\n",
" coverages_root.format(\n",
" root=harmony_host_url,\n",
" collection=l2ss_collection, \n",
" collection=l2ss_collection,\n",
" variable='all'\n",
" ), \n",
" ),\n",
" params={\n",
" 'maxResults': '1',\n",
" 'subset': [\n",
" 'lon(-160:160)', \n",
" 'lon(-160:160)',\n",
" 'lat(-80:80)',\n",
" 'time(\"2012-03-03T12:17:00\":\"2012-03-03T12:18:00\")'\n",
" ]\n",
Expand Down Expand Up @@ -444,14 +498,14 @@
"response = get(\n",
" coverages_root.format(\n",
" root=harmony_host_url,\n",
" collection=l2ss_collection, \n",
" collection=l2ss_collection,\n",
" variable='all'\n",
" ), \n",
" ),\n",
" params={\n",
" 'maxResults': '3',\n",
" 'format': 'application/x-netcdf4',\n",
" 'subset': [\n",
" 'lon(-160:160)', \n",
" 'lon(-160:160)',\n",
" 'lat(-80:80)',\n",
" 'time(\"2012-03-03T00:00:00Z\":\"2012-03-03T02:59:59Z\")'\n",
" ]\n",
Expand Down

0 comments on commit 1e06094

Please sign in to comment.