Skip to content

Commit

Permalink
Change name of private method
Browse files Browse the repository at this point in the history
  • Loading branch information
gerritholl committed Jul 21, 2023
1 parent 369ea33 commit f9b400a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions satpy/readers/iasi_l2_eps.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,22 @@ class EPSIASIL2FileHandler(BaseFileHandler):
"""

# TODO:
# - make dask-friendly / lazy
# - only read variables that are requested
# - make it faster

_nc = None

def get_dataset(self, dataid, dataset_info):
"""Get dataset."""
if self._nc is None:
self._nc = self._get_netcdf_dataset()
self._nc = self._get_xarray_dataset()

Check warning on line 62 in satpy/readers/iasi_l2_eps.py

View check run for this annotation

Codecov / codecov/patch

satpy/readers/iasi_l2_eps.py#L62

Added line #L62 was not covered by tests
data = self._nc[dataid["name"]]
with xr.set_options(keep_attrs=True):
data = xr.where(data != np.iinfo(data.dtype).max, data, np.nan)
data = data * data.attrs.pop("scale_factor", 1)
return data

def _get_netcdf_dataset(self):
"""Get full NetCDF dataset."""
def _get_xarray_dataset(self):
"""Get full xarray dataset."""
input_product = self.filename
descriptor = epsnative_reader.assemble_descriptor("IASISND02")
ipr_sequence = epsnative_reader.read_ipr_sequence(input_product)
Expand All @@ -84,12 +83,10 @@ def _get_netcdf_dataset(self):

def available_datasets(self, configured_datasets):
"""Get available datasets."""
# FIXME: do this without converting/reading the file — maybe hardcode
# still?
common = {"file_type": "iasi_l2_eps", "resolution": 12000,
"coordinates": ["lon", "lat"]}
if self._nc is None:
self._nc = self._get_netcdf_dataset()
self._nc = self._get_xarray_dataset()
for var in self._nc.data_vars:
yield (True, {"name": var} | common | self._nc[var].attrs)

Expand Down

0 comments on commit f9b400a

Please sign in to comment.