Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The crop function is no longer working. #1635

Closed
simonrp84 opened this issue Apr 12, 2021 · 1 comment
Closed

The crop function is no longer working. #1635

simonrp84 opened this issue Apr 12, 2021 · 1 comment

Comments

@simonrp84
Copy link
Member

Describe the bug
The crop function of Scene, to extract a smaller area from a large area, does not appear to be working correctly, it is giving an error.

To Reproduce

bbox = (-61.68, 12.33, -59.68, 14.33)

from satpy import Scene
scn = Scene([some_files], reader='abi_l1b')
scn.load(['C01'])
scn2 = scn.crop(ll_bbox = bbox)

Expected behavior
A new scene object containing the cropped area.

Actual results

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-11-6dd1c32ec404> in <module>
----> 1 scn.crop(ll_bbox=bbox)

D:\Miniconda3\lib\site-packages\satpy\scene.py in crop(self, area, ll_bbox, xy_bbox, dataset_ids)
    588         if isinstance(area, str):
    589             area = get_area_def(area)
--> 590         new_coarsest_area, min_y_slice, min_x_slice = self._slice_area_from_bbox(
    591             coarsest_area, area, ll_bbox, xy_bbox)
    592         new_target_areas = {}

D:\Miniconda3\lib\site-packages\satpy\scene.py in _slice_area_from_bbox(src_area, dst_area, ll_bbox, xy_bbox)
    471                 src_area.crs, src_area.width, src_area.height,
    472                 xy_bbox)
--> 473         x_slice, y_slice = src_area.get_area_slices(dst_area)
    474         return src_area[y_slice, x_slice], y_slice, x_slice
    475 

D:\Miniconda3\lib\site-packages\pyresample\geometry.py in get_area_slices(self, area_to_cover)
    414     def get_area_slices(self, area_to_cover):
    415         """Compute the slice to read based on an `area_to_cover`."""
--> 416         raise NotImplementedError
    417 
    418 

NotImplementedError: 

Environment Info:

  • OS: Windows 10
  • Satpy Version: 0.26 and 0.27
  • PyResample Version: 1.18 and 1.18.1
  • Readers and writers dependencies (when relevant): [run from satpy.utils import check_satpy; check_satpy()]

Additional context
Have tested recent versions of satpy and pyresample, and various combinations of the dask, numpy and xarray libraries. Problem the same with all versions I've tried.

@simonrp84
Copy link
Member Author

False alarm, someone had changed our server settings so both the Meso1 and Meso2 sectors were going into the same directory. Hence satpy was making a stacked area def from the two mesos.
No issue in satpy, so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant