File tree Expand file tree Collapse file tree
async_packager/src/cumulus_packager/writers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,7 +122,11 @@ def writer(
122122 data = raster .ReadAsArray (resample_alg = gdal .gdalconst .GRIORA_Bilinear )
123123 # Flip the dataset up/down because tif and dss have different origins
124124 data = numpy .flipud (data )
125-
125+ DSS_UNDEFINED_VALUE = - 3.4028234663852886e+38
126+ data = numpy .array (data , dtype = numpy .float64 )
127+ numpy .putmask (
128+ data , data == nodata , numpy .nan
129+ ) # Replace nodata with NaN for processing
126130 # GeoTransforma and lower X Y
127131 xsize = warp_ds .RasterXSize
128132 ysize = warp_ds .RasterYSize
@@ -153,7 +157,7 @@ def writer(
153157 cellSize = cellsize ,
154158 xCoordOfGridCellZero = 0.0 ,
155159 yCoordOfGridCellZero = 0.0 ,
156- nullValue = nodata if nodata is not None else 0.0 ,
160+ nullValue = DSS_UNDEFINED_VALUE ,
157161 data = data ,
158162 )
159163
You can’t perform that action at this time.
0 commit comments