Skip to content

Commit

Permalink
TRT-588 - Add HyBIG regression test for custom colour map.
Browse files Browse the repository at this point in the history
  • Loading branch information
owenlittlejohns authored Oct 17, 2024
1 parent e23ee4b commit 447f9a5
Show file tree
Hide file tree
Showing 53 changed files with 400 additions and 134 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ versioning. Rather than a static releases, this repository contains of a number
of regression tests that are each semi-independent. This CHANGELOG file should be used
to document pull requests to this repository.

## 2024-10-16 ([#105](https://github.com/nasa/harmony-regression-tests/pull/105))

- Updates the HyBIG regression test suite to include a test specifying a variable
in the request. This will ensure Harmony passes UMM-Var metadata to HyBIG and
therefore allow HyBIG to use a custom colour map for the generated browse
imagery.
- The comparisons within the HyBIG regression test suite also now derive their
CRS and geotransform metadata from the `.aux.xml` file for each browse image.

## 2024-10-11 ([#104](https://github.com/nasa/harmony-regression-tests/pull/104))

- Migrates trajectory-subsetter to use `shared_utils`.
Expand Down
250 changes: 135 additions & 115 deletions test/hybig/HyBIG_Regression.ipynb

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions test/hybig/reference_data/ASTGTMV003_N00E022_dem.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-179.9902157710348
89.99021631535295
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,14 @@
<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.7999999997497974e+02, 1.9568407889871148e-02, 0.0000000000000000e+00, 8.9999999987489872e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">254</MDI>
<MDI key="STATISTICS_MINIMUM">254</MDI>
<MDI key="STATISTICS_STDDEV">0</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-99.83801705412259
89.99021631535295
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,14 @@
<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> -9.9847801258067520e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, 8.9999999987489872e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">249.89323425293</MDI>
<MDI key="STATISTICS_MINIMUM">9</MDI>
<MDI key="STATISTICS_STDDEV">27.489592912717</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-19.68581833721036
89.99021631535295
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,14 @@
<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.9695602541155296e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, 8.9999999987489872e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">251.89521026611</MDI>
<MDI key="STATISTICS_MINIMUM">66</MDI>
<MDI key="STATISTICS_STDDEV">19.013916282497</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
60.46638037970188
89.99021631535295
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,14 @@
<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> 6.0456596175756943e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, 8.9999999987489872e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">250.98323440552</MDI>
<MDI key="STATISTICS_MINIMUM">2</MDI>
<MDI key="STATISTICS_STDDEV">24.256568673074</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
140.6185790966141
89.99021631535295
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,14 @@
<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.4060879489266915e+02, 1.9568407889871148e-02, 0.0000000000000000e+00, 8.9999999987489872e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">254</MDI>
<MDI key="STATISTICS_MINIMUM">254</MDI>
<MDI key="STATISTICS_STDDEV">0</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-179.9902157710348
9.842374169737457
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,14 @@
<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.7999999997497974e+02, 1.9568407889871148e-02, 0.0000000000000000e+00, 9.8521578418743729e+00, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">252.31397247314</MDI>
<MDI key="STATISTICS_MINIMUM">24</MDI>
<MDI key="STATISTICS_STDDEV">16.958411809499</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-99.83801705412259
9.842374169737457
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> -9.9847801258067520e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, 9.8521578418743729e+00, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-19.68581833721036
9.842374169737457
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.9695602541155296e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, 9.8521578418743729e+00, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
60.46638037970188
9.842374169737457
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> 6.0456596175756943e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, 9.8521578418743729e+00, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
140.6185790966141
9.842374169737457
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,14 @@
<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.4060879489266915e+02, 1.9568407889871148e-02, 0.0000000000000000e+00, 9.8521578418743729e+00, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">254</MDI>
<MDI key="STATISTICS_MINIMUM">254</MDI>
<MDI key="STATISTICS_STDDEV">0</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-179.9902157710348
-70.30546797587805
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,14 @@
<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.7999999997497974e+02, 1.9568407889871148e-02, 0.0000000000000000e+00, -7.0295684303741126e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">247.69058504972</MDI>
<MDI key="STATISTICS_MINIMUM">117</MDI>
<MDI key="STATISTICS_STDDEV">27.832085579563</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-99.83801705412259
-70.30546797587805
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> -9.9847801258067520e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, -7.0295684303741126e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
-19.68581833721036
-70.30546797587805
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.9695602541155296e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, -7.0295684303741126e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
60.46638037970188
-70.30546797587805
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,14 @@
<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> 6.0456596175756943e+01, 1.9568407889871148e-02, 0.0000000000000000e+00, -7.0295684303741126e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">254</MDI>
<MDI key="STATISTICS_MEAN">249.21002752131</MDI>
<MDI key="STATISTICS_MINIMUM">125</MDI>
<MDI key="STATISTICS_STDDEV">24.391855472776</MDI>
<MDI key="STATISTICS_VALID_PERCENT">100</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0.01956840788987115
0.0
0.0
-0.01956734427383191
140.6185790966141
-70.30546797587805
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.4060879489266915e+02, 1.9568407889871148e-02, 0.0000000000000000e+00, -7.0295684303741126e+01, 0.0000000000000000e+00, -1.9567344273831909e-02</GeoTransform>
</PAMDataset>

This file was deleted.

22 changes: 15 additions & 7 deletions test/hybig/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,24 @@ def print_success(success_string: str) -> str:


def assert_dataset_produced_correct_results(
generated_file: Path, expected_metadata: dict, reference_file: Path, file_type: str
generated_file: Path, reference_file: Path, file_type: str
) -> None:
"""Check that the generated data matches the expected data."""
"""Check that the generated data matches the expected data.
This function compares the metadata and the array values of
the generated test output against a reference file. Some
metadata read by `rasterio`, such as the CRS and geotransform,
are retrieved from a sibling `.aux.xml` file, meaning the
content of the test output and reference files for these
siblings is also being tested.
"""
with rasterio.open(generated_file) as test_dataset:
assert (
test_dataset.meta == expected_metadata
), f'output {file_type} has incorrect metadata: {test_dataset.meta}'
print_success('Generated image has correct metadata.')

with rasterio.open(reference_file) as reference_dataset:
assert (
test_dataset.meta == reference_dataset.meta
), f'output {file_type} has incorrect metadata: {test_dataset.meta}'
print_success('Generated image has correct metadata.')

ref_image = reference_dataset.read()
test_image = test_dataset.read()
assert_array_almost_equal(ref_image, test_image)
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.8
0.0.9

0 comments on commit 447f9a5

Please sign in to comment.