9 blacklist = [
"LI_S01_C_M4",
"LI_S03_A_M4",
"LI_S05_C_M4",
"LI_S11_A_M4",
"LI_S12_A_M4",
"LI_S13_C_M4"]
11 indir =
"/eos/atlas/user/j/jdickins/Pixel/LeakageCurrent/IBLData/processedData/means/"
12 header = [
"unix-timestamp",
"HV_VMeas",
"start",
"intlumi",
"HV_VSet",
"volume",
"HV_VMeas_0",
"HV_VMeas_1",
"PP4LV",
"TModule",
"HV_IMeas",
"ENV_TT",
"I_Eg1.12",
"I_Eg1.21",
"I_Eg1.30"]
14 df_concat = pd.DataFrame({})
16 for stave
in range(1,15):
17 staveString =
str(stave)
19 staveString=
"0"+
str(stave)
20 m =
"LI_S" +
str(staveString) +
"_" + suffix
22 this_infile = indir + m +
".ssv"
24 print(m +
" is blacklisted. Skipping...")
27 this_infile = indir +
"LI_S" +
str(staveString) +
"_" + suffix +
".ssv"
28 this_df = pd.read_csv(this_infile, names=header, delimiter=
',', skiprows=1)
29 df_concat = df_concat.append(this_df)
31 df_avg = df_concat.groupby(df_concat.index).
mean()
32 df_avg = df_avg[[
"intlumi",
"I_Eg1.12",
"I_Eg1.21",
"I_Eg1.30"]]
37 saveFileName = indir + suffix +
".ssv"
38 if os.path.exists(saveFileName):
39 os.remove(saveFileName)
40 df_avg.to_csv(saveFileName,index=
False)
54 if __name__ ==
"__main__":