"ydaysub" in daily anomalies for a year
Added by Brian Yalle almost 4 years ago
Hi,
I'm not expert in climate but I want to obtain daily anomalies for one specific year (2017) from 30-year long period (1981-2010). In other words, anomalies for each day of 2017 year which comes from the difference between daily values reported in 2017 and mean values of 1981-2010 period.
- t2m_daily_2017.nc
- t2m_daily_1981-2010.nc
Looking some posts in this forum and the CDO documentation, I found the ydaysub operator and tried to replicate:cdo ydaysub t2m_daily_2017.nc -ydaymean t2m_daily_1981-2010.nc daily-anomaly_2017.nc
I'd like to know this is right code or not, and how it can be improved/changed.
Thanks in advance
Brian
Replies (3)
RE: "ydaysub" in daily anomalies for a year - Added by Ralf Mueller almost 4 years ago
hi Brian!
cdo ydaysub t2m_daily_2017.nc -ydaymean t2m_daily_1981-2010.nc daily-anomaly_2017.nc
looks good to me.
if you want to get more familiar with these operators it might help to play around with them using artificial time series data. I often use something like this
cdo -infov -settaxis,2001-01-01,12:00:00,1days -expr,'seq=seq/seq' -seq,1,365 t.ncas a basis. It creates a one-year time series of daily values of 1.0. you can adapt the time unit
1days
to the operators you are interested in and the part with -expr,'seq=seq/seq'
can be extended to create special values which will ease the verification of what operators like yhoursum
or ydaymean
do in your application.
hth
ralf
RE: "ydaysub" in daily anomalies for a year - Added by Brian Yalle almost 4 years ago
Thanks Ralf for your answer!
RE: "ydaysub" in daily anomalies for a year - Added by Brian Yalle over 3 years ago
If I just want to obtain the mean daily values for an entire year considering the 30-year period (1981-2010), the code would be like:cdo ydaymean t2m_daily_1981-2010.nc t2m_daily_mean_30year.nc
?