Skip to content

Commit

Permalink
Cleanup styling in ami_l1b reader more
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Jul 19, 2024
1 parent 92c5526 commit 7d13544
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions satpy/readers/ami_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def get_orbital_parameters(self):
}
return orbital_parameters


def get_dataset(self, dataset_id, ds_info):
"""Load a dataset as a xarray DataArray."""
file_key = ds_info.get("file_key", dataset_id["name"])
Expand Down Expand Up @@ -238,7 +237,6 @@ def get_dataset(self, dataset_id, ds_info):
data.attrs = attrs
return data


def _clip_negative_radiance(self, data, gain, offset):
"""If requested, clip negative radiance from Rad DataArray."""
if self.clip_negative_radiances:
Expand All @@ -247,7 +245,6 @@ def _clip_negative_radiance(self, data, gain, offset):
count_pos = np.floor(count_zero_rad)
min_rad = count_pos * gain + offset
data = data.clip(min=min_rad)
return data
return data

def _calibrate_ir(self, dataset_id, data):
Expand All @@ -261,10 +258,9 @@ def _calibrate_ir(self, dataset_id, data):
bt_data = rad2temp(wn, data.data * 1e-5)
if isinstance(bt_data, np.ndarray):
# old versions of pyspectral produce numpy arrays
data.data = da.from_array(bt_data, chunks=data.data.chunks)
else:
# new versions of pyspectral can do dask arrays
data.data = bt_data
bt_data = da.from_array(bt_data, chunks=data.data.chunks)

Check warning on line 261 in satpy/readers/ami_l1b.py

View check run for this annotation

Codecov / codecov/patch

satpy/readers/ami_l1b.py#L261

Added line #L261 was not covered by tests
# new versions of pyspectral can do dask arrays
data.data = bt_data
else:
# IR coefficients from the file
# Channel specific
Expand Down

0 comments on commit 7d13544

Please sign in to comment.