|
@@ -380,6 +380,7 @@ def calculate_point(comb_df: pd.DataFrame, runs_df: pd.DataFrame, compton_df: pd
|
|
|
}, res_df
|
|
|
|
|
|
|
|
|
+ comb_df = comb_df.reset_index()
|
|
|
df = comb_df.loc[~comb_df.compton_start.isna()].copy()
|
|
|
df.spread_std = np.where(df.spread_std < 1e-4, 1e-4, df.spread_std)
|
|
|
|
|
@@ -387,7 +388,9 @@ def calculate_point(comb_df: pd.DataFrame, runs_df: pd.DataFrame, compton_df: pd
|
|
|
mean_energy = np.sum(df.e_mean*df.luminosity/(df.e_std**2))/np.sum(df.luminosity/(df.e_std**2))
|
|
|
|
|
|
good_criterion = np.abs((df.e_mean - mean_energy)/np.sqrt(df.e_mean.std(ddof=0)**2 + df.e_std**2)) < 5
|
|
|
+ # print('WTF:', df[~good_criterion].index)
|
|
|
df = df[good_criterion]
|
|
|
+ df['accepted'] = 1
|
|
|
|
|
|
averages = averager(df)
|
|
|
|
|
@@ -406,7 +409,7 @@ def calculate_point(comb_df: pd.DataFrame, runs_df: pd.DataFrame, compton_df: pd
|
|
|
|
|
|
comb_df['accepted'] = 0
|
|
|
comb_df.loc[df.index, 'accepted'] = 1
|
|
|
- return res_dict, comb_df
|
|
|
+ return res_dict, comb_df.set_index('point_idx')
|
|
|
|
|
|
def process_intersected_compton_meas(combined_df: pd.DataFrame) -> pd.DataFrame:
|
|
|
"""Replaces compton measurements writed on the border of two energy points on NaNs
|