true_color_with_night_ir_hires composite?

22 views
Skip to first unread message

Marty Sullivan

unread,
Feb 24, 2021, 10:10:44 PM2/24/21
to pytroll
I noticed this composite appear in the list of available_composite_names for abi_l1b and ahi_hsd readers in a recent release of SatPy. Unfortunately, I haven't been able to get it to work. 

I've downloaded the BlackMarble_2016_3km_geo.tif from here: 


However, when I try to run:

scene = Scene(filenames=filenames, reader=reader)
scene.load(['true_color_with_night_ir_hires'])

resampled = scene.resample(
  scene.max_area(),
  resampler='native',
)

I get the following exception:

Traceback (most recent call last):
  File "./geocolor.py", line 55, in <module>
    scene.max_area(),
  File "/usr/local/lib/python3.8/site-packages/satpy/scene.py", line 284, in max_area
    return self._compare_areas(datasets=datasets, compare_func=max)
  File "/usr/local/lib/python3.8/site-packages/satpy/scene.py", line 262, in _compare_areas
    raise ValueError("Can't compare areas with different "
ValueError: Can't compare areas with different projections.

Any tips on how to get this seemingly useful DayNightComposite to work?

David Hoese

unread,
Feb 25, 2021, 8:07:24 AM2/25/21
to pyt...@googlegroups.com
Marty,

`max_area` can only be used when the areas of all the data in the Scene
are the same projection and represent the same geographic area (like two
resolutions of ABI data). Same goes for the 'native' resampler, it can
only replicate or aggregate pixels to make them match the resolution of
another similar area.

The background is a completely different projection from the satellite
data you are looking at so you'll need to use 'nearest' resampling and
resample to a different area (or to the area of a dataset from the
satellite). Let me know if you need more details, but I'll need to know
what reader you're using to help more.

Dave
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/b9d3b203-8a22-40a5-8b9d-f71d7706433bn%40googlegroups.com
> <https://groups.google.com/d/msgid/pytroll/b9d3b203-8a22-40a5-8b9d-f71d7706433bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages