satpy icon indicating copy to clipboard operation
satpy copied to clipboard

MetopC script fails after update to SatPy 0.37

Open lobsiger opened this issue 3 years ago • 0 comments

Describe the bug The script fails under Satpy 0.37 but has always run fine under Satpy 0.35 and Satpy 0.36. See description and error messages/debug output on the google list in this thread:

https://groups.google.com/g/pytroll/c/RHGLzoAuZjc

To Reproduce

I puplished this minimal code together with the 3 data files and area definition on wetransfer (link valid one week):

https://we.tl/t-yL5rE8grUk (31MB zip file)

from satpy import Scene from satpy.writers import compute_writer_results area = 'isleofman' composites = ['ir108_3d']

files = ['./data/AVHR_xxx_1B_M03_20220810203703Z_20220810204003Z_N_O_20220810211140Z', './data/AVHR_xxx_1B_M03_20220810204003Z_20220810204303Z_N_O_20220810211212Z', './data/AVHR_xxx_1B_M03_20220810204303Z_20220810204603Z_N_O_20220810211243Z']

scn = Scene(filenames = files, reader = 'avhrr_l1b_eps') scn.load(composites, generate = False) new_scn = scn.resample(area)

save_objects = [] for composite in composites: save_objects.append(new_scn.save_dataset(composite, filename = './imgs/MetopC-{name}.png', compute = False)) compute_writer_results(save_objects)

Expected behavior This script should save an image of the UK in subdirectory ./imgs. It works under SatPy 0.36. fails with SatPy 0.37

Actual results ... Traceback (most recent call last): File "issue037.py", line 24, in compute_writer_results(save_objects) File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/satpy/writers/init.py", line 541, in compute_writer_results da.compute(delayeds) File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/dask/base.py", line 598, in compute results = schedule(dsk, keys, **kwargs) File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/dask/threaded.py", line 89, in get results = get_async( File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/dask/local.py", line 511, in get_async raise_exception(exc, tb) File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/dask/local.py", line 319, in reraise raise exc File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/dask/local.py", line 224, in execute_task result = _execute_task(task, data) File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/dask/core.py", line 119, in _execute_task return func(*(_execute_task(a, cache) for a in args)) File "/home/eumetcast/miniconda3/envs/pytroll/lib/python3.8/site-packages/PIL/Image.py", line 2943, in fromarray arr = obj.array_interface AttributeError: 'Array' object has no attribute 'array_interface' (pytroll) eumetcast@kallisto:~/issue037$

Screenshots

https://groups.google.com/g/pytroll/c/RHGLzoAuZjc

Environment Info:

  • OS: 0.37 fails on both GNU/Linux and Windows 10, SatPY 0.36 still works on GNU/Linux
  • Satpy Version:

Name Version Build Channel

satpy 0.37.0 pyhd8ed1ab_0 conda-forge

  • PyResample Version:

Name Version Build Channel

pyresample 1.23.0 py38h47df419_1 conda-forge

Full output of command "conda list" published on: https://groups.google.com/g/pytroll/c/RHGLzoAuZjc

  • Readers and writers dependencies (when relevant): [run from satpy.utils import check_satpy; check_satpy()]

Additional context Original MetopC-area.py is part of a whole distribution Kit 4.0 that includes scripts for many GEO and LEO satellites. Whenever possible I use generate=False for speed. This has worked fine up to now and has been extensively tested. Most code of my Kit 4.0 is in 2 modules LEOstuff.py and GEOstuff.py. I expect other sat scripts to fail now as well ...

lobsiger avatar Aug 11 '22 19:08 lobsiger