pytroll / pytroll/satpy

Resampling to "met09globeFull" area definition fails

Open
#930 11 comments 0 reactions 1 assignee View on GitHub

@pnuu is already working on this.

Since May 7, 2020.

bug component:resampling
Dominant language
Python
Stars
1.2k
Forks
335
Avg merge
1d 18h
Merged PRs (30d)
10

Description

Describe the bug
Resampling to built-in met09globeFull area definition fails.

To Reproduce

import glob
from satpy import Scene

fnames = glob.glob('/home/lahtinep/data/satellite/new/H*201804111130*')
glbl = Scene(reader='seviri_l1b_hrit', filenames=fnames)
glbl.load(['natural_color'])
lcl = glbl.resample("met09globeFull")

Expected behavior
The loaded product(s) should be resampled to the built-in geostationary projection.

Actual results

lcl = glbl.resample("met09globeFull")                                              
[DEBUG: 2019-10-09 10:11:17 : satpy.scene] Setting 'PPP_CONFIG_DIR' to '/home/lahtinep/Software/pytroll/mpop_etc'
[DEBUG: 2019-10-09 10:11:18 : satpy.scene] Resampling DatasetID(name='natural_color', wavelength=None, resolution=3000.403165817, polarization=None, calibration=None, level=None, modifiers=None)
[DEBUG: 2019-10-09 10:11:18 : pyresample.geometry] Projections for data and slice areas are identical: geos
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-22-7e8e8a1b430d> in <module>
----> 1 lcl = glbl.resample("met09globeFull")

~/Software/pytroll/packages/satpy/satpy/scene.py in resample(self, destination, datasets, generate, unload, resampler, reduce_data, **resample_kwargs)
   1103         new_scn.wishlist = self.wishlist.copy()
   1104         self._resampled_scene(new_scn, destination, resampler=resampler,
-> 1105                               reduce_data=reduce_data, **resample_kwargs)
   1106 
   1107         # regenerate anything from the wishlist that needs it (combining

~/Software/pytroll/packages/satpy/satpy/scene.py in _resampled_scene(self, new_scn, destination_area, reduce_data, **resample_kwargs)
   1046                         source_area = source_area[slice_y, slice_x]
   1047                         reductions[key] = (slice_x, slice_y), source_area
-> 1048                     dataset = self._slice_data(source_area, (slice_x, slice_y), dataset)
   1049                 else:
   1050                     LOG.debug("Data reduction disabled by the user")

~/Software/pytroll/packages/satpy/satpy/scene.py in _slice_data(self, source_area, slices, dataset)
    992         slice_x, slice_y = slices
    993         dataset = dataset.isel(x=slice_x, y=slice_y)
--> 994         assert ('x', source_area.x_size) in dataset.sizes.items()
    995         assert ('y', source_area.y_size) in dataset.sizes.items()
    996         dataset.attrs['area'] = source_area

AssertionError: 

Environment Info:

  • OS: Ubuntu 18.04 LTS
  • Satpy Version: current master branch
  • Pyresample Version: current master branch
  • Python 3.7 from conda
  • pyproj: 2.3.1
  • proj: 6.1.1

Additional context
Resampling to other built-in areas, e.g. euro4 works.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.