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

Combine low level moisture with a cloud mask #3022

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions satpy/etc/composites/fci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,57 @@ composites:
- name: ir_38
modifiers: [nir_reflectance]
standard_name: snow

masked_colorized_low_level_moisture:
compositor: !!python/name:satpy.composites.MaskingCompositor
standard_name: masked_essl_colorized_low_level_moisture
prerequisites:
- essl_colorized_low_level_moisture
- cloud_state
conditions:
- method: equal
value: Not processed (no or corrupt data)
transparency: 100
- method: equal
value: Cloud free (no cloud, snow or ice)
transparency: 0
- method: equal
value: Cloud contaminated (partial or semitransparent cloud)
transparency: 100
- method: equal
value: Cloud filled (opaque cloud filled)
transparency: 100
- method: equal
value: Dust contaminated
transparency: 100
- method: equal
value: Dust filled (opaque)
transparency: 100
- method: equal
value: Ash contaminated
transparency: 100
- method: equal
value: Ash filled (opaque)
transparency: 100
- method: equal
value: Snow or ice contaminated
transparency: 0
- method: equal
value: Undefined
transparency: 0
mode: LA

colorized_low_level_moisture_with_vis06:
compositor: !!python/name:satpy.composites.BackgroundCompositor
standard_name: image_ready
prerequisites:
- masked_colorized_low_level_moisture
- name: vis_06
modifiers: [effective_solar_pathlength_corrected]

colorized_low_level_moisture_with_ir105:
compositor: !!python/name:satpy.composites.BackgroundCompositor
standard_name: image_ready
prerequisites:
- masked_colorized_low_level_moisture
- night_ir105
8 changes: 7 additions & 1 deletion satpy/etc/enhancements/generic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,9 @@ enhancements:
operations: []

essl_colorized_low_level_moisture:
# this enhancement is only found if using name but not standard_name
name: essl_colorized_low_level_moisture
operations:
operations: &masked_llm
- name: colorize
method: !!python/name:satpy.enhancements.colorize
kwargs:
Expand Down Expand Up @@ -1352,6 +1353,11 @@ enhancements:
- [255, 249, 183]
- [255, 255, 191]

masked_essl_colorized_low_level_moisture:
# this enhancement is only found if using standard_name but not name
standard_name: masked_essl_colorized_low_level_moisture
operations: *masked_llm

rocket_plume:
standard_name: rocket_plume
operations:
Expand Down
1 change: 1 addition & 0 deletions satpy/tests/behave/features/image_comparison.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Feature: Image Comparison
|Meteosat-12 | scan_night | cloudtop | fci_l1c_nc | sve | True |
|Meteosat-12 | scan_night | night_microphysics | fci_l1c_nc | sve | True |
|Meteosat-12 | mali_day | essl_colorized_low_level_moisture | fci_l1c_nc | mali | False |
|Meteosat-12 | spain_day | colorized_low_level_moisture_with_vis06 | fci_l1c_nc,fci_l2_nc | spain | False |
|GOES17 | americas_night | airmass | abi_l1b | null | null |
|GOES16 | americas_night | airmass | abi_l1b | null | null |
|GOES16 | americas_night | ash | abi_l1b | null | null |
Expand Down
11 changes: 6 additions & 5 deletions satpy/tests/behave/features/steps/image_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import numpy as np
from behave import given, then, when

import satpy
from satpy import Scene

ext_data_path = "/app/ext_data"
Expand Down Expand Up @@ -75,12 +76,12 @@ def step_when_generate_image(context, composite, satellite, case, reader, area,
# Get the list of satellite files to open
filenames = glob(f"{ext_data_path}/satellite_data/{satellite}/{case}/*.nc")

reader_kwargs = {}
if clip != "null":
reader_kwargs["clip_negative_radiances"] = clip
scn = Scene(reader=reader, filenames=filenames, reader_kwargs=reader_kwargs)

scn.load([composite])
if "," in reader:
reader = reader.split(",")
with satpy.config.set({"readers.clip_negative_radiances": False if clip == "null" else clip}):
scn = Scene(reader=reader, filenames=filenames)
scn.load([composite])

if area == "null":
ls = scn
Expand Down
8 changes: 6 additions & 2 deletions utils/create_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def generate_images(props):
filenames = (props.basedir / "satellite_data" / props.satellite /
props.case).glob("*")

scn = Scene(reader=props.reader, filenames=filenames)
if "," in props.reader:
reader = props.reader.split(",")
else:
reader = props.reader
scn = Scene(reader=reader, filenames=filenames)

scn.load(props.composites)
if props.area == "native":
Expand Down Expand Up @@ -74,7 +78,7 @@ def get_parser():

parser.add_argument(
"reader", action="store", type=str,
help="Reader name.")
help="Reader name. Multiple readers (if needed) can be comma-seperated.")

parser.add_argument(
"case", help="case to generate", type=str)
Expand Down
Loading