spencerahill / aospy

Python package for automated analysis and management of gridded climate data
Apache License 2.0
83 stars 12 forks source link

Enable optional loading of "halo" time points #290

Open spencerahill opened 6 years ago

spencerahill commented 6 years ago

I want to compute a time tendency of some field, say temperature, over some month, say, April, and compute the climatology of that by averaging that across all years, using monthly data. This is straightforward: just centered difference within each year using the data from March and May.

However, since I would specify the output_time_intervals as 4, aospy will drop all other months of the year before passing the data to my function, and as such this centered differencing within each year is impossible. Essentially what I need is to retain the "halo" points of March and May within each year.

Perhaps a simpler way of achieving the same thing is simply to have the option of extracting the desired month after the function call. This technically incurs a performance hit, since in this example 11/12ths of the data that is computed (i.e. all months except April) then gets dropped. But for an initial implementation, this seems to me likely outweighed by the coding simplicity.