2

I have a set of point locations (point feature dataset) and a netCDF file containing 30 years of daily precipitation data.

My goal is to randomly select a precipitation value in the time dimension at each point location and write it to a table. For raster datasets, this can be accomplished by using the extract values to points tool or the extract multi values to points tool within ArcMap.

Is there a way to modify the python code for any of these tools to accomplish a random sample in the time dimension, or does anybody know of any other feasible approaches?

3

In R you should be able to access the netcdf file directly with library(ncdf4) and do something like:

library(ncdf4)
nc=nc_open('filename.nc')
data_series=ncvar_get(nc,'precip',start=c(1,27,33),count=(-1,1,1))
sample(data_series,50)

... assuming that your point location of interest is stored in (:,27,33), and that time is the first dimension.

Matlab has similar features.

1

I was able to figure out my problem. It is not ideal, but it works.

  1. Use the "make NetCDF Raster layer" tool in the multidimensional toolbox to convert the netCDF into a raster layer. Under "band dimensions", choose the time dimension. This will create x number of bands corresponding to each time step.

  2. Use the "multi values to points" tool to extract the data values from all bands at the desired point location.

  3. Export table to matlab or R to create a random sample.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.