我有一个带有以下内容的 netCDF 文件。ncdump:
netcdf nc_data {
dimensions:
lon = 1440 ;
bounds = 2 ;
lat = 720 ;
time = UNLIMITED ; // (6 currently)
variables:
double lon_bounds(lon, bounds) ;
double lat_bounds(lat, bounds) ;
int time(time) ;
time:units = "year as %Y.%f" ;
time:calendar = "proleptic_gregorian" ;
time:long_name = "time" ;
time:standard_name = "time" ;
time:axis = "T" ;
float lat(lat) ;
lat:units = "degrees_north" ;
lat:long_name = "latitude" ;
lat:standard_name = "latitude" ;
lat:axis = "Y" ;
lat:bounds = "lat_bounds" ;
float lon(lon) ;
lon:units = "degrees_east" ;
lon:long_name = "longitude" ;
lon:standard_name = "longitude" ;
lon:axis = "X" ;
lon:bounds = "lon_bounds" ;
float valf(time, lat, lon) ;
valf: standard_name = “area_fraction”
valf:missing_value = -9999.f ;
valf:_fillvalue = -9999.f ;
valf:long_name = "val fraction" ;
valf:units = "fraction of grid cell" ;
}
是否有 nco 命令将所有变量和维度从 int/float 转换为 double ?
我找到了这个:
ncap2 -s 'valf=double(valf)' nc_data.nc nc_data.nc
但是,这一次只能使用一个变量,我的文件中有大约 30 个变量