Skip to content

Commit

Permalink
Consider the data mask when creating raster from numpy input
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA committed Aug 23, 2023
1 parent ff56f1a commit 2b7e84e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ocsmesh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,8 @@ def raster_from_numpy(
crs=crs,
transform=transform,
) as dst:
if isinstance(data, np.ma.MaskedArray):
dst.nodata = data.fill_value
dst.write(data, 1)


Expand Down

0 comments on commit 2b7e84e

Please sign in to comment.