About percetile with 5 day window
Added by Michael Akin over 1 year ago
Hello everyone,
I am trying to compute "when a JJA daily temperature (1980–2018: "Daily_temp_1980–2018.nc") exceeds its 90th percentile. The calendar-
day percentiles is computed using a fixed climatological period (1981–2010: "Daily_temp_1981–2010.nc") with a 5-day window centered on each calendar day."
I did the following"
#-- compute the 90th percentile for 1981–2010 with a 5-day window centered on each calendar day.
cdo -timselmin,5 Daily_temp_1981–2010.nc minout.nc
cdo -timselmax,5 Daily_temp_1981–2010.nc maxout.nc
cdo -timselpctl,90,5 Daily_temp_1981–2010.nc minout.nc maxout.nc Temp_90percentile.nc
- when daily 1980–2018 temperature exceed the 90th percentile
cdo gt Daily_temp_1980-2018.nc Temp_90percentile.nc output.nc
But I get this error: "cdo gt (Abort): Input streams have different number of timesteps!"
Truly the two datasets have different timesteps" "Daily_temp_1980-2018.nc" has 3,582 timesteps and "Temp_90percentile.nc" has 570 timesteps.
Please, how do I resolve this problem?
By the way,I have used this code: "cdo -timpctl,90 Daily_temp_1981–2010.nc -timselmin,5 Daily_temp_1981–2010.nc -timselmax,5 Daily_temp_1981–2010.nc Temp_90percentile.nc," which outputs a single timestep, but I don't think my result is accurate using "timpctl" instead of timselpctl."
I have attached my dataset and would appreciate your assistance.
Thank you.
Daily_temp_1980–2018.nc (65.3 MB) Daily_temp_1980–2018.nc | JJA Daily_temp_1980–2018 | ||
Daily_temp_1981–2010.nc (51.9 MB) Daily_temp_1981–2010.nc | JJA Daily_temp_1981–2010 |
Replies (3)
RE: About percetile with 5 day window - Added by Karin Meier-Fleischer over 1 year ago
Hi Michael,
the dates 1988-08-15 to 1988-08-20 are missing in the file Daily_temp_1980–2018.nc. This will always cause an error or warning. Please, upload a correct file otherwise we can't help.
RE: About percetile with 5 day window - Added by Karin Meier-Fleischer over 1 year ago
The file names have long hyphens, which is unusual in the Linux world. It took me a while to figure out why I was getting a 'file not found' message.
But nevertheless I think you are looking for something like this:
cdo -ydrunpctl,90,5 Daily_temp_1981–2010.nc \ -ydrunmin,5 Daily_temp_1981–2010.nc \ -ydrunmax,5 Daily_temp_1981–2010.nc \ Temp_90percentile.nc cdo -gtc,0 -sub Daily_temp_1980–2018.nc Temp_90percentile.nc output.nc
RE: About percetile with 5 day window - Added by Michael Akin over 1 year ago
Thank you so much Karin, I appreciate it.