On 23.9.2024 23.25, 'Cris B' via pytroll wrote:
> Hi
>
> I'd like to prevent true colour (and also greyscale vis) images from
> being generated when it is night time, and also perhaps for instances
> when there are only a few "lit" pixels. What's the most efficient way
> of doing this with a satpy.scene.Scene instance? I'm imagining
> something like this, but it takes quite a while to compute:
Hi,
This is what we do in Trollflow2 to check day-light coverage:
https://github.com/pytroll/trollflow2/blob/main/trollflow2/plugins/__init__.py#L767
The relevant parts are
overpass = Pass(platform_name, start_time, end_time, instrument=sensor)
and calling the
_get_sunlight_coverage(area_def, start_time, overpass=None)
function to get the actual percentage where sun is up on the target
area. We then compare to configured values and discard the product if
the day-light covered area is too small or too small (for night-only
products).
P
--
Arctic Space Centre
Finnish Meteorological Institute
Phone:
+358 50 380 3261