diff --git a/rdtools/soiling.py b/rdtools/soiling.py index 04c1d012..56f05c29 100644 --- a/rdtools/soiling.py +++ b/rdtools/soiling.py @@ -185,9 +185,8 @@ def _calc_daily_df(self, day_scale=13, clean_threshold="infer", recenter=True, # step, slope change detection # 1/6/24 Note several errors in soiling fit due to ffill for rolling # median change to day_scale/2 Matt - #df_ffill = df.copy() - #df_ffill = df.ffill(limit=int(round((day_scale / 2), 0))) - df_ffill = df.fillna(method='ffill', limit=day_scale).copy() + df_ffill = df.copy() + df_ffill = df.ffill(limit=int(round((day_scale / 2), 0))) # Calculate rolling median df["pi_roll_med"] = df_ffill.pi_norm.rolling(day_scale, center=True).median() @@ -2953,4 +2952,4 @@ def segmented_soiling_period( # Create Series from modelled profile sr = pd.Series(z, index=pr.index) - return sr, cp_date \ No newline at end of file + return sr, cp_date