Skip to content

Commit

Permalink
DAS-1871 - Extend HyBIG regression tests with non-default message par…
Browse files Browse the repository at this point in the history
…ameters.
  • Loading branch information
owenlittlejohns committed Aug 31, 2023
1 parent 55b29b9 commit 12d2899
Show file tree
Hide file tree
Showing 20 changed files with 390 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ output/*
.deployenv
.identity
.netrc
.DS_Store

**/pulled-images.txt
366 changes: 328 additions & 38 deletions test/hybig/HyBIG_Regression.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.8000000000000000e+02, 2.0000000000000000e+00, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -1.0000000000000000e+00</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
2.0
0.0
0.0
-1.0
-179.0
89.5
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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> 2.2000000000000000e+01, 2.7464982147761604e-04, 0.0000000000000000e+00, 1.0000000000000000e+00, 0.0000000000000000e+00, -2.7464982147761604e-04</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.00027464982147761604
0.0
0.0
-0.00027464982147761604
22.00013732491074
0.9998626750892612
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tmp/tmp14xjf5f9/da1ac39a1ffd83f2d616c8e6d863e4ca4b567676b10e1ea565f8d2cb6f9ae10f.r00c00.png, /tmp/tmp14xjf5f9/da1ac39a1ffd83f2d616c8e6d863e4ca4b567676b10e1ea565f8d2cb6f9ae10f.r00c00.pgw, /tmp/tmp14xjf5f9/da1ac39a1ffd83f2d616c8e6d863e4ca4b567676b10e1ea565f8d2cb6f9ae10f.r00c00.png.aux.xml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.8000000000000000e+02, 1.0000000000000000e+00, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.0000000000000000e+00</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1.0
0.0
0.0
-2.0
-179.5
89.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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> -3.0000000000000000e+01, 1.0000000000000000e-02, 0.0000000000000000e+00, 7.0000000000000000e+01, 0.0000000000000000e+00, -1.0000000000000000e-02</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01
0.0
0.0
-0.01
-29.995
69.995
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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> -2.0000000000000000e+01, 1.0000000000000000e-02, 0.0000000000000000e+00, 7.0000000000000000e+01, 0.0000000000000000e+00, -1.0000000000000000e-02</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01
0.0
0.0
-0.01
-19.995
69.995
18 changes: 9 additions & 9 deletions test/hybig/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ def assert_dataset_produced_correct_results(
generated_file: Path, expected_metadata: dict, reference_file: Path, file_type: str
) -> None:
"""Check that the generated data matches the expected data."""
test_dataset = rasterio.open(generated_file)
assert (
test_dataset.meta == expected_metadata
), f'output {file_type} has incorrect metadata'
print_success('Generated image has correct metadata.')
with rasterio.open(generated_file) as test_dataset:
assert (
test_dataset.meta == expected_metadata
), f'output {file_type} has incorrect metadata'
print_success('Generated image has correct metadata.')

reference_dataset = rasterio.open(reference_file)
with rasterio.open(reference_file) as reference_dataset:
ref_image = reference_dataset.read()
test_image = test_dataset.read()
assert_array_almost_equal(ref_image, test_image)

ref_image = reference_dataset.read()
test_image = test_dataset.read()
assert_array_almost_equal(ref_image, test_image)
print_success('Generated image contains correct data.')

def build_file_list(basename: str, path: Path, file_type: str) -> list[Path]:
Expand Down
2 changes: 1 addition & 1 deletion test/hybig/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.2
0.0.3

0 comments on commit 12d2899

Please sign in to comment.