Skip to content

i.aster.toar: add test file #5483

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

Merged
merged 3 commits into from
Apr 15, 2025
Merged

Conversation

jayneel-shah18
Copy link
Contributor

This PR adds a comprehensive test suite for the i.aster.toar module.

The test suite focuses on regression sensitivity and minimal test execution, ensuring that any change in computation results is detected with high precision while keeping the number of i.aster.toar executions as low as possible. It also includes a theoretical validation based on the reflectance correction with respect to solar zenith angle.

Tests added

  • Radiance mode (-r) for thermal bands (bands 10–14)
    • Validates against strict univariate statistics.
    • Checks that output is floating-point and within a reasonable radiance range.
  • High gain mode (-a -b) for bands 1–9
    • Regression check with precomputed min, max, sum statistics.
  • Low gain mode (-c -d -e) for bands 1–9
    • Regression check with precomputed statistics.
  • Theoretical test: reflectance vs. sun elevation
    • Verifies that reflectance scales according to:
      reflectance ∝ 1 / cos(90° - sun_elevation)
      
    • Compares outputs from runs with sun_elevation = 45° and 60°.
    • Expected ratio: cos(45°)/cos(30°) ≈ 0.8165.

Performance

  • macOs: 2.919s
  • Windows: 5.005s
  • Ubuntu: 3.966s

Looking forward to feedback and potential refinements!

@github-actions github-actions bot added Python Related code is in Python module imagery tests Related to Test Suite labels Apr 1, 2025
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

The code itself looks fine, nothing wrong stood out. I find it interesting to validate the ratio of two runs to check the proportion.

@echoix
Copy link
Member

echoix commented Apr 5, 2025

It will probably show a failure for macOS, which all PRs have since yesterday, blocking all merges.

I'd also like someone like Anna or other to look at more the GIS side of the tests, if they want. Otherwise, after a few business days, I'll merge it anyways

@echoix echoix assigned petrasovaa and unassigned petrasovaa Apr 14, 2025
@echoix
Copy link
Member

echoix commented Apr 15, 2025

Since there wasn't any other objections on the GIS side of the tests in a week and a half, I don't see any problem with this. We are better with a test than without.

@echoix echoix merged commit 2e4d7cd into OSGeo:main Apr 15, 2025
28 checks passed
@github-actions github-actions bot added this to the 8.5.0 milestone Apr 15, 2025
@jayneel-shah18 jayneel-shah18 deleted the i_aster_toar_tests branch April 15, 2025 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imagery module Python Related code is in Python tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants