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 SCMI writer not writing fill values properly #456

Merged
merged 2 commits into from
Oct 11, 2018
Merged
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
8 changes: 4 additions & 4 deletions satpy/readers/clavrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ def get_dataset(self, dataset_id, ds_info):
if dataset_id.resolution:
data.attrs['resolution'] = dataset_id.resolution
data.attrs = self.get_metadata(data, ds_info)
fill = data.attrs.get('_FillValue')
factor = data.attrs.get('scale_factor')
offset = data.attrs.get('add_offset')
valid_range = data.attrs.get('valid_range')
fill = data.attrs.pop('_FillValue', None)
factor = data.attrs.pop('scale_factor', None)
offset = data.attrs.pop('add_offset', None)
valid_range = data.attrs.pop('valid_range', None)

if factor is not None and offset is not None:
def scale_inplace(data):
Expand Down
2 changes: 1 addition & 1 deletion satpy/writers/scmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def set_image_data(self, data, fill_value):
LOG.info('writing image data')
# note: autoscaling will be applied to make int16
assert(hasattr(data, 'mask'))
self.image_data[:, :] = np.require(data.filled(fill_value), dtype=np.float32)
self.image_data[:, :] = np.require(data, dtype=np.float32)

def set_projection_attrs(self, area_id, proj4_info):
"""
Expand Down