Skip to content

Commit

Permalink
Fix scale and offset application when only one is available. (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkinsspatial authored Oct 24, 2022
1 parent 9106708 commit 71a8362
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stackstac/rio_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,9 @@ def read(self, window: Window, **kwargs) -> np.ndarray:

if self.rescale:
scale, offset = reader.scale_offset
if scale != 1 and offset != 0:
if scale != 1:
result *= scale
if offset != 0:
result += offset

result = result.astype(self.dtype, copy=False)
Expand Down

0 comments on commit 71a8362

Please sign in to comment.