Menu

#8 aggregating daily to monthly data

open
nobody
None
5
2012-12-10
2008-06-30
Anonymous
No

I was wondering if there is a cdat/python tool to aggregate a netCDF file with daily data to one with monthly average data. The monthly data should be a monthly time series, not climatology or averages over the entire file. I have spent a while looking through the documentation and these support pages, but I don't see anything. Before writing my own, I wanted to be sure it wasn't out there already, and it seems like a pretty ordinary task that others must have done before.

Thanks,
Ed

Discussion

  • Nobody/Anonymous

    Logged In: NO

    did you try cdutil.times.ANNUALCYCLE(data)

     
  • Ed M.

    Ed M. - 2008-07-01

    Logged In: YES
    user_id=2131747
    Originator: NO

    Thanks for the suggestion. It looks to me like cdutil.times.ANNUALCYCLE returns a climatology, but I would like to feed in, say, 100 years of daily air temperatures, and get back 100 years of monthly average air temperatures (1200 time steps). It's not clear whether the ANNUALCYCLE command will take daily as an input and produce monthly as output, but if it does I could write a script to loop through the daily file extracting one year at a time, calculate the climatology for each year, and create a new time axis onto which I can then concatenate the 100 "climatologies." I was just imagining that there would already be a tool that does this, that's smart enough to catch different calendars (365 vs 360 day years and so on).

    Ed

     
  • Ed M.

    Ed M. - 2008-07-09

    Logged In: YES
    user_id=2131747
    Originator: NO

    Holy cow! cdutil.times.ANNUALCYCLE(data)does what I wanted. The documentation seemed to say differently, but it does seem to work perfectly and create a timeseries. Thanks!

     

Log in to post a comment.