We have a netCDF file with 3040 bands. I want to clip the NetCDF file with a shapefile and get the average value for each band. We would like to do in in ArcGIS Pro, QGIS, Python, or R.
Maybe this doesn't really answer your question since it uses ArcMap instead of ArcGIS Pro. The script appears to be working (not done running), but the layer needs to be added to ArcMap first and then the dimension needs to be set in layer properties (Right click on layer in the Table of Contents --> Properties --> NetCDF tab).
That particular script didn't work for me, but I found something that did via model builder in ArcMap. Most models seem to upgrade alright to Pro so my guess is that this approach will work in Pro. 1. First, build a model in ModelBuilder that uses the Make NetCDF Raster Layer followed by the CopyRaster tool. By specifying the band dimension as time this set up the raster layer to be a multiband raster. The tool ran kicking out a raster with 1300 bands which can be viewed by clicking on the layer in the contents window. Each band can be viewed individually in ArcMap/Pro by dragging it into the data frame. The second model takes the multiband raster and splits it into individual bands. Using the For iterator I set the From parameter to 1 and the To parameter to equal the number of bands. The By value can remain as the default 1. Next, I drag in the multiband raster and use the parse paths tool to get the path and the name from the input raster. Finally, I run the Copy Raster Tool (you could use Extract by Mask to get it to match a polygon) setting the input as %path%\%name%.tif\Band_%Value%. I set the output as E:\temp\empty\%name%%Value%Band%n%.tif. This generates a folder of rasters named raster_nc1Band1.tif, raster_nc1Band2.tif, etc.