Skip to content

Use effective_solar_pathlength_corrected for cloud type and cloud phase #3032

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gerritholl
Copy link
Member

@gerritholl gerritholl commented Jan 16, 2025

Use the pure Li/Shibata effective_solar_pathlength_corrected modifier for cloud type and cloud phase RGBs for FCI. This makes the composite usable closer to the terminator, but without the saturation seen in the ABI versions. The pure correction is achieved by setting the correction limit very high (150 degree).

Add an imagery test and documentation on how to add imagery tests.

See below (also the comments) for different versions.

Cloud type with only sunz_corrected (satpy name: cimss_cloud_type):

MTG-I1-fci-eurol-cimss_cloud_type-20250116080000-20250116081000

Cloud type with sunz_corrected and sunz_reduced (satpy name: cloud_type):

MTG-I1-fci-eurol-cloud_type-20250116080000-20250116081000

Cloud type with solar_pathlength_corrected:

MTG-I1-fci-eurol-dwd_cloud_type-20250116080000-20250116081000

Cloud type with solar_pathlength_corrected and rayleigh_corrected (for VIS 0.6):

MTG-I1-fci-eurol-dwd_cloud_type_with_rayleigh-20250116080000-20250116081000

Cloud phase with sunz_corrected and sunz_reduced:

MTG-I1-fci-eurol-cloud_phase-20250116080000-20250116081000

Cloud phase with solar_pathlength_corrected:

MTG-I1-fci-eurol-dwd_cloud_phase-20250116080000-20250116081000

Cloud phase with solar_pathlength_corrected and rayleigh_corrected (for VIS 0.6):

MTG-I1-fci-eurol-dwd_cloud_phase_with_rayleigh-20250116080000-20250116081000

Use the solar_pathlength_corrected modifier for cloud type and cloud
phase RGBs for FCI.  This makes the composite usable closer to the terminator
but without the saturation seen in the ABI versions.
@gerritholl gerritholl marked this pull request as ready for review January 16, 2025 09:20
@gerritholl gerritholl requested review from simonrp84, strandgren and ameraner and removed request for simonrp84 January 16, 2025 09:21
@strandgren
Copy link
Collaborator

Nice work on this, it's clear that there is quite some more information to get from the imagery. But I have two questions:

  • in the recipes you use solar_pathlength_corrected, but where is this defined? I can only find effective_solar_pathlength_corrected defined here https://github.com/pytroll/satpy/blob/main/satpy/etc/composites/visir.yaml#L14.
  • Could you also provide a couple of example of how your proposed changes look in the day-night blends, i.e. cloud_type_with_night_ir105 and cloud_phase_with_night_ir105? We may need to tweak the blending there as well.

And as a comment, I still find that at least for the thick part of the frontal cloud close to the terminator the level of saturation is a bit too high. But I'm also aware that it's hard to find settings that works well for all conditions.

Fixed modifier name for solar pathlength corrected.
@gerritholl
Copy link
Member Author

  • in the recipes you use solar_pathlength_corrected, but where is this defined?

Oops. Only in my local recipes. Fixed with 6d5fe19. It shows why we need the automated imagery tests, and probably we should indeed merge #3013 first (where I added more on the behave tests) so I can leverage this!

Will check the versions with night_ir105.

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.22%. Comparing base (78e88c4) to head (abd4f69).
Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3032      +/-   ##
==========================================
- Coverage   96.23%   96.22%   -0.02%     
==========================================
  Files         398      398              
  Lines       57325    57382      +57     
==========================================
+ Hits        55168    55217      +49     
- Misses       2157     2165       +8     
Flag Coverage Δ
behaviourtests 3.87% <ø> (-0.01%) ⬇️
unittests 96.31% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gerritholl gerritholl changed the title Use solar_pathlength_corrected for cloud type and cloud phase Use effective_solar_pathlength_corrected for cloud type and cloud phase Jan 16, 2025
@coveralls
Copy link

coveralls commented Jan 16, 2025

Pull Request Test Coverage Report for Build 15068599121

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 18 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.01%) to 96.329%

Files with Coverage Reduction New Missed Lines %
satpy/readers/fci_l2_nc.py 1 99.57%
satpy/readers/li_base_nc.py 1 99.63%
satpy/tests/utils.py 2 93.16%
satpy/tests/reader_tests/gms/test_gms5_vissr_l1b.py 3 98.67%
satpy/tests/reader_tests/gms/test_gms5_vissr_navigation.py 3 97.18%
satpy/readers/fci_l1c_nc.py 8 97.3%
Totals Coverage Status
Change from base Build 14862404225: -0.01%
Covered Lines: 55477
Relevant Lines: 57591

💛 - Coveralls

@gerritholl
Copy link
Member Author

Cloud type night IR 10.5, before:

MTG-I1-fci-eurol-cloud_type_with_night_ir105-20250116080000-20250116081000

Cloud type night IR, after:

MTG-I1-fci-eurol-dwd_cloud_type_with_night_ir105-20250116080000-20250116081000

Cloud phase night IR, before:

MTG-I1-fci-eurol-cloud_phase_with_night_ir105-20250116080000-20250116081000

Cloud phase night IR, after:

MTG-I1-fci-eurol-dwd_cloud_phase_with_night_ir105-20250116080000-20250116081000

For curiosity, our internal solar_pathlength_corrected, that I accidentally used in the first commit, is defined as:

  solar_pathlength_corrected:
    modifier: !!python/name:satpy.modifiers.EffectiveSolarPathLengthCorrector
    optional_prerequisites:
      - solar_zenith_angle
    max_sza: !!null

whereas the satpy one is defined as:

effective_solar_pathlength_corrected:
modifier: !!python/name:satpy.modifiers.EffectiveSolarPathLengthCorrector
optional_prerequisites:
- solar_zenith_angle

The version I showed in the initial issue description is with max_sza: !!null, which we use internally for all our composites.

Cloud type with the effective solar pathlength corrector, default max_sza:

MTG-I1-fci-eurol-dwd_cloud_type-20250116080000-20250116081000-espc

Cloud type with the solar pathlength corrector, no max_sza:

MTG-I1-fci-eurol-dwd_cloud_type-20250116080000-20250116081000-spc

@strandgren
Copy link
Collaborator

For the effective_solar_pathlength_corrected I don't think the reduction is needed and setting max_sza: !!null should be fine (as your plots also confirm). For sunz_corrected I thinks it's useful, or even needed, given that the correction breaks around 90 degrees otherwise. You can see a comparison here: #2955 (comment).

So perhaps you can add your local effective_solar_pathlength_corrected definition in fci.yaml?

Thanks for the addition day/night blends. Doesn't seem to be much affected. But I believe that with these changes we can do the day/night blending at higher sunz angles to retain more of the daytime imagery, but that might be for another PR.

@ameraner
Copy link
Member

Thank you for your work and analysis!
I have mixed feelings about this: while I fully agree that trying to include more illuminated daytime pixels is beneficial, both RGBs do not really perform well in that twilight area... In the Cloud Type, the red-toned noise and ESL signal from the NIR1.3 is quite enhanced, and in the Cloud Phase the entire area is dominated by the blue component, making it not too useful.
It seems however that applying the default max_sza removes some of the low-quality and not-so-usable area, while still including a good amout of extra daytime pixels. So maybe that's a good compromise? If I understand the discussion correctly, the current PR code modifications reflects this setup.

@gerritholl
Copy link
Member Author

There is a tradeoff between æsthetics and the ability to extract information. This is probably true for any RGB based on solar channels and also when considering the day/night-transition in geo colour. And any RGB, as well as quantitative products, will lose quality approaching the terminator. Maybe cloud type is more affected here because NIR 1.3 is so dark already.

For our operational users, the ability to extract information is more important than æsthetics. I think they will accept and understand that. Colours are a bit different and noise becomes visible. OK.

If I understand the discussion correctly, the current PR code modifications reflects this setup.

Yes, the current PR code modification uses the default solar_pathlength_corrected (correction_limit=88, max_sza=95). It's a compromise between the status quo (sunz_corrected with or without sunz_reducer) and the DWD version (correction_limit=88, max_sza=None). The compromise looks prettier near the terminator, but the DWD version has more extractable information. What do we want as default in satpy?

@ameraner
Copy link
Member

I agree that information content is more important than aesthetics, at least for the default recipe (a user interested in only PR-like nice looking images can still tune a different recipe to their wishes, but I'd say that the general focus should be on meteorological usability and usefulness).
My question is if the low twilight area, with all the artefacts like noise and non-representative color tones (that are at that point not describing the actual physical status of the surface/cloud scene, like the violet terminator of the cloud phase and the saturated red clouds in cloud type) is useful/delivering information to the observer. Admittedly, it likely still delivers information at least for spatial patterns, even if the spectral information is likely not very usable... so I don't have a strong opinion, I'm ok with both solutions in the end.
But at least we can leave a note in the yaml saying that using the default max_sza can help to remove some of the bad quality areas, if any user investigates this in the future.

@mraspaud
Copy link
Member

Really nice work!
The discussion re whether to remove the terminator artefacts or not is interesting. Lets no forget though the regions where twilight lasts all day :) for these, I’m suspecting that having data with artefacts can still be better than no data at all...

@gerritholl
Copy link
Member Author

The discussion re whether to remove the terminator artefacts or not is interesting.

I'm all for removing artefacts, but removing the entire area that has artefacts in it has something of throwing out the child with the dirty bathwater...

@gerritholl gerritholl marked this pull request as draft January 17, 2025 13:59
@gerritholl
Copy link
Member Author

See also #3096 where @strandgren has made an excellent write-up of the different correction reductions near the terminator.

@gerritholl
Copy link
Member Author

gerritholl commented May 14, 2025

Sticking with EffectiveSolarPathlengthCorrector with max_sza: !!null, varying only correction_limit (no Rayleigh correction applied to any channel).

correction limit 86 degree:

MTG-I1-fci-eurol-cloud_type_86-20250116080000-20250116081000

correction limit 87 degree:

MTG-I1-fci-eurol-cloud_type_87-20250116080000-20250116081000

correction limit 88 degree:

MTG-I1-fci-eurol-cloud_type_88-20250116080000-20250116081000

correction limit 89 degree:

MTG-I1-fci-eurol-cloud_type_89-20250116080000-20250116081000

correction limit 90 degree:

MTG-I1-fci-eurol-cloud_type_90-20250116080000-20250116081000

with night_ir105:

correction limit 86 degree:

MTG-I1-fci-eurol-cloud_type_with_night_ir105_86-20250116080000-20250116081000

correction limit 87 degree:

MTG-I1-fci-eurol-cloud_type_with_night_ir105_87-20250116080000-20250116081000

differences start to become small here, because the right part is taking over when using lim_low: 78 and lim_high: 88, but of course this could be set tighter.

The same for cloud phase:

correction limit 86 degree:

MTG-I1-fci-eurol-cloud_phase_86_norayl-20250116080000-20250116081000

correction limit 87 degree:

MTG-I1-fci-eurol-cloud_phase_87_norayl-20250116080000-20250116081000

correction limit 88 degree:

MTG-I1-fci-eurol-cloud_phase_88_norayl-20250116080000-20250116081000

@strandgren
Copy link
Collaborator

@gerritholl Can you please add an example with this configuration as well:

correction_limit: 150
max_sza: null

which effectively disables the reduction functionality starting at correction_limit and thus falls back on the raw Li and Shibata parameterization for the full sunz range.

Sorry for my unavailability this week, ping me on slack if you want me join any discussion on this.

@gerritholl
Copy link
Member Author

gerritholl commented May 14, 2025

This is with 150 degree:

MTG-I1-fci-eurol-cloud_type_150-20250116080000-20250116081000

Seems to be less visible near the terminator compared to 90 degree.

@strandgren
Copy link
Collaborator

strandgren commented May 14, 2025

This is with 150 degree:

MTG-I1-fci-eurol-cloud_type_150-20250116080000-20250116081000

Seems to be less visible near the terminator compared to 90 degree.

Thanks, actually I prefer this one. With 90 degrees there is a red tint for the space part. Furthermore, the ice clouds in the north are less saturated with 150 degrees compared to 90 degrees. I also thinks it an added value if we can say that we use the Li and Shibata parameterization as is, rather than a tweaked version of it.

Set the default correction limit to 90° for the
``effective_solar_pathlength_corrected`` modifier in ``visir.yaml``.

Add image comparison test.

Add documentation on how to add a new image comparison test.
@gerritholl gerritholl marked this pull request as ready for review May 16, 2025 10:28
@gerritholl gerritholl requested review from adybbroe and pnuu as code owners May 16, 2025 10:29
@mraspaud mraspaud assigned mraspaud and gerritholl and unassigned mraspaud May 16, 2025
@mraspaud mraspaud added enhancement code enhancements, features, improvements component:compositors labels May 16, 2025
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM, just one question regarding consistency.

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

@gerritholl gerritholl marked this pull request as draft May 16, 2025 13:06
Comment on lines +18 to +20
# max_sza None means no reduction beyond correction_limit, see https://github.com/pytroll/satpy/issues/3096
max_sza: !!null
correction_limit: 150 # use "raw" Li/Shibata without correction
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change will impact any composite that uses this default modifier, so not only the FCI Cloud type and Cloud Phase RGBs. Given the discussion during and past the RGB workshop I guess that's fine and even preferred. But in that case I suggest to modify the PR title and description to make this more clear.

alternatively make a local modifier inside ./satpy/etc/composites/fci.yaml and then we change the default in a separate PR, potentially the one I want to do at some point refactoring the code for the standard and Li and Shibata sunz corrections.

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Copy link
Member Author

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

start behave test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:compositors enhancement code enhancements, features, improvements
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Standardize the correction for atmospheric path length for solar channels
5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy