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 22, 2023
1 parent 58fc223 commit e547e75
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 e547e75

Please sign in to comment.