Saturday 21 April 2018

arcgis desktop - Raster to Numpy Array - No data values


I have several single band, 32 bit float raster datasets (fgdbr) that i want to use to build a raster stack (depth) in numpy by doing something like this dv = np.dstack((d_array, v_array))



With reference to the code snippet below,


import arcpy
d = r'P:\Sample.gdb\D_0100yr_Max'
dr = arcpy.Raster(d)
dr.minimum # returns 0.000562695786356926
dr.maximum # returns 2.8690600395202637
dr.noDataValue # prints nothing
dr.pixelType # returns F32

d_array = arcpy.RasterToNumPyArray(dr.catalogPath, "#", "#", "#", dr.noDataValue)


d_array.max() # returns 2.86906
d_array.min() # returns -3.4028231e+38

If dr.noDataValue prints nothing, where does the RasterToNumpyArray function read the no data value from such that d_array.min() returns -3.4028231e+38 ?


enter image description here




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...