xcdat icon indicating copy to clipboard operation
xcdat copied to clipboard

[Feature]: Support Climatology bounds

Open chengzhuzhang opened this issue 4 years ago • 4 comments

Feature request copied from @golaz:

Is your feature request related to a problem? If yes, Please describe

Climatology files have a special type of time bounds:

    double climatology_bounds(time, nbnd) ;
            climatology_bounds:long_name = "time interval endpoints" ;
            climatology_bounds:units = "days since 0001-01-01 00:00:00" ;
            climatology_bounds:calendar = "noleap" ;

While they look like regular bounds, they are more subtle. For more details, see :http://cfconventions.org/cf-conventions/cf-conventions.html

dimensions:
  time=4;
  nv=2;
variables:
  float temperature(time,lat,lon);
    temperature:long_name="surface air temperature";
    temperature:cell_methods="time: minimum within years time: mean over years";
    temperature:units="K";
  double time(time);
    time:climatology="climatology_bounds";
    time:units="days since 1960-1-1";
  double climatology_bounds(time,nv);
data:  // time coordinates translated to date/time format
  time="1960-4-16", "1960-7-16", "1960-10-16", "1961-1-16" ;
  climatology_bounds="1960-3-1",  "1990-6-1",
                     "1960-6-1",  "1990-9-1",
                     "1960-9-1",  "1990-12-1",
                     "1960-12-1", "1991-3-1" ;

Focusing on the first set of bounds: "1960-3-1", "1990-6-1"

The climatology spans the years 1960 to 1990 (inclusive), and the months of March, April, May.

It would be best if xCDAT could handle regular time series bounds, as well as climatology bounds transparently. There will be a need for an auxiliary function that computes the time span between the bounds (to use as weights for time averaging). It’s doable, but a little trickier for climatology bounds.

One additional complexity is that climatology bounds can also apply to diurnal averages.

We want to be able to perform time averaging operations on climatology data just like regular time series data. For example:

  • Average 10 yr climo into 50 yr climo.

  • Average monthly climo into seasonal or annual.

  • Average hourly diurnal climo into 6-hourly diurnal climo.

  • Etc.

If xCDAT is designed in a flexible manner from the on-set, all of that becomes possible without any special treatment. If not, it will be a pain to add later (and lead to a more convoluted and harder to maintain code.

chengzhuzhang avatar Jul 16 '21 22:07 chengzhuzhang

@chengzhuzhang @tomvothecoder I see this is still a low priority. Can we briefly discuss this at the next meeting?

gleckler1 avatar Jun 07 '22 23:06 gleckler1

Sure @gleckler1, I added this item to the agenda

tomvothecoder avatar Jun 07 '22 23:06 tomvothecoder

Notes from meeting (6/22):

  • Peter will try to work with Karl and Jiwoo to develop some code for this, we will then be reviewed and adapted for xCDAT.

tomvothecoder avatar Jul 20 '22 16:07 tomvothecoder

http://cfconventions.org/cf-conventions/cf-conventions.html#cell-boundaries

tomvothecoder avatar Feb 28 '24 18:02 tomvothecoder