Skip to content

Commit

Permalink
Merge pull request #2700 from djhoese/bugfix-delayed-epsl1b
Browse files Browse the repository at this point in the history
Fix eps_l1b reader Delayed usage causing docs failures
  • Loading branch information
mraspaud committed Dec 18, 2023
2 parents e638f9d + 9707e70 commit 989d9f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def __getattr__(cls, name):
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"dask": ("https://docs.dask.org/en/latest", None),
"geoviews": ("http://geoviews.org", None),
"geoviews": ("https://geoviews.org", None),
"jobqueue": ("https://jobqueue.dask.org/en/latest", None),
"numpy": ("https://numpy.org/doc/stable", None),
"pydecorate": ("https://pydecorate.readthedocs.io/en/stable", None),
Expand All @@ -287,7 +287,7 @@ def __getattr__(cls, name):
"pyresample": ("https://pyresample.readthedocs.io/en/stable", None),
"pytest": ("https://docs.pytest.org/en/stable/", None),
"python": ("https://docs.python.org/3", None),
"scipy": ("http://scipy.github.io/devdocs", None),
"scipy": ("https://scipy.github.io/devdocs", None),
"trollimage": ("https://trollimage.readthedocs.io/en/stable", None),
"trollsift": ("https://trollsift.readthedocs.io/en/stable", None),
"xarray": ("https://xarray.pydata.org/en/stable", None),
Expand Down
15 changes: 8 additions & 7 deletions satpy/readers/eps_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def _get_full_lonlats_uncached(self):
def _interpolate(self, lons_like, lats_like):
nav_sample_rate = self["NAV_SAMPLE_RATE"]
if nav_sample_rate == 20 and self.pixels == 2048:
lons_like_1km, lats_like_1km = self._interpolate_20km_to_1km(lons_like, lats_like)
lons_like_1km, lats_like_1km = _interpolate_20km_to_1km(lons_like, lats_like)
lons_like_1km = da.from_delayed(lons_like_1km, dtype=lons_like.dtype,
shape=(self.scanlines, self.pixels))
lats_like_1km = da.from_delayed(lats_like_1km, dtype=lats_like.dtype,
Expand All @@ -224,12 +224,6 @@ def _interpolate(self, lons_like, lats_like):
" and earth views = " +
str(self.pixels))

@delayed(nout=2, pure=True)
def _interpolate_20km_to_1km(self, lons, lats):
# Note: delayed will cast input dask-arrays to numpy arrays (needed by metop20kmto1km).
from geotiepoints import metop20kmto1km
return metop20kmto1km(lons, lats)

def _get_full_angles(self, solar_zenith, sat_zenith, solar_azimuth, sat_azimuth):

nav_sample_rate = self["NAV_SAMPLE_RATE"]
Expand Down Expand Up @@ -403,3 +397,10 @@ def end_time(self):
"""Get end time."""
# return datetime.strptime(self["SENSING_END"], "%Y%m%d%H%M%SZ")
return self._end_time


@delayed(nout=2, pure=True)
def _interpolate_20km_to_1km(lons, lats):
# Note: delayed will cast input dask-arrays to numpy arrays (needed by metop20kmto1km).
from geotiepoints import metop20kmto1km
return metop20kmto1km(lons, lats)

0 comments on commit 989d9f0

Please sign in to comment.