Questions tagged [cdo-climate]

Climate Data Operators (CDO) is a collection of command line Operators to manipulate and analyse gridded datasets in the supported data formats of netCDF 3/4, GRIB 1/2, SERVICE, EXTRA and IEG. There are more than 600 operators available. Many functions are generic (spatial/temporal means, variances, regridding, trends, EOF, covariances, correlations) while others are aimed particularly at analyzing climate and weather data (e.g. seasonal statistics).

Climate Data Operators (CDO) is a collection of command line Operators to manipulate and analyse gridded datasets in the supported data formats of GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG. There are more than 600 operators available. While many of these functions are general (spacial and temporal statistics such as averages and variance, regridding, subsetting, concatenating etc), Many functions are particularly aimed analysing climate and numerical weather prediction model data. Full documentation is available at https://code.mpimet.mpg.de/projects/cdo/

325 questions
5
votes
2 answers

Extracting only bottom temperature from 4d NetCDF file

I have a NetCDF file for ocean temperature. It has 1 variable ('temp') and 4 dimensions (time, lon, lat, and depth). I would like to extract temperature only at maximum depth for each time, lon, and lat to obtain a bottom sea temperature raster…
zoek
  • 141
  • 1
  • 7
5
votes
2 answers

Change grid size of a netCDF file

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…
Ep1c1aN
  • 683
  • 9
  • 25
5
votes
1 answer

How to calculate the area of each grid cell?

I have gridded data of air temperature with the spatial resolution 1.25 x 1.25 degrees (lon-lat). The data covers the Northern Hemisphere, and the first latitude is 90 degrees. I need to calculate the area of each grid cell, and my approach is to do…
5
votes
3 answers

subtracting variables within two different netcdf files

I have two netcdf files: downwelling radiation named rsds.nc and confined radiation named rsns.nc. rsds.nc contains a variable named rsds and rsns.nc contains a variable named rsns. Now I would like to have the upwelling radiation rsus.nc by…
David Halley
  • 417
  • 3
  • 6
  • 18
5
votes
5 answers

clipping data - setting values below a threshold to the threshold in a netcdf file

I want to set all values below a constant c to c itself in a netcdf file: file.nc A solution using climate data operators (CDO) would be cdo mul -gec,$c file.nc file.nc t1.nc cdo add -mulc,$c -ltc,$c file.nc t1.nc output.nc rm -f t1.nc But is there…
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
5
votes
2 answers

Extract data from grib weather model

I have downloaded grib1 model data from GFS, I am using a Mac OS X and was able to build the wgrib2 file from NOAA but was unable to extract the data. I have not found a grib1 utility for MAC. Then I run to this program…
neavilag
  • 609
  • 1
  • 8
  • 20
5
votes
3 answers

Overwriting specific cells in netcdf

Is there a netcdf operator (from nco or any python netcdf library) which can be used to overwrite specific cells in a netcdf file? I want to change the values of a small region in a netcdf file containing global climate data. thanks!
user308827
  • 21,227
  • 87
  • 254
  • 417
5
votes
3 answers

How to change the resolution (or regrid) data in R

I have a dataset consisting of lon, lat and a monthly mean variable (e.g. temperature or precipitation) covering 1961 to 1970. The dataset is at a resolution of 0.5 by 0.5 degree lon/lat and covers the whole globe and was downloaded as an .NC file…
AntonyDW
  • 349
  • 5
  • 17
4
votes
3 answers

Merging multiple Netcdf files according to the vertical level

I have 34 netCDF (nc) files containing latitude, longitude, and the data in every file. Every filename containing a number which corresponds to the Pressure level in hPa (starts from 1 to 34 for respective pressure level from (1000 hPa to 0.4 hPa).…
Krishnaap
  • 297
  • 3
  • 18
4
votes
1 answer

How to merge/ combine time variable in multiple netcdf

I have a lot of Sea Surface Temperature NetCDF files with the same lat and lon dimensions, but different time variables. I want to try to combine it into 1 NetCDF file by combining the time variables because the time variables in each netcdf file…
ExHunter
  • 307
  • 4
  • 11
4
votes
2 answers

extract data from netcdf file contained within a shapefile's boundaries

I have the following shapefile and netcdf file. I would like to extract data from the netcdf file that are contained within the boundaries of the shapefile. Do you have any suggestion on how I can achieve this? The shapefile corresponds to SREX…
aaaaa
  • 149
  • 2
  • 18
  • 44
4
votes
2 answers

Convert NetCDF depth from Float to Double

I have a couple hundred NetCDF files that I want to process through a geospatial analysis tool, however the tool requires the depth variable to be a double, and it is currently a float. I have found the below article convert all the variables and…
Laura808
  • 41
  • 1
  • 3
4
votes
2 answers

add a new counter index variable to a netcdf file that increases with time

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…
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
4
votes
2 answers

How to identify each file of origin when concatinating many netcdf files with ncrcat?

I am concatenating 1000s of nc-files (outputs from simulations) to allow me to handle them more easily in Matlab. To do this I use ncrcat. The files have different sizes, and the time variable is not unique between files. The concatenate works…
4
votes
2 answers

How to calculate total precipitation per day using hourly data for whole year?

I have hourly data from ERA5 for each day in a specific year. I want to convert that data from hourly to daily. I know the long and hard way to do it, but I need something which does that easily. Copernicus has a code for this here…
Ep1c1aN
  • 683
  • 9
  • 25
1
2
3
21 22