craterpy icon indicating copy to clipboard operation
craterpy copied to clipboard

Return array of data values underlying zonal statistics

Open ghentr opened this issue 4 months ago • 2 comments

In addition to the function to plot pixel values (e.g., in cdb.plot_rois), it would be great if we could have a function that could return an array of those actual data values, in case we want to do something other than compute the zonal statistics. (PS: I don't know how to add the "feature request" label to this issue!)

ghentr avatar Sep 15 '25 22:09 ghentr

I've thought of adding this too but it could be memory-intensive depending on the size of the ROIs and resolution of the data (probably don't want to read in 100 20GB images into RAM as numpy arrays). Could you give an example of the somethings you may want to do so we can figure out a good way to provide access ? E.g. do you just need a flat list of data points, a 2D np array, a new georeferenced sub-image file, etc

cjtu avatar Sep 17 '25 00:09 cjtu

Yes, makes sense. My immediate need is for the data from annuli of various sizes. I'm currently using the rasterio mask function with annuli defined using craterpy (via geojson), which I implemented after sending the feature request; and it works. This might obviate the need for the feature.

ghentr avatar Sep 17 '25 22:09 ghentr