Commit 01f4a7ab authored by feichtinger's avatar feichtinger
Browse files

added CALCT based models to calibration data, tested on new data

parent 13b71006
This diff is collapsed.
......@@ -25,7 +25,10 @@ import os
datadir = 'pavledata'
#filename='test1.h5'
filename='MLData_20200520_1.h5'
#filename='MLData_20200520_1.h5' # problematic - scale seems off
#filename='MLData_20200527_1.h5'
filename='MLData_20200603_1.h5'
# -
......@@ -158,6 +161,26 @@ df.isna().count()
#sns.pairplot(df[['CALCT', 'CALCS', 'Ephot','Voltage_s','Voltage_t','PEPavg']])
# -
# # Model tests
#
# I use here the models with the parameter fits from the calibration data sheet "swissfell-gas-phys-ansatz"
# ## Model 1: EM gain model for CALCS
# function factory for these models
def mk_pep_pred_fn1(A, B):
return lambda calcs, voltage, ebeam: (1/6.241509e12) * ebeam * calcs / (A * np.power(voltage, B))
popt1 = [-8.12506079e-29, 6.54642197e+00]
pep_pred_fn1 = mk_pep_pred_fn1(popt1[0], popt1[1])
fig,ax = plt.subplots(figsize=(12,6))
ax.plot(pep_pred_fn1(df.CALCS, df.Voltage_s, df.Ephot))
# ## Model 2: semi-empirical (from CALCS, XeMultVoltage, Ebeam)
# function factory for these models
def mk_pep_pred_fn2(A, B, C):
return lambda calcs, voltage, ebeam: (1/6.241509e12) * ebeam * calcs / (1 + C * ebeam) / (A * np.power(voltage, B))
......@@ -180,3 +203,32 @@ df.loc[df.CALCS == df.CALCS.max(), ['CALCS','PEPavg','Voltage_s','Ephot']]
df.loc[df.CALCS == df.CALCS.min(), ['CALCS','PEPavg','Voltage_s','Ephot']]
# ## Model 3: EM gain model for CALCT
# function factory for these models
def mk_pep_pred_fn3(A, B):
return lambda calct, voltage, ebeam: (1/6.241509e12) * ebeam * calct / (A * np.power(voltage, B))
popt3 = [-1.64860845e-32, 7.55659496e+00]
pep_pred_fn3 = mk_pep_pred_fn3(popt3[0], popt3[1])
fig,ax = plt.subplots(figsize=(12,6))
ax.plot(pep_pred_fn3(df.CALCT, df.Voltage_t, df.Ephot))
# ## Model 4: semi-empirical (from CALCT, XeMultVoltage, Ebeam)
# function factory for these models
def mk_pep_pred_fn4(A, B, C):
return lambda calcs, voltage, ebeam: (1/6.241509e12) * ebeam * calcs / (1 + C * ebeam) / (A * np.power(voltage, B))
popt4 = [-9.75073300e-35, 8.43836707e+00, -8.13896675e-05]
pep_pred_fn4 = mk_pep_pred_fn4(popt4[0], popt4[1], popt4[2])
fig,ax = plt.subplots(figsize=(12,6))
ax.plot(pep_pred_fn4(df.CALCT, df.Voltage_t, df.Ephot))
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment