diff --git a/rdtools/soiling.py b/rdtools/soiling.py index 554f06b8..8d1e7b47 100644 --- a/rdtools/soiling.py +++ b/rdtools/soiling.py @@ -341,8 +341,8 @@ def _calc_result_df(self, trim=False, max_relative_slope_error=500.0, max_negati "run_slope_high": 0, "max_neg_step": min(run.delta), "start_loss": 1, - "inferred_start_loss": run.pi_norm.median(), # changed from mean/Matt - "inferred_end_loss": run.pi_norm.median(), # changed from mean/Matt + "inferred_start_loss": np.nan if run.pi_norm.isna().any() else run.pi_norm.median(), # changed from mean/Matt + "inferred_end_loss": np.nan if run.pi_norm.isna().any() else run.pi_norm.median(), # changed from mean/Matt "slope_err": 10000, # added high dummy start value for later logic/Matt "valid": False, "clean_event": run.clean_event.iloc[0], # record of clean events to distiguisih