Skip to content

Change default behaviour of SunZenithCorrector/sunz_corrected #3412

Description

@strandgren

With #3397 it is suggested that the default behaviour of sunz_corrected modifier (SunZenithCorrector) should be changed to compute the true reflectance in Satpy >= 1.0. We would then have the sunz_corrected modifier that computes the true reflectance for scientific or quantitative use and the effective_solar_pathlength_corrected modifier which uses the Li and Shibata (2006) parameterization to avoid over-correction at high Sun zenith angels for (RGB) imagery.

For now, #3397 keeps the current default values and behavior (reduction of the sunz correction between 88-95 degrees), but adds a config parameter that can be set to either retain the legacy default behavior of the SunZenithCorrector/sunz_corrected modifier, also after upgrade to Satpy v1.0 or to opt in for the new behavior (no reduction and simple 1/cos(sunz) correction) already before Satpy v1.0. This can be controlled set with:

import satpy
satpy.config.set(use_legacy_sunz_correction=True)  # or False

With #3397 use_legacy_sunz_correction is set to True by default, making sure to keep the current/legacy behavior. Hence, we simply have to set the defautl configuration value it False in Satpy v1.0 to have a direct switch to the new behaviour of SunZenithCorrector and sunz_corrected

Later, once the changes in #3397 and v1.0 have been established (say for Satpy v1.1), we can remove the option to use the legacy behaviour and cleanup the code accordingly:

  • Remove use_legacy_sunz_correction in _config.py
  • Change default values for correction_limit and max_sunz of SunZenithCorrector to None
  • Cleanup init docstring in SunZenithCorrector
  • Remove handling of __default__ and self.use_legacy as well as warning in SunZenithCorrector._apply_correction()
  • Remove deprecated tests covering both ew and legacy behaviour and adapt expected output for testing default behaviour of SunZenithCorrector (see f3b605d)
  • Remove deprecated class init input arguments and in EffectiveSolarPathLengthCorrector
  • Remove warning in EffectiveSolarPathLengthCorrector about deprecated input arguments.
  • Remove tests for warnings

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions