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
1
vote
1 answer

Sum of subdaily precipitation data with cdo

I have been working with precipitation data from the IMERG satellite which is every 30 minutes. I have been building the precipitation between 12 UTC one day and 12 UTC the other day. cdo shifttime,-12hours -daysum -shifttime,12hours in.nc4…
1
vote
1 answer

How to correct Ref-time in nc file?

As it is shown in this image , my data starts from 1980-01-01 00:00:00. I would like my ref time to be the first time entry i.e. 1980-01-01. But instead the ref time is 1900-01-01 00:00:00. As the calendar is gregorian, i tried to change the…
1
vote
1 answer

How to use cdo climate command?

I want to subset a NetCDF file to extract a sub-period with cdo. I run the following code in spyder from cdo import * cdo = Cdo() cdo.select('startdate=2003-01-01,end_date=2016-12-31', input='PATH/temperature.nc', output='output.nc') I use spyder…
ele_al_12
  • 23
  • 6
1
vote
2 answers

combining 2 netcdf files with xarray along the time dimension

I tried to combine two netcdf files along the time dimension using this command. The first file ran 1 to 10 days and then the next one from 11 to 20 days. Time was recorded as year/month/days in the netcdf files. ds = xr.open_mfdataset([file1,…
Tarandeep Kalra
  • 357
  • 1
  • 4
  • 15
1
vote
0 answers

Creating Land Mask with randomPoints Error

I am trying to create a background land mask for my data. All of the questions I've seen are for CDO, which I cannot get to load into my R Studio (package ‘cdo’ is not available (for R version 4.0.2)). I am looking at shellfish data where the points…
amerray
  • 11
  • 1
1
vote
2 answers

pack/compress netcdf data ("add offset" and "scale factor") with CDO, NCO or similar

I have heavy netCDF files with floating 64-bits precision. I would like to pack using specific values for the add_offset and scale_factor parameters (so then I could transform to short I16 precision). I have found information for unpacking with CDO…
1
vote
1 answer

How to remove a "redundant" dimension with CDO (climate data operators)?

The ERA5 climate dataset is, in general, defined as a [lat, lon, time] matrix. Except for recent data, where it adds the exp_ver variable that indicate if the data is provisory (recent data, up to 3 months until the present, coded as "05") or old…
1
vote
1 answer

How to extract all timesteps except the specified timesteps from a netcdf file using cdo

We usually use 'cdo seltimestep' to select the days we want to extract from a netcdf file into an output file that includes only the days we specified. cdo seltimestep,6,10,11 2000-03.nc 03-days.nc but now we want to do the opposite, we want to…
1
vote
3 answers

bash - for loop through multiple directories and their files

I have 5 directories in the same path my_path/: my_path/1951 my_path/1952 my_path/1953 my_path/1954 my_path/1955 Each directory contains a different number of netcdf files ending in .nc. And I need to perform a CDO command by looping in each…
aaaaa
  • 149
  • 2
  • 18
  • 44
1
vote
2 answers

How to only select winter months of daily data in xarray?

I have gridded daily temperature data but am only interested in the winter months. from netCDF4 import Dataset as netcdf_dataset import numpy as np import xarray as xr #open NASA GISS gridded temperature netcdf file df =…
Megan Martin
  • 221
  • 1
  • 9
1
vote
1 answer

How to calculate variable for based on interval conditon using expr cdo-climate

I am trying to calculate fsa variable values based on two discrete conditions. In the end, I want one output file with variable fsa. The first condition is fsa equals 1 when tas is greater than 275.15. In the second condition, I want fsa to be equal…
Alemex
  • 145
  • 1
  • 1
  • 11
1
vote
3 answers

CDO - Resample netcdf files from monthly to daily timesteps

I have a netcdf file that has monthly global data from 1991 to 2000 (10 years). Using CDO, how can I modify the netcdf from monthly to daily timesteps by repeating the monthly values each day of each month? for eaxample, convert from Month 1, value…
aaaaa
  • 149
  • 2
  • 18
  • 44
1
vote
2 answers

Extract only 1 month from a multi-year netcdf file

I am quite new to programming and I wanted to know if you could help me. I have a file that contains daily precipitation data from 2000 to 2020. I think with pandas I could create a dataframe that contains only the values ​​of the month of January…
1
vote
2 answers

Extract multi value points using CDO into a single text file

I have come across the code cdo -outputtab, date,value -remapnn,lon=X/lat=Y infile.nc > Outfile.txt which very nicely extracts for a single point only. Is there any way I can extract time series data from netcdf file for multiple points using a…
1
vote
1 answer

Data values are outside the valid range using cdo daysum

I have an ERA5 nc file of hourly precipitation from March until October for a 30-year time span. The data is from midnight to noon local time (so 4 am to 4 pm in UTC time zone). I need to find the daily sum of precipitation up until noon for each…
Thomas
  • 441
  • 3
  • 16