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

Fix unexpected nans from gradient search #456

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyresample/test/test_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def test_concatenate_chunks():
assert res.shape == (3, 8, 6)


class TestGradientCython():
class TestGradientCython:
"""Test the core gradient features."""

def setup_method(self):
Expand Down
27 changes: 27 additions & 0 deletions pyresample/test/test_slicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,33 @@ def test_slicing_works_with_extents_of_different_units(self):
assert 60 <= slice_x.stop < 65
assert 50 <= slice_y.stop < 55

def test_regression_449(self):
import numpy as np

from pyresample import create_area_def

lon = np.arange(-180, 180, 0.25)
lat = np.arange(-90, 90 + 0.25, 0.25)

area_ext = (np.nanmin(lon), np.nanmin(lat), np.nanmax(lon), np.nanmax(lat))
src_area = create_area_def("source_area",
"EPSG:4326",
area_extent=area_ext,
width=len(lon),
height=len(lat))

dest_area = create_area_def("msg_3km_disk",
{'a': '6378169', 'h': '35785831', 'lon_0': '0', 'no_defs': 'None', 'proj': 'geos',
'rf': '295.488065897001', 'type': 'crs', 'units': 'm', 'x_0': '0', 'y_0': '0'},
area_extent=(-5570248.6867, -5567248.2834, 5567248.2834, 5570248.6867),
width=3712,
height=3712,
)

slicer = create_slicer(src_area, dest_area)
# Should not raise any error
slicer.get_slices()


class TestSwathSlicer(unittest.TestCase):
"""Test the get_slice function when input is a swath."""
Expand Down
Loading