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

Fix SandwichCompositor modifying input data #1690

Merged
merged 3 commits into from May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion satpy/composites/__init__.py
Expand Up @@ -948,7 +948,7 @@ def __call__(self, projectables, *args, **kwargs):
"""Generate the composite."""
projectables = self.match_data_arrays(projectables)
luminance = projectables[0]
luminance /= 100.
luminance = luminance / 100.
# Limit between min(luminance) ... 1.0
luminance = luminance.clip(max=1.)

Expand Down
6 changes: 3 additions & 3 deletions satpy/etc/composites/abi.yaml
Expand Up @@ -194,7 +194,7 @@ composites:
modifiers: [sunz_corrected, rayleigh_corrected]
- name: C03
modifiers: [sunz_corrected]
standard_name: toa_bidirection_reflectance
standard_name: toa_bidirectional_reflectance

cimss_green_sunz:
compositor: !!python/name:satpy.composites.abi.SimulatedGreen
Expand All @@ -207,7 +207,7 @@ composites:
modifiers: [sunz_corrected]
- name: C03
modifiers: [sunz_corrected]
standard_name: toa_bidirection_reflectance
standard_name: toa_bidirectional_reflectance

cimss_green:
compositor: !!python/name:satpy.composites.abi.SimulatedGreen
Expand All @@ -217,7 +217,7 @@ composites:
- name: C01
- name: C02
- name: C03
standard_name: toa_bidirection_reflectance
standard_name: toa_bidirectional_reflectance

cimss_true_color_sunz_rayleigh:
compositor: !!python/name:satpy.composites.SelfSharpenedRGB
Expand Down
2 changes: 2 additions & 0 deletions satpy/tests/test_composites.py
Expand Up @@ -431,6 +431,8 @@ def test_compositor(self, e2d):
for i in range(3):
np.testing.assert_allclose(res.data[i, :, :],
rgb_arr[i, :, :] * lum_arr / 100.)
# make sure the compositor doesn't modify the input data
np.testing.assert_allclose(lum.values, lum_arr.compute())


class TestInlineComposites(unittest.TestCase):
Expand Down