pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.07k stars 298 forks source link

False color compositor using a land sea mask to colorize IR window channel #2721

Open TAlonglong opened 10 months ago

TAlonglong commented 10 months ago

Feature Request

In the past I have used a script doing this. Examples can be seen here: https://api.met.no/weatherapi/geosatellite/1.4/?area=global&type=infrared

Revising my old code, I want to add this as an compositor.

I'm not sure if this is of interest of others, but it would make my setup easier.

If you think this is to special, I think I can import this compositor separate from satpy

mraspaud commented 10 months ago

I think this is definitely interesting!

gerritholl commented 10 months ago

If I understand it correctly, that means the user would pass one background image to use for land and another background image to use for sea?

Looks interesting, but should it be a land-sea mask or a land-water mask? In your link, large lakes are coloured as land, whereas they probably should be coloured as sea (particularly clear at the Caspian Sea), so unless this is specifically about marine forecasting or so, I would call it a land-water mask from the start and implement it as such.

TAlonglong commented 10 months ago

No @gerritholl, one static image containing a land sea mask as https://github.com/pytroll/satpy/blob/main/satpy/etc/composites/fci.yaml#L165-L168

But I agree, I want to improve that also inland lakes are colored as water. So it is I good idea to use the term water instead of sea.

The draft PR already colors inland lakes as water

simonrp84 commented 10 months ago

I also have a need for a land/sea mask compositor and as you've shown @strandgren has also used one for the geocolor composite. Seems like there is a common need for a coordinated approach on the best way to organise this. Perhaps a separate compositor that can be used by all of our various needs, which can load a LSM (preferably including cached ones for the GEO sensors to speed things up, rather than resampling from a lat/lon image each time) and with an optional argument to specify the LSM resolution.

Don't have much time, but am happy to help implement something as the idea develops :-)

TAlonglong commented 10 months ago

Yeah @simonrp84, But it don't have to be a lsm or lwm (land water mask), but a generic mask dataset.

A mask is also applied using a dataset with the CloudType( I think) NWCSAF product.

strandgren commented 10 months ago

I also think this is a good idea. For GeoColor I made it quite generic (even though it's currently locked inside the GeoColor LowCloudCompositor), where the user provides a land-water mask dataset as a static image (geotiff) using the StaticImageCompositor and two lists of values that represent land and water respectively. So maybe you could build from that approach?

Because I think that this can rather easily be made more generic with for example a LandWaterMaskCompositor that takes a dataset/composite as input (loaded from e.g. satellite product directly or from a static image using the StaticImageCompositor ) and then the two lists of values that should represent land and water respectively. Under the hood I guess the MaskingCompositor can be utilized for more flexibility? The question is if the MaskingCompositor can maybe do the job alone, without the need for an additional compositor?