nwm_metrics.event_metric_functions.preprocess_series#

nwm_metrics.event_metric_functions.preprocess_series(y)[source]#

Resample to hourly and interpolate short gaps.

Resample the input series to hourly frequency using forward fill, then linearly interpolate gaps of up to 5 hours in length. This ensures a continuous hourly time series for event detection while avoiding excessive interpolation over long gaps.

Return type:

Series

Parameters:

y – Input time series with arbitrary frequency and potential missing values.

Returns:

A time series resampled to hourly frequency with short gaps interpolated.