Hi,
I am trying to create a 5th and 95th percentile raster from a geodatabase containing multiple rasters (ranging from 26-60 rasters per .gdb). Essentially, I would like to perform the same function as cell stats (mean, max, median, etc) but calculating percentiles rather than simple stats. I've seen a few threads on this matter (this one in particular seems useful: Pool of raster values to calculate percentile) but none that seem to address how to do make an output percentile raster using rasters located in a .gdb. I haven't begun developing the code yet and wanted to solicit answers to these questions before beginning. A few questions:
1. Is there a tool that can do this or will I need to develop Python code using numpy?
2. Is it easier to do this with rasters located inside a folder or can I perform this calculation with rasters located in a .gdb?
Any help would be greatly appreciated. Thanks!
Solved! Go to Solution.
with numpy, there is np.nanpercentile which accounts for nodata cells
How to calculate the percentile for each cell from timeseries raster
A raster stack (3D) can be easily created
/blogs/dan_patterson/2018/02/06/cell-statistics-made-easy-raster-data-over-time
and any statistic can be done.
If you have a ridiculously large data set, then it would be useful to split into chunks and read from a *.npy file using numpy memory management.
As for your questions, the tools to make the raster stack are given in your thread.
Rasters in a gdb are not really the preferred rasters, but if that is all you have, just make sure you specify an output raster as a tif in a folder. I would also np.save(…) your array in numpy format, they are very easy to work with for future work.
with numpy, there is np.nanpercentile which accounts for nodata cells
How to calculate the percentile for each cell from timeseries raster
A raster stack (3D) can be easily created
/blogs/dan_patterson/2018/02/06/cell-statistics-made-easy-raster-data-over-time
and any statistic can be done.
If you have a ridiculously large data set, then it would be useful to split into chunks and read from a *.npy file using numpy memory management.
As for your questions, the tools to make the raster stack are given in your thread.
Rasters in a gdb are not really the preferred rasters, but if that is all you have, just make sure you specify an output raster as a tif in a folder. I would also np.save(…) your array in numpy format, they are very easy to work with for future work.
resolved? or still open?