-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADS-342 - Add regression test for opera-rtc-s1-browse
* update gitattributes for opera-rtc-s1-browse regression test * add regression test for opera-rtc-s1-browse * upgrade opera-rtc-s1-browse test to harmony-py 0.5.0 * add opera-rtc-s1-browse to build-all-images.yml * add opera-rtc-s1-browse to notebook-test-suite.yml * remove unused import * apply black line length recommendations * [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
63bacda
commit 35a7b3e
Showing
14 changed files
with
136 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
test/nsidc-icesat2/reference_files/*.h5 filter=lfs diff=lfs merge=lfs -text | ||
test/subset-band-name/reference_data/*.hdf filter=lfs diff=lfs merge=lfs -text | ||
test/opera-rtc-s1-browse/reference_data/*.png filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: papermill-opera-rtc-s1-browse | ||
channels: | ||
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- python=3.12 | ||
- pip=24.3.1 | ||
- notebook=7.2.2 | ||
- papermill=2.6.0 | ||
- harmony-py==0.5.0 |
91 changes: 91 additions & 0 deletions
91
test/opera-rtc-s1-browse/opera-rtc-s1-browse_Regression.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "24ad02a3-f52b-4e10-8654-e28d3e998c59", | ||
"metadata": { | ||
"tags": [ | ||
"parameters" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"harmony_host_url = 'https://harmony.uat.earthdata.nasa.gov'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "9692ec8e-89e4-4742-9b11-57a8644cd770", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pathlib import Path\n", | ||
"from tempfile import TemporaryDirectory\n", | ||
"\n", | ||
"import harmony\n", | ||
"\n", | ||
"\n", | ||
"environments = {\n", | ||
" 'http://localhost:3000': harmony.Environment.LOCAL,\n", | ||
" 'https://harmony.sit.earthdata.nasa.gov': harmony.Environment.SIT,\n", | ||
" 'https://harmony.uat.earthdata.nasa.gov': harmony.Environment.UAT,\n", | ||
" 'https://harmony.earthdata.nasa.gov': harmony.Environment.PROD,\n", | ||
"}\n", | ||
"assert harmony_host_url in environments\n", | ||
"harmony_client = harmony.Client(env=environments[harmony_host_url])\n", | ||
"\n", | ||
"request = harmony.Request(\n", | ||
" collection=harmony.Collection(id='OPERA_L2_RTC-S1_V1'),\n", | ||
" granule_name=[\n", | ||
" 'OPERA_L2_RTC-S1_T035-073251-IW2_20240512T020817Z_20240512T122756Z_S1A_30_v1.0'\n", | ||
" ],\n", | ||
" format='image/png',\n", | ||
")\n", | ||
"job_id = harmony_client.submit(request)\n", | ||
"harmony_client.wait_for_processing(job_id)\n", | ||
"\n", | ||
"with TemporaryDirectory() as temp_dir:\n", | ||
" output_files = [\n", | ||
" Path(future.result())\n", | ||
" for future in harmony_client.download_all(job_id, directory=temp_dir)\n", | ||
" ]\n", | ||
"\n", | ||
" assert len(output_files) == 3\n", | ||
" assert output_files[0].suffixes == ['.png']\n", | ||
" assert output_files[1].suffixes == ['.pgw']\n", | ||
" assert output_files[2].suffixes == ['.png', '.aux', '.xml']\n", | ||
"\n", | ||
" reference_data = Path('reference_data')\n", | ||
" assert output_files[0].read_bytes() == (reference_data / 'rgb.png').read_bytes()\n", | ||
" assert output_files[1].read_bytes() == (reference_data / 'rgb.pgw').read_bytes()\n", | ||
" assert (\n", | ||
" output_files[2].read_bytes()\n", | ||
" == (reference_data / 'rgb.png.aux.xml').read_bytes()\n", | ||
" )" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
0.0002746658541715035 | ||
0.0 | ||
0.0 | ||
-0.00027463466178079705 | ||
-122.96676772672274 | ||
38.05992846197979 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<PAMDataset> | ||
<SRS dataAxisToSRSAxisMapping="2,1">GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]</SRS> | ||
<GeoTransform> -1.2296690505964982e+02, 2.7466585417150349e-04, 0.0000000000000000e+00, 3.8060065779310676e+01, 0.0000000000000000e+00, -2.7463466178079705e-04</GeoTransform> | ||
</PAMDataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters