Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAS-2276: Update HyBIG reference images. #122

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

flamingbear
Copy link
Member

@flamingbear flamingbear commented Dec 16, 2024

Description

Update the regression tests affected by the HyBIG changes in DAS-2276.

Jira Issue ID

DAS-2276

Local Test Steps

  • Check out the main branch, copy the regression test directory from hybig into a new location.
    (This is if you want to open up the images and compare the changes in QGIS or similar)

  • Set up Harmony-In-A-Box with the latest HyBIG image.

  • Check out this DAS-2276 PR

  • Build and activate the conda environments for HyBIG and opera-rtc-s1-browse in their respective directories.

  • Update your host location in both notebooks harmony_host_url = 'http://localhost:3000'.

  • Run both notebooks locally and ensure no errors are generated.

Verify works against SIT

  • build both images
❯ make opera-rtc-s1-browse-image
❯ make hybig-image

set your environment:

export HARMONY_HOST_URL=https://harmony.sit.earthdata.nasa.gov
export AWS_ACCESS_KEY_ID=[redacted]
export AWS_SECRET_ACCESS_KEY=[redacted]
export EDL_USER=[redacted]
export EDL_PASSWORD=[redacted]

Run the tests

❯ ./run_notebooks.sh hybig opera-rtc-s1-browse

Wait 6ish minutes and verify all pass.

Running regression tests
Test suite hybig starting
running test with ghcr.io/nasa/regression-tests-hybig:latest
Test suite opera-rtc-s1-browse starting
running test with ghcr.io/nasa/regression-tests-opera-rtc-s1-browse:latest
Waiting for hybig.
Input Notebook:  hybig/HyBIG_Regression.ipynb
Output Notebook: /workdir/output/hybig/Results.ipynb
Working directory: hybig
Executing:   0%|          | 0/33 [00:00<?, ?cell/s]Executing notebook with kernel: python3
Executing: 100%|██████████| 33/33 [06:19<00:00, 11.50s/cell]
Test suite hybig succeeded
Waiting for opera-rtc-s1-browse.
Input Notebook:  opera-rtc-s1-browse/opera-rtc-s1-browse_Regression.ipynb
Output Notebook: /workdir/output/opera-rtc-s1-browse/Results.ipynb
Working directory: opera-rtc-s1-browse
Executing:   0%|          | 0/3 [00:00<?, ?cell/s]Executing notebook with kernel: python3
Executing: 100%|██████████| 3/3 [00:36<00:00, 12.09s/cell]
Test suite opera-rtc-s1-browse succeeded
Tests completed (passed)

Changes to the images?

HyBIG has been modified to treat input 3 and 4 band images as RGB[A] values "unchanged" (for most important cases). This means the refernce output pngs are dimmer for VCF5KYR because their valid range is 0 to 100 and are no longer scaled to 0 to 255. You can see the new images with the old ones in the 06230bb832f405f6b040e7fb66a4410c306de0ef commit.

The change to the opera-rtc-s1-browse image is not as visible because the input GeoTIFF used all of the available dynamic range of the 24-bit image.

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • CHANGELOG updated with the changes for this PR

@asjohnston-asf
Copy link
Contributor

I confirmed the new opera-rtc-s1-browse reference data matches the requirements we've discussed. No concerns from ASF (assuming the test passes, of course).

@flamingbear
Copy link
Member Author

When nasa/harmony-browse-image-generator#39 gets merged this can follow

@vutrannasa
Copy link

Following the test instructions was able to pass using VSCode using SIT.

HyBIG_Regression.ipynb

  1. Test that specifies spatial extents overrides GIBS-compatible defaults:
    Success: all test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of ASTER Geotiff to PNG Success

  2. Repeat previous test but request JPG output.
    Success: all test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of ASTER Geotiff to JPEG Success

  3. Test: Scale Extent has parameters in wrong order.
    Success: Exception Raised Correctly for Scale Extents

  4. Test: Scale Sizes are Positive
    Success: Exception raised correctly for negative Scale Size.

  5. Test a request for PNG output from 3-Band RGB input data
    Success: all test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of MEaSUREs GeoTIFF to PNG Success

  6. Test a request for JPEG output from 3-Band RGB input data
    Success: all test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of MEaSUREs Geotiff to JPEG Success

  7. Test that specifies spatial sizes (resolutions) overrides GIBS-compatible defaults:
    Success: all test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of MEaSUREs GeoTIFF to PNG specifying scaleSize. Success

  8. Test that specifies dimensions overrides GIBS-compatible defaults:
    Success: all test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of MEaSUREs GeoTIFF to PNG specifying dimensions. Success

  9. Test of tiled outputs:
    Success: All VCF5KYR_1991001_001_2018224205008.r00c00 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All VCF5KYR_1991001_001_2018224205008.r00c01 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All VCF5KYR_1991001_001_2018224205008.r00c02 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All VCF5KYR_1991001_001_2018224205008.r00c03 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All VCF5KYR_1991001_001_2018224205008.r00c04 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of MEaSUREs GeoTIFF to tiled PNGs. Success

  10. Test that demonstrates variable selection for custom colour maps:
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r00c00 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r00c01 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r00c02 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r00c03 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r00c04 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r01c00 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r01c01 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r01c02 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r01c03 test files generated
    ...
    Success: All PREFIRE_SAT2_2B-FLX_S07_R00_20210721013413_03040.nc.G00.r02c04 test files generated
    Success: Generated image has correct metadata.
    Success: Generated image contains correct data.
    Success: Conversion of PREFIRE GeoTIFF to PNG using custom colour map. Success

opera-rtc-s1-browse_Regression.ipynb
Verify the below files are downloaded
/var/folders/sx/4dq8dzl54g3gd58k8k9thd6r0000gp/T/tmprs026k2s/2222483_628d369379d75e94687e73b48608d1a1efd569a911f4a1498490e42222525_rgb.png
/var/folders/sx/4dq8dzl54g3gd58k8k9thd6r0000gp/T/tmprs026k2s/2222483_628d369379d75e94687e73b48608d1a1efd569a911f4a1498490e42222525_rgb.pgw
/var/folders/sx/4dq8dzl54g3gd58k8k9thd6r0000gp/T/tmprs026k2s/2222483_628d369379d75e94687e73b48608d1a1efd569a911f4a1498490e42222525_rgb.png.aux.xml

@vutrannasa vutrannasa self-requested a review December 20, 2024 14:34
Copy link

@vutrannasa vutrannasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify tests pass

@flamingbear flamingbear merged commit 56c570d into main Dec 20, 2024
1 check passed
@flamingbear flamingbear deleted the mhs/DAS-2276/hybig-4band-regression-update branch December 20, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants