olympicSmoothing()

Signature:

olympic_moving_average(
    window: int,
    only_valid: bool,
    use_reduced: bool,
    in_place: bool = False
) -> TimeSeries

Detailed Documentation

The hec-python-library equivalent of Jython method olympicSmoothing():

Computes and returns a time series that is the olympic moving average of this time series.

An olympic moving average sets the value at each time to be the average of the values at that time and a number of previous and following consecutive times, disregarding the minimum and maximum values in the range to average over.

If in_place=True, the instance itself is modified. In this case the returned value (which can be ignored in python) is the modified instance, which can be used in chaining methods.

Example:

avg_ts = ts.olympic_moving_average(
    7,     # average over 7 values at each time step
    True,  # ignore invalid values when averaging
    True   # use less than 7 values a start and end
)

Signature:

iolympic_moving_average(
    window: int,
    only_valid: bool,
    use_reduced: bool,
) -> TimeSeries

Convenience method for executing olympic_moving_average(...) with in_place=True.

Example:

ts.iolympic_moving_average(
    7,     # average over 7 values at each time step
    True,  # ignore invalid values when averaging
    True   # use less than 7 values a start and end
)