Skip to content

Commit

Permalink
Need to clip data before scaling to 8 bit value, before writing enhan…
Browse files Browse the repository at this point in the history
…ced values to mitiff
  • Loading branch information
Trygve Aspenes committed Apr 10, 2019
1 parent ff45d3f commit c44b982
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion satpy/writers/mitiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def _save_datasets_as_mitiff(self, datasets, image_description,
img = get_enhanced_image(datasets.squeeze(), enhance=self.enhancer)
for i, band in enumerate(img.data['bands']):
chn = img.data.sel(bands=band)
data = chn.values * 254. + 1
data = chn.values.clip(0, 1) * 254. + 1
data = data.clip(0, 255)
tif.write_image(data.astype(np.uint8), compression='deflate')

Expand Down

0 comments on commit c44b982

Please sign in to comment.