Skip to content

Commit

Permalink
Drop x and y
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdawn committed Apr 14, 2020
1 parent d0f8fc3 commit 89709fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions satpy/readers/tropomi_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ def get_dataset(self, ds_id, ds_info):
if np.issubdtype(data.dtype, np.integer):
new_fill = fill_value
else:
if np.issubdtype(data.dtype, np.datetime64):
new_fill = np.datetime64('NaT')
else:
new_fill = np.float32(np.nan)
new_fill = np.float32(np.nan)
data.attrs.pop('_FillValue', None)
good_mask = data != fill_value

Expand All @@ -227,6 +224,9 @@ def get_dataset(self, ds_id, ds_info):

data = data.where(good_mask, new_fill)
data = self._rename_dims(data)
# drop x and y because the units are not meters
if all(coord in data.coords for coord in ['y', 'x']):
data = data.drop(['y', 'x'])
if ds_id.name in ['assembled_lat_bounds', 'assembled_lon_bounds']:
data = self.prepare_geo(data)
return data

0 comments on commit 89709fc

Please sign in to comment.