简体   繁体   English

从netCDF维度中减去值

[英]Subtract value from netCDF dimension

How can I use nco tools or any other netcdf toolkit to subtract a specific value from one of the dimensions in a netCDF? 如何使用nco工具或任何其他netcdf工具包从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: 如何从时间维度的每个值中减去10,这样最终结果是:

time = 0, 1, 2, 3 …

Nothing is more concise than ncap2 for this: 没有什么比ncap2更为简洁了:

ncap2 -s 'time-=10' in.nc out.nc ncap2 -s'时间-= 10'in.nc out.nc

ncap2 will subtract any value except 13, because that would bring bad luck. ncap2将减去13以外的任何值,因为这会带来厄运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM