netcdf

Change grid size of a netCDF file

折月煮酒 提交于 2021-02-19 03:19:19
问题 Let's assume I have 2 netCDF data files with data for the same region (like South America, Africa, etc) but the different grid sizes as 0.5 degrees x 0.5 degrees and 1.0 degrees x 1.0 degrees in another. I want to increase or decrease its grid size to a different value such as 0.25 x 0.25 or 1.0 x 1.0 so that I can use this easily for raster calculations and comparison, etc. Is there a method to do this using any bash script, CDO, etc. A sample data can be downloaded from here. https://www

Change grid size of a netCDF file

谁说我不能喝 提交于 2021-02-19 03:18:57
问题 Let's assume I have 2 netCDF data files with data for the same region (like South America, Africa, etc) but the different grid sizes as 0.5 degrees x 0.5 degrees and 1.0 degrees x 1.0 degrees in another. I want to increase or decrease its grid size to a different value such as 0.25 x 0.25 or 1.0 x 1.0 so that I can use this easily for raster calculations and comparison, etc. Is there a method to do this using any bash script, CDO, etc. A sample data can be downloaded from here. https://www

Change grid size of a netCDF file

。_饼干妹妹 提交于 2021-02-19 03:18:37
问题 Let's assume I have 2 netCDF data files with data for the same region (like South America, Africa, etc) but the different grid sizes as 0.5 degrees x 0.5 degrees and 1.0 degrees x 1.0 degrees in another. I want to increase or decrease its grid size to a different value such as 0.25 x 0.25 or 1.0 x 1.0 so that I can use this easily for raster calculations and comparison, etc. Is there a method to do this using any bash script, CDO, etc. A sample data can be downloaded from here. https://www

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

NetCDF Library Linkage on Windows with cmake

怎甘沉沦 提交于 2021-02-11 14:01:23
问题 I'm trying to include/link the NetCDF C library (https://www.unidata.ucar.edu/software/netcdf/docs/index.html) into my C++/CUDA project with cmake. I seem to be running into issues, though. I am on Windows 10 and have installed the NetCDF C libraries for Windows, version 4.7. Including the NetCDF libraries seems to go without a hitch, the problem is in the linking step. My code that uses the NetCDF library: netcdf_writer.cpp #ifndef __CUDACC__ //only actually include the NetCDF libraries if

NetCDF Library Linkage on Windows with cmake

风流意气都作罢 提交于 2021-02-11 13:57:49
问题 I'm trying to include/link the NetCDF C library (https://www.unidata.ucar.edu/software/netcdf/docs/index.html) into my C++/CUDA project with cmake. I seem to be running into issues, though. I am on Windows 10 and have installed the NetCDF C libraries for Windows, version 4.7. Including the NetCDF libraries seems to go without a hitch, the problem is in the linking step. My code that uses the NetCDF library: netcdf_writer.cpp #ifndef __CUDACC__ //only actually include the NetCDF libraries if

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" ;