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

Add a compositor to mask visible night #3102

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mraspaud
Copy link
Member

@mraspaud mraspaud commented Apr 8, 2025

My use case for the true color composite is often to put it on top of another composite that fills in the night part of the image.
For that a straightforward solution is to use the daynightcompositor. However, I'm never really satisfied because it in a compromise between having a large termiator area or loosing bright spots from true color on the night side.

This PR proposes a simple thresholding from the image channel to complement the opacity gradient.

Feedback on this idea is welcome.

  • Closes #xxxx
  • Tests added
  • Fully documented

Examples:

  • FCI

true_color_day_20240706_165000

With another composite behind
blend

  • VIIRS
    true_color_day_20250408_074213

  • an example configuration for this composite:

  true_color_day:
    compositor: !!python/name:satpy.composites.MaskVisibleNightCompositor
    standard_name: image_ready
    lim_low: 88.0
    prerequisites:
      - name: true_color

Copy link

codecov bot commented Apr 8, 2025

Codecov Report

Attention: Patch coverage is 14.54545% with 47 lines in your changes missing coverage. Please review.

Project coverage is 96.08%. Comparing base (3a208c0) to head (2c87c5a).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
satpy/composites/__init__.py 14.54% 47 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3102      +/-   ##
==========================================
- Coverage   96.16%   96.08%   -0.08%     
==========================================
  Files         389      389              
  Lines       56418    56473      +55     
==========================================
+ Hits        54256    54264       +8     
- Misses       2162     2209      +47     
Flag Coverage Δ
behaviourtests 3.85% <14.54%> (+0.01%) ⬆️
unittests 96.18% <14.54%> (-0.08%) ⬇️

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.

@mraspaud
Copy link
Member Author

mraspaud commented Apr 8, 2025

An example for the cloud phase composite
cloud_phase_day_20240706_165000

@coveralls
Copy link

Pull Request Test Coverage Report for Build 14337460508

Details

  • 8 of 55 (14.55%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.08%) to 96.192%

Changes Missing Coverage Covered Lines Changed/Added Lines %
satpy/composites/init.py 8 55 14.55%
Totals Coverage Status
Change from base Build 14322426188: -0.08%
Covered Lines: 54516
Relevant Lines: 56674

💛 - Coveralls

@TAlonglong
Copy link
Collaborator

Oh, this looks really nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants