Skip to content

Implement FCI "Flames" fire visualisation #3129

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ameraner
Copy link
Member

@ameraner ameraner commented May 14, 2025

This PR implements an FCI composite blending the True Color with a fire visualisation on top. To select the fire pixels to be colorised, a simple fire mask compositor is implemented.

WARNING: this is just a first attempt at this kidn of visualisation. The fire detector employed here is handcrafted, extremely simple and is prone to false alarms and missed detection. It is designed just for PR-like visualisations of larger fires and not for any other (operational fire detection) usage.

The implementation of the compositor is generic so that it can be used by other instruments after tuning the according parameters, although it has only been tested with FCI.
The parameters are tuned to be used with FDHSI+HRFI inputs (500m or 1km composite output)

  • Tests added
  • Fully documented

Example code to generate an FCI image:

from satpy.scene import Scene
from glob import glob

filenames = glob('/yourdatafolder/*20240916*_O_0080_*')  # remember to pass both FDHSI and HRFI files to the Scene for best results!
scn = Scene(filenames=filenames, reader='fci_l1c_nc')
scn.load(['true_color_flames_with_night_ir105'], upper_right_corner='NE')
scn_r = scn.resample(scn.finest_area(), resampler='native', reduce_data=False)
scn_r.save_datasets(writer="simple_image", base_dir="/outdir/")

Some example images:
Portugal September 2024 wildfires:
image
Wildfires in southern Africa:
image
Attica Fire on 11.08.2024:
image
Etna Eruption on 04.08.2024:
image

@ameraner ameraner self-assigned this May 14, 2025
@ameraner ameraner requested review from djhoese and mraspaud as code owners May 14, 2025 12:41
@ameraner ameraner added enhancement code enhancements, features, improvements component:compositors labels May 14, 2025
@ameraner ameraner moved this to In Progress in PCW Spring 2025 May 14, 2025
@coveralls
Copy link

coveralls commented May 14, 2025

Pull Request Test Coverage Report for Build 15437805336

Details

  • 35 of 35 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 96.358%

Totals Coverage Status
Change from base Build 15437601707: 0.002%
Covered Lines: 55930
Relevant Lines: 58044

💛 - Coveralls

Copy link

codecov bot commented May 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.25%. Comparing base (a966efe) to head (0bb743a).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3129   +/-   ##
=======================================
  Coverage   96.25%   96.25%           
=======================================
  Files         429      429           
  Lines       57773    57808   +35     
=======================================
+ Hits        55608    55643   +35     
  Misses       2165     2165           
Flag Coverage Δ
behaviourtests 3.80% <5.71%> (+<0.01%) ⬆️
unittests 96.34% <100.00%> (+<0.01%) ⬆️

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.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Neat! I'm not an expert on stuff like this, but the images look cool and the code seems simple enough.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

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

Very nice (and surpisingly simple!) composite!

But is this a "spectral" composite comparable to SpectralBlender and HybridGreen composites? In #3123 (comment) I went through the currently existing compositors in composites.__init__.py and tried to categorize them. From those (and the existing modules) I think this would go in the "other" category.

@@ -246,6 +246,57 @@ composites:
- flash_age
- true_color_with_night_ir105

### True Color with Fires
true_color_flames_with_night_ir105:
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't there a recommendation from the RGB workshop to name all day-only products with a day prefix?

Copy link
Member Author

@ameraner ameraner May 15, 2025

Choose a reason for hiding this comment

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

the fire overlay works day&night, so also the background composite is day&night, so we can probably leave it like this? Naming of complex composites gets ugly quite quickly...

Co-authored-by: Panu Lahtinen <[email protected]>
@ameraner
Copy link
Member Author

But is this a "spectral" composite comparable to SpectralBlender and HybridGreen composites? In #3123 (comment) I went through the currently existing compositors in composites.__init__.py and tried to categorize them. From those (and the existing modules) I think this would go in the "other" category.

I put it in spectral as it is using spectral tests, but yes indeed it doesn't fit well with the others. So I can move it to __init__ and I leave the new recategorisation to you. It could also be the first of a "Feature Detection" compositor class maybe...

@mraspaud mraspaud requested a review from adybbroe as a code owner May 15, 2025 13:31
@mraspaud
Copy link
Member

Here is the VIIRS version
true_color_flames_with_night_ir105_20240916_131437_extract

@ameraner
Copy link
Member Author

I moved the compositor to the init as suggested by Panu

@ameraner ameraner requested a review from pnuu May 16, 2025 13:08
@ameraner ameraner moved this from In Progress to Ready for review in PCW Spring 2025 May 19, 2025
@mraspaud
Copy link
Member

Alternative blending and colorscale (will be another PR)
tcf_20240916_131437

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.

Just a suggestion to fixe typos

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: Ready for review
Development

Successfully merging this pull request may close these issues.

5 participants