TDCRPy 2.7.0__py3-none-any.whl → 2.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of TDCRPy might be problematic. Click here for more details.
- tdcrpy/TDCR_model_lib.py +95 -45
- tdcrpy/config.toml +2 -0
- {tdcrpy-2.7.0.dist-info → tdcrpy-2.8.0.dist-info}/METADATA +1 -1
- {tdcrpy-2.7.0.dist-info → tdcrpy-2.8.0.dist-info}/RECORD +7 -7
- {tdcrpy-2.7.0.dist-info → tdcrpy-2.8.0.dist-info}/WHEEL +0 -0
- {tdcrpy-2.7.0.dist-info → tdcrpy-2.8.0.dist-info}/licenses/LICENCE.md +0 -0
- {tdcrpy-2.7.0.dist-info → tdcrpy-2.8.0.dist-info}/top_level.txt +0 -0
tdcrpy/TDCR_model_lib.py
CHANGED
|
@@ -62,6 +62,7 @@ def readParameters(disp=False):
|
|
|
62
62
|
micCorr = config["Inputs"].getboolean("micCorr")
|
|
63
63
|
alphaDir = config["Inputs"].getfloat("alphaDir")
|
|
64
64
|
effQuantic = config["Inputs"].getfloat("effQuantum")
|
|
65
|
+
optionModel = config["Inputs"].getfloat("optionModel")
|
|
65
66
|
|
|
66
67
|
if disp:
|
|
67
68
|
print(f"number of integration bins for electrons = {nE_electron}")
|
|
@@ -80,13 +81,14 @@ def readParameters(disp=False):
|
|
|
80
81
|
print(f"acqueous fraction = {fAq}")
|
|
81
82
|
print(f"alpha parameter of the hidden Dirichlet process = {alphaDir}")
|
|
82
83
|
print(f"quantum efficiency of the photocathodes = {effQuantic}")
|
|
84
|
+
print(f"Monte Carlo model of the optics = {optionModel}")
|
|
83
85
|
print(f"coincidence resolving time = {tau} ns")
|
|
84
86
|
print(f"extended dead time = {extDT} µs")
|
|
85
87
|
print(f"measurement time = {measTime} min")
|
|
86
88
|
|
|
87
|
-
return nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, effQuantic, pH,pC,pN,pO,pP,pCl
|
|
89
|
+
return nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, effQuantic, optionModel, pH,pC,pN,pO,pP,pCl
|
|
88
90
|
|
|
89
|
-
nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, effQuantic, pH,pC,pN,pO,pP,pCl = readParameters()
|
|
91
|
+
nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, effQuantic, optionModel, pH,pC,pN,pO,pP,pCl = readParameters()
|
|
90
92
|
|
|
91
93
|
p_atom = np.array([pH,pC,pN,pO,pP,pCl]) # atom abondance in the scintillator
|
|
92
94
|
p_atom /= sum(p_atom)
|
|
@@ -209,6 +211,12 @@ def modifyEffQ(x):
|
|
|
209
211
|
data1 = data0.replace(f"effQuantum = {x0}",f"effQuantum = {x}")
|
|
210
212
|
writeConfifAsstr(data1)
|
|
211
213
|
|
|
214
|
+
def modifyOptModel(x):
|
|
215
|
+
data0 = readConfigAsstr()
|
|
216
|
+
x0 = readParameters()[16]
|
|
217
|
+
data1 = data0.replace(f"optionModel = {x0}",f"optionModel = {x}")
|
|
218
|
+
writeConfifAsstr(data1)
|
|
219
|
+
|
|
212
220
|
def read_temp_files(copy=False, path="C:"):
|
|
213
221
|
|
|
214
222
|
temp_dir = tempfile.gettempdir()
|
|
@@ -3020,7 +3028,7 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
|
|
|
3020
3028
|
return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
|
|
3021
3029
|
|
|
3022
3030
|
|
|
3023
|
-
def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime, dir_param = alphaDir, effQuantic = effQuantic):
|
|
3031
|
+
def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime, dir_param = alphaDir, effQuantic = effQuantic, optionModel=optionModel):
|
|
3024
3032
|
"""
|
|
3025
3033
|
Calculate detection probabilities for LS counting systems - see Broda, R., Cassette, P., Kossert, K., 2007. Radionuclide metrology using liquid scintillation counting. Metrologia 44. https://doi.org/10.1088/0026-1394/44/4/S06
|
|
3026
3034
|
|
|
@@ -3079,79 +3087,121 @@ def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, me
|
|
|
3079
3087
|
n_e = np.zeros(3); n_eCN = np.zeros(2); n_e2 = np.zeros(3); n_e2CN = np.zeros(2)
|
|
3080
3088
|
|
|
3081
3089
|
if symm:
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3090
|
+
if optionModel == "poisson-multinomial-binomial":
|
|
3091
|
+
n_ph = np.random.poisson(sum(np.asarray(e_quenching))*L/mu)
|
|
3092
|
+
# TDCR
|
|
3093
|
+
n_phPMT = np.random.multinomial(n_ph, dirichTD)
|
|
3094
|
+
n_e[0]=np.random.binomial(n_phPMT[0],mu)
|
|
3095
|
+
n_e[1]=np.random.binomial(n_phPMT[1],mu)
|
|
3096
|
+
n_e[2]=np.random.binomial(n_phPMT[2],mu)
|
|
3097
|
+
# C/N
|
|
3098
|
+
n_phPMTCN = np.random.multinomial(n_ph, dirichCN)
|
|
3099
|
+
n_eCN[0]=np.random.binomial(n_phPMTCN[0],mu)
|
|
3100
|
+
n_eCN[1]=np.random.binomial(n_phPMTCN[1],mu)
|
|
3101
|
+
elif optionModel == "poisson":
|
|
3102
|
+
n_e[0] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichTD[0])
|
|
3103
|
+
n_e[1] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichTD[1])
|
|
3104
|
+
n_e[2] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichTD[2])
|
|
3105
|
+
n_eCN[0] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichCN[0])
|
|
3106
|
+
n_eCN[1] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichCN[1])
|
|
3107
|
+
else:
|
|
3108
|
+
print("unknown model")
|
|
3109
|
+
|
|
3088
3110
|
if sum(n_e>1)>0: efficiency0_S =1
|
|
3089
3111
|
if sum(n_e>1)>1: efficiency0_D =1
|
|
3090
3112
|
if sum(n_e>1)>2: efficiency0_T =1
|
|
3091
3113
|
if n_e[0]>1 and n_e[1]>1: efficiency0_AB =1
|
|
3092
3114
|
if n_e[1]>1 and n_e[2]>1: efficiency0_BC =1
|
|
3093
3115
|
if n_e[0]>1 and n_e[2]>1: efficiency0_AC =1
|
|
3094
|
-
|
|
3095
|
-
n_phPMT = np.random.multinomial(n_ph, dirichCN)
|
|
3096
|
-
n_eCN[0]=np.random.binomial(n_phPMT[0],mu)
|
|
3097
|
-
n_eCN[1]=np.random.binomial(n_phPMT[1],mu)
|
|
3098
|
-
if sum(n_e>1)>1: efficiency0_D2 =1
|
|
3116
|
+
if sum(n_eCN>1)>1: efficiency0_D2 =1
|
|
3099
3117
|
|
|
3100
|
-
if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3118
|
+
if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
|
|
3119
|
+
if optionModel == "poisson-multinomial-binomial":
|
|
3120
|
+
n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*L/mu)
|
|
3121
|
+
# TDCR
|
|
3122
|
+
n_phPMT2 = np.random.multinomial(n_ph2, dirichTD)
|
|
3123
|
+
n_e2[0]=np.random.binomial(n_phPMT2[0],mu)
|
|
3124
|
+
n_e2[1]=np.random.binomial(n_phPMT2[1],mu)
|
|
3125
|
+
n_e2[2]=np.random.binomial(n_phPMT2[2],mu)
|
|
3126
|
+
# C/N
|
|
3127
|
+
n_phPMT2CN = np.random.multinomial(n_ph2, dirichCN)
|
|
3128
|
+
n_e2CN[0]=np.random.binomial(n_phPMT2CN[0],mu)
|
|
3129
|
+
n_e2CN[1]=np.random.binomial(n_phPMT2CN[1],mu)
|
|
3130
|
+
elif optionModel == "poisson":
|
|
3131
|
+
n_e2[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichTD[0])
|
|
3132
|
+
n_e2[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichTD[1])
|
|
3133
|
+
n_e2[2] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichTD[2])
|
|
3134
|
+
n_e2CN[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichCN[0])
|
|
3135
|
+
n_e2CN[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichCN[1])
|
|
3136
|
+
else:
|
|
3137
|
+
print("unknown model")
|
|
3138
|
+
|
|
3139
|
+
|
|
3107
3140
|
if sum(n_e2>1)>0: efficiency0_S +=1
|
|
3108
3141
|
if sum(n_e2>1)>1: efficiency0_D +=1
|
|
3109
3142
|
if sum(n_e2>1)>2: efficiency0_T +=1
|
|
3110
3143
|
if n_e2[0]>1 and n_e2[1]>1: efficiency0_AB +=1
|
|
3111
3144
|
if n_e2[1]>1 and n_e2[2]>1: efficiency0_BC +=1
|
|
3112
3145
|
if n_e2[0]>1 and n_e2[2]>1: efficiency0_AC +=1
|
|
3113
|
-
# C/N
|
|
3114
|
-
n_phPMT2 = np.random.multinomial(n_ph2, dirichCN)
|
|
3115
|
-
n_e2CN[0]=np.random.binomial(n_phPMT2[0],mu)
|
|
3116
|
-
n_e2CN[1]=np.random.binomial(n_phPMT2[1],mu)
|
|
3117
3146
|
if sum(n_e2CN>1)>1: efficiency0_D2 +=1
|
|
3118
3147
|
|
|
3119
3148
|
else: # asym
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3149
|
+
if optionModel == "poisson-multinomial-binomial":
|
|
3150
|
+
Lm = np.mean(L)
|
|
3151
|
+
n_ph = np.random.poisson(sum(np.asarray((e_quenching))*Lm/mu))
|
|
3152
|
+
# TDCR
|
|
3153
|
+
n_phPMT = np.random.multinomial(n_ph, [L[0]*dirichTD[0]/Lm, L[1]*dirichTD[1]/Lm, L[2]*dirichTD[2]/Lm])
|
|
3154
|
+
n_e[0]=np.random.binomial(n_phPMT[0],mu)
|
|
3155
|
+
n_e[1]=np.random.binomial(n_phPMT[1],mu)
|
|
3156
|
+
n_e[2]=np.random.binomial(n_phPMT[2],mu)
|
|
3157
|
+
# C/N
|
|
3158
|
+
n_phPMTCN = np.random.multinomial(n_ph, [L[0]/(2*Lm), L[1]/(2*Lm)])
|
|
3159
|
+
n_eCN[0]=np.random.binomial(n_phPMTCN[0],mu)
|
|
3160
|
+
n_eCN[1]=np.random.binomial(n_phPMTCN[1],mu)
|
|
3161
|
+
elif optionModel == "poisson":
|
|
3162
|
+
n_e[0] = np.random.poisson(sum(np.asarray(e_quenching))*L[0]*mu*dirichTD[0])
|
|
3163
|
+
n_e[1] = np.random.poisson(sum(np.asarray(e_quenching))*L[1]*mu*dirichTD[1])
|
|
3164
|
+
n_e[2] = np.random.poisson(sum(np.asarray(e_quenching))*L[2]*mu*dirichTD[2])
|
|
3165
|
+
n_eCN[0] = np.random.poisson(sum(np.asarray(e_quenching))*L[0]*mu*dirichCN[0])
|
|
3166
|
+
n_eCN[1] = np.random.poisson(sum(np.asarray(e_quenching))*L[1]*mu*dirichCN[1])
|
|
3167
|
+
else:
|
|
3168
|
+
print("unknown model")
|
|
3169
|
+
|
|
3127
3170
|
if sum(n_e>1)>0: efficiency0_S =1
|
|
3128
3171
|
if sum(n_e>1)>1: efficiency0_D =1
|
|
3129
3172
|
if sum(n_e>1)>2: efficiency0_T =1
|
|
3130
3173
|
if n_e[0]>1 and n_e[1]>1: efficiency0_AB =1
|
|
3131
3174
|
if n_e[1]>1 and n_e[2]>1: efficiency0_BC =1
|
|
3132
3175
|
if n_e[0]>1 and n_e[2]>1: efficiency0_AC =1
|
|
3133
|
-
# C/N
|
|
3134
|
-
n_phPMT = np.random.multinomial(n_ph, [L[0]/(2*Lm), L[1]/(2*Lm)])
|
|
3135
|
-
n_eCN[0]=np.random.binomial(n_phPMT[0],mu)
|
|
3136
|
-
n_eCN[1]=np.random.binomial(n_phPMT[1],mu)
|
|
3137
3176
|
if sum(n_eCN>1)>1: efficiency0_D2 =1
|
|
3138
3177
|
|
|
3139
3178
|
if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3179
|
+
if optionModel == "poisson-multinomial-binomial":
|
|
3180
|
+
n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*Lm/mu)
|
|
3181
|
+
# TDCR
|
|
3182
|
+
n_phPMT2 = np.random.multinomial(n_ph2, [L[0]*dirichCN[0]/Lm, L[1]*dirichCN[1]/Lm, L[2]*dirichCN[2]/Lm])
|
|
3183
|
+
n_e2[0]=np.random.binomial(n_phPMT2[0],mu)
|
|
3184
|
+
n_e2[1]=np.random.binomial(n_phPMT2[1],mu)
|
|
3185
|
+
n_e2[2]=np.random.binomial(n_phPMT2[2],mu)
|
|
3186
|
+
# C/N
|
|
3187
|
+
n_phPMT2CN = np.random.multinomial(n_ph2, [L[0]/(2*Lm), L[1]/(2*Lm)])
|
|
3188
|
+
n_e2CN[0]=np.random.binomial(n_phPMT2CN[0],mu)
|
|
3189
|
+
n_e2CN[1]=np.random.binomial(n_phPMT2CN[1],mu)
|
|
3190
|
+
elif optionModel == "poisson":
|
|
3191
|
+
n_e2[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L[0]*mu*dirichTD[0])
|
|
3192
|
+
n_e2[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L[1]*mu*dirichTD[1])
|
|
3193
|
+
n_e2[2] = np.random.poisson(sum(np.asarray(e_quenching2))*L[2]*mu*dirichTD[2])
|
|
3194
|
+
n_e2CN[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L[0]*mu*dirichCN[0])
|
|
3195
|
+
n_e2CN[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L[1]*mu*dirichCN[1])
|
|
3196
|
+
else:
|
|
3197
|
+
print("unknown model")
|
|
3198
|
+
|
|
3146
3199
|
if sum(n_e2>1)>0: efficiency0_S +=1
|
|
3147
3200
|
if sum(n_e2>1)>1: efficiency0_D +=1
|
|
3148
3201
|
if sum(n_e2>1)>2: efficiency0_T +=1
|
|
3149
3202
|
if n_e2[0]>1 and n_e2[1]>1: efficiency0_AB +=1
|
|
3150
3203
|
if n_e2[1]>1 and n_e2[2]>1: efficiency0_BC +=1
|
|
3151
3204
|
if n_e2[0]>1 and n_e2[2]>1: efficiency0_AC +=1
|
|
3152
|
-
# C/N
|
|
3153
|
-
n_e2CN[0]=np.random.binomial(n_phPMT2[0],mu)
|
|
3154
|
-
n_e2CN[1]=np.random.binomial(n_phPMT2[1],mu)
|
|
3155
3205
|
if sum(n_e2CN>1)>1: efficiency0_D2 +=1
|
|
3156
3206
|
|
|
3157
3207
|
return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
|
tdcrpy/config.toml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
tdcrpy/TDCRPy.py,sha256=VIwZJHtpjBt5e87KUqatCC6eTMr2sFVRl52LAc3PZq8,67850
|
|
2
2
|
tdcrpy/TDCRPy1.py,sha256=QTBZh5B5JWnGB0BQfD-cFmwA9W080OD4sG-aj50-ejo,38106
|
|
3
|
-
tdcrpy/TDCR_model_lib.py,sha256=
|
|
3
|
+
tdcrpy/TDCR_model_lib.py,sha256=A48vTVqIVaAslYqE41b15Q_hsMpN5rNQZOf3JVNK6e0,136503
|
|
4
4
|
tdcrpy/TDCRoptimize.py,sha256=c2XIGveeLdVYYek4Rg6dygMvVA2xIrIkMb3L-_jUucM,6496
|
|
5
5
|
tdcrpy/__init__.py,sha256=9Djir8dPNchcJVQvhl-oRHEOsoDkiZlkOhWT-eHR7wQ,95
|
|
6
|
-
tdcrpy/config.toml,sha256=
|
|
6
|
+
tdcrpy/config.toml,sha256=Yg-MBlzxOYiovgVFWq6VtivPkzwyNeWBzwNTc7ADYkU,1634
|
|
7
7
|
tdcrpy/test2.py,sha256=poLLXJyIaCeqh1VSkwgbi-udvY7lQjxz_YStKjJXGhU,501
|
|
8
8
|
tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_C-14.txt,sha256=Eh3KaNbfYHakk_uStLu8K1aFciO6_i_rS2yKxGGppDE,8416
|
|
9
9
|
tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ca-45.txt,sha256=TymodcK4ttoO1duZuW3RGOwHFwPPzw2ESPc_H_QQN8k,8830
|
|
@@ -74,8 +74,8 @@ tdcrpy/docs/_build/html/source/modules.html,sha256=Jf-qxVBId0UgpwyvYuyjtMNG-ezPO
|
|
|
74
74
|
tdcrpy/docs/_build/html/source/tdcrpy.html,sha256=-38lHMNFB22p1tWJEeN3yDqfDiCYE304vxDamO1-iRc,3779
|
|
75
75
|
tdcrpy/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
tdcrpy/test/test_tdcrpy.py,sha256=JINqSEMFoNpptE4f3h6ZzTYW1rBx90KkaoQzltSg-No,4692
|
|
77
|
-
tdcrpy-2.
|
|
78
|
-
tdcrpy-2.
|
|
79
|
-
tdcrpy-2.
|
|
80
|
-
tdcrpy-2.
|
|
81
|
-
tdcrpy-2.
|
|
77
|
+
tdcrpy-2.8.0.dist-info/licenses/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
|
|
78
|
+
tdcrpy-2.8.0.dist-info/METADATA,sha256=DC9TjSh3dw67Jh_F9xMOjXUZAOgF5pyL8Rp7ClBeOzo,45298
|
|
79
|
+
tdcrpy-2.8.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
80
|
+
tdcrpy-2.8.0.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
|
|
81
|
+
tdcrpy-2.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|