cdms2.forecast:forecasts

forecasts.reduce_inplace(min_time, max_time, openclosed='co')[source]

Reduce Inplace

Example

For a forecasts object f, f( min_time, max_time ) will reduce the scope of f, to forecasts whose start time t has min_time<=t<max_time. This is done in place, i.e. any other forecasts in f will be discarded. If slice notation were possible for forecasts (it’s not because we need too many bits to represent time), this function would do the same as f = f[min_time : max_time ]

The optional openclosed argument lets you specify the treatment of the endpoints min_time, max_time. The first character should be ‘c’ if you want to include min_time in the new scope of f, or ‘o’ to exclude it. Similarly, the second character should be ‘c’ to include max_time or ‘o’ to exclude it. Thus ‘co’ yields the default min_time<=t<max_time and ‘oo’ yields min_time<t<max_time.

If you don’t want to change the original “forecasts” object, just do copy.copy(forecasts) first.

Times can be the usual long integers, strings, or cdtime component times.