-
Notifications
You must be signed in to change notification settings - Fork 319
Closed
Description
Describe the bug
Producing the snow_age
composite after the cloud_phase
composite fails.
I am testing with some VIIRS data in .h5 format.
To Reproduce
from satpy.scene import Scene
from glob import glob
coast_dir = '/opt/gshhg'
all_overlays = { 'coast': {'level':1} }
myfiles = glob("data/*h5")
scn = Scene(filenames=myfiles, reader='viirs_sdr')
wanted = 'cloud_phase'
scn.load([wanted])
lcn = scn.resample('antarctica')
print('ATTRS for %s = %s' % (wanted, lcn[wanted].attrs))
lcn.save_dataset(wanted, 'test.%s.png' % wanted, overlay = {'overlays': all_overlays, 'coast_dir':coast_dir})
wanted = 'snow_age'
scn.load([wanted])
lcn = scn.resample('antarctica')
print('ATTRS for %s = %s' % (wanted, lcn[wanted].attrs))
lcn.save_dataset(wanted, 'test.%s.png' % wanted, overlay = {'overlays': all_overlays, 'coast_dir':coast_dir})
Expected behavior
Both composites created
Actual results
File "./read2.py", line 21, in <module>
lcn.save_dataset(wanted, 'test.%s.png' % wanted, overlay = {'overlays': all_overlays, 'coast_dir':coast_dir})
File "miniconda3/lib/python3.11/site-packages/satpy/scene.py", line 1295, in save_dataset
return writer.save_dataset(self[dataset_id],
File "miniconda3/lib/python3.11/site-packages/satpy/writers/__init__.py", line 883, in save_dataset
img = get_enhanced_image(dataset.squeeze(), enhance=self.enhancer, overlay=overlay,
File "miniconda3/lib/python3.11/site-packages/satpy/writers/__init__.py", line 448, in get_enhanced_image
img = add_overlay(img, dataset.attrs["area"], fill_value=fill_value, **overlay)
KeyError: 'area'
Environment Info:
- OS: Linux
- Satpy Version: 0.46
Metadata
Metadata
Assignees
Labels
No labels