Skip to content

Commit

Permalink
Merge pull request #2653 from ameraner/update_sunz_reducer
Browse files Browse the repository at this point in the history
Update Sun-zenith reducer defaults
  • Loading branch information
mraspaud committed Nov 28, 2023
2 parents df66a1c + 4dd1920 commit d21861c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
27 changes: 27 additions & 0 deletions satpy/etc/composites/fci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ composites:
- name: vis_08
standard_name: toa_bidirectional_reflectance

ndvi_hybrid_green_fully_sunzencorrected:
description: Same as ndvi_hybrid_green, but without Sun-zenith reduction
compositor: !!python/name:satpy.composites.spectral.NDVIHybridGreen
limits: [ 0.15, 0.05 ]
strength: 3.0
prerequisites:
- name: vis_05
modifiers: [ sunz_corrected, rayleigh_corrected ]
- name: vis_06
modifiers: [ sunz_corrected, rayleigh_corrected ]
- name: vis_08
modifiers: [ sunz_corrected ]
standard_name: toa_bidirectional_reflectance

binary_cloud_mask:
# This will set all clear pixels to '0', all pixles with cloudy features (meteorological/dust/ash clouds) to '1' and
# missing/undefined pixels to 'nan'. This can be used for the the official EUMETSAT cloud mask product (CLM).
Expand All @@ -56,6 +70,19 @@ composites:
modifiers: [sunz_corrected, rayleigh_corrected, sunz_reduced]
standard_name: true_color

true_color_fully_sunzencorrected:
compositor: !!python/name:satpy.composites.SelfSharpenedRGB
description: >
Same as true_color, but without Sun-zenith reduction. For users that want to maintain as much data as possible
close to the terminator, at cost of some artefacts (bright limb and reddish clouds) (see issue #2643).
prerequisites:
- name: vis_06
modifiers: [sunz_corrected, rayleigh_corrected]
- name: ndvi_hybrid_green_fully_sunzencorrected
- name: vis_04
modifiers: [sunz_corrected, rayleigh_corrected]
standard_name: true_color

true_color_raw_with_corrected_green:
compositor: !!python/name:satpy.composites.SelfSharpenedRGB
description: >
Expand Down
11 changes: 6 additions & 5 deletions satpy/modifiers/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ class SunZenithReducer(SunZenithCorrectorBase):
"""

def __init__(self, correction_limit=55., max_sza=90, strength=1.5, **kwargs): # noqa: D417
def __init__(self, correction_limit=80., max_sza=90, strength=1.3, **kwargs): # noqa: D417
"""Collect custom configuration values.
Args:
correction_limit (float): Solar zenith angle in degrees where to start the signal reduction. Default 60.
correction_limit (float): Solar zenith angle in degrees where to start the signal reduction.
max_sza (float): Maximum solar zenith angle in degrees where to apply the signal reduction. Beyond
this solar zenith angle the signal will become zero. Default 90.
strength (float): The strength of the non-linear signal reduction. Default 1.5
this solar zenith angle the signal will become zero.
strength (float): The strength of the non-linear signal reduction.
"""
self.correction_limit = correction_limit
Expand All @@ -194,7 +194,8 @@ def __init__(self, correction_limit=55., max_sza=90, strength=1.5, **kwargs): #
raise ValueError("`max_sza` must be defined when using the SunZenithReducer.")

def _apply_correction(self, proj, coszen):
logger.debug("Apply sun-zenith signal reduction")
logger.debug(f"Applying sun-zenith signal reduction with correction_limit {self.correction_limit} deg,"
f" strength {self.strength}, and max_sza {self.max_sza} deg.")
res = proj.copy()
sunz = np.rad2deg(np.arccos(coszen.data))
res.data = sunzen_reduction(proj.data, sunz,
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/test_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_default_settings(self, sunz_ds1, sunz_sza):
"""Test default settings with sza data available."""
res = self.default((sunz_ds1, sunz_sza), test_attr="test")
np.testing.assert_allclose(res.values,
np.array([[0.00242814, 0.00235669], [0.00245885, 0.00238707]]),
np.array([[0.02916261, 0.02839063], [0.02949383, 0.02871911]]),
rtol=1e-5)

def test_custom_settings(self, sunz_ds1, sunz_sza):
Expand Down

0 comments on commit d21861c

Please sign in to comment.