terraref / computing-pipeline

Pipeline to Extract Plant Phenotypes from Reference Data
BSD 3-Clause "New" or "Revised" License
21 stars 13 forks source link

Clip hyperspectral data to plot #606

Open dlebauer opened 4 years ago

dlebauer commented 4 years ago

Output from hyperspectral pipeline needs to be clipped to plots

the netcdf operators (nco) library can do this, e.g. to clip a box around Champaign, IL from a global weather data set I used:

ncks -O -d longitude,-88.9,-87.5 -d latitude,39.8,40.5 all.nc champaign.nc

The hyperspectral data have dimensions x and y (rather than latitude and longitude) so it would look like

ncks -O -d x,xmin,xmax -d y,ymin,ymax full_strip.nc plot_clip.nc

And if it helps there is a python client for NCO https://github.com/nco/pynco