Averaging Monthly Time Series into a Seasonal Time Series

Help
John
2013-11-27
2013-11-27
  • John
    John
    2013-11-27

    I need to convert monthly temperature data into seasonal averages (seasonal time series). I would do that by calculating a seasonal average for individual years, like this:

    ncra -d time,2,4 in.nc 1950_00.nc // 1950 spring
    ncra -d time,5,7 in.nc 1950_01.nc // 1950 summer
    ncra -d time,8,10 in.nc 1950_02.nc // 1950 fall
    ncra -d time,11,13 in.nc 1950_03.nc // 1950 winter
    ncra -d time,14,16 in.nc 1950_00.nc // 1951 spring
    ...

    I'd actually use a bash script to write the above as a loop.

    I would then concatenate the individual season files into a single time series:

    ncrcat 19??_??.nc seasonal_temperatures.nc

    Is there a way to do this in one step, without having to concatenate?

    Thanks....

     
  • Charlie Zender
    Charlie Zender
    2013-11-27

    This can be done without looping, in 4 commands (one per season), as explained
    at the link I mentioned in your previous post today.

    http://nco.sf.net/nco.html#drn

    cz

     
  • John
    John
    2013-11-27

    Doh! You are right. The --mro option will do the trick. I missed that on my first reading.
    Thank you.

     
  • Charlie Zender
    Charlie Zender
    2013-11-27

    well done.

    cz