How can I use nco tools or any other netcdf toolkit to subtract a specific value from one of the dimensions in a netCDF?
Eg
ncdump –v time –t file.nc
gives me:
time = 10, 11, 12, 13 …
How can I subtract 10 from each value in the time dimension so that the end result is:
time = 0, 1, 2, 3 …
Nothing is more concise than ncap2 for this:
ncap2 -s 'time-=10' in.nc out.nc
ncap2 will subtract any value except 13, because that would bring bad luck.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.