nco

Define a new dimension to one of the variables in netCDF file

本秂侑毒 提交于 2021-02-18 07:23:11
问题 I have a NetCDF file which include lots of variables (1d, 2d, 3d, and 4d). I want to add a new dimension to one of the 3d variables. To make it more clear, suppose: I have a 3d variable: A(d1, d2, d3) I want to have 4d variable: A(d1, d2, d3, d4) In fact, d4 is the new dimension which I would like to add to my variable. I do not have d4 in my file. I know it has just one value. I would appreciate that if anyone guide me. 回答1: Using NCO: ncap2 -s 'defdim("d4",737);A_new[$d1,$d2,$d3,$d4]=A' in

add a new variable to a netcdf file that increases with time nco

邮差的信 提交于 2021-02-11 08:51:03
问题 I want to add a new variable to an existing netcdf file which simply increases linearly with the time variable of file, that is to say, on the first time slice the variable has the number 1 everywhere, on the second timeslice it is set to 2, etc. I know how to open the file in python or fortran and define and add the variable and write out the modified file, but I was hoping that there might be a quick and easy way to do this from the command line using nco . I also wondered if I could do it

convert all the variables and dimensions from int/float to double in netcdf file

只谈情不闲聊 提交于 2021-02-10 22:31:42
问题 I have a netCDF file with the foll. 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" ;

convert all the variables and dimensions from int/float to double in netcdf file

无人久伴 提交于 2021-02-10 22:30:50
问题 I have a netCDF file with the foll. 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" ;

convert all the variables and dimensions from int/float to double in netcdf file

懵懂的女人 提交于 2021-02-10 22:30:15
问题 I have a netCDF file with the foll. 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" ;

convert all the variables and dimensions from int/float to double in netcdf file

无人久伴 提交于 2021-02-10 22:29:52
问题 I have a netCDF file with the foll. 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" ;

Concatenate netcdf files with different variables - using nco

吃可爱长大的小学妹 提交于 2021-02-10 11:48:41
问题 I want to concatenate two sets of netcdf files using nco , where each set has about 30 files. Set 1 contains: longitude, latitude, time and v. Set 2 contains: longitude, latitude, time and u. I have tried: ncks *.nc out.nc but I get: Error received 97 filenames; need no more than two then I tried: ncks -A *.nc out.nc but the error persists: Error received 97 filenames; need no more than two Please can you point me in the right direction, I am quite new to this. Thanks in advance. 回答1: Your

Concatenate netcdf files with different variables - using nco

允我心安 提交于 2021-02-10 11:48:31
问题 I want to concatenate two sets of netcdf files using nco , where each set has about 30 files. Set 1 contains: longitude, latitude, time and v. Set 2 contains: longitude, latitude, time and u. I have tried: ncks *.nc out.nc but I get: Error received 97 filenames; need no more than two then I tried: ncks -A *.nc out.nc but the error persists: Error received 97 filenames; need no more than two Please can you point me in the right direction, I am quite new to this. Thanks in advance. 回答1: Your

Concatenate netcdf files with different variables - using nco

爷,独闯天下 提交于 2021-02-10 11:48:08
问题 I want to concatenate two sets of netcdf files using nco , where each set has about 30 files. Set 1 contains: longitude, latitude, time and v. Set 2 contains: longitude, latitude, time and u. I have tried: ncks *.nc out.nc but I get: Error received 97 filenames; need no more than two then I tried: ncks -A *.nc out.nc but the error persists: Error received 97 filenames; need no more than two Please can you point me in the right direction, I am quite new to this. Thanks in advance. 回答1: Your

NetCDF : set variable as constant in time

你说的曾经没有我的故事 提交于 2021-02-10 06:34:28
问题 I am dealing with netCDF files with the following structure : netcdf YYY { dimensions: Time = UNLIMITED ; // (XXX currently) lat = XX ; lon = XX ; variables: double U_p_500hPa(Time, lat, lon) ; U_p_500hPa:units = "m/s" ; U_p_500hPa:_FillValue = -9999. ; U_p_500hPa:description = "U at 500hPa" ; U_p_500hPa:PlotLevelID = "500 hPa" ; float XLAT(Time, lat, lon) ; XLAT:FieldType = 104 ; XLAT:MemoryOrder = "XY " ; XLAT:description = "LATITUDE, SOUTH IS NEGATIVE" ; XLAT:units = "degree_north" ; XLAT