TDCRPy 2.0.8__py3-none-any.whl → 2.1.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-2.0.8.dist-info → TDCRPy-2.1.0.dist-info}/METADATA +1 -1
- {TDCRPy-2.0.8.dist-info → TDCRPy-2.1.0.dist-info}/RECORD +7 -7
- {TDCRPy-2.0.8.dist-info → TDCRPy-2.1.0.dist-info}/WHEEL +1 -1
- tdcrpy/TDCRPy.py +87 -85
- tdcrpy/TDCR_model_lib.py +4 -6
- {TDCRPy-2.0.8.dist-info → TDCRPy-2.1.0.dist-info}/LICENCE.md +0 -0
- {TDCRPy-2.0.8.dist-info → TDCRPy-2.1.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
tdcrpy/TDCRPy.py,sha256=
|
|
1
|
+
tdcrpy/TDCRPy.py,sha256=34goCOwLLVcy0DTICESqp3HKDpBZb4KIKButqvJVtnk,64726
|
|
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=o7pMbr8IsnfzC4RIDRaZjQ_CY65HmcVSBEgPHLxNWRI,126529
|
|
4
4
|
tdcrpy/TDCRoptimize.py,sha256=c2XIGveeLdVYYek4Rg6dygMvVA2xIrIkMb3L-_jUucM,6496
|
|
5
5
|
tdcrpy/__init__.py,sha256=9Djir8dPNchcJVQvhl-oRHEOsoDkiZlkOhWT-eHR7wQ,95
|
|
6
6
|
tdcrpy/config.toml,sha256=d_olKEgxfobBHkZ2wEj9EgKE7I8Wbpim9ZAsi5ImFxk,1470
|
|
@@ -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.0.
|
|
78
|
-
TDCRPy-2.0.
|
|
79
|
-
TDCRPy-2.0.
|
|
80
|
-
TDCRPy-2.0.
|
|
81
|
-
TDCRPy-2.0.
|
|
77
|
+
TDCRPy-2.1.0.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
|
|
78
|
+
TDCRPy-2.1.0.dist-info/METADATA,sha256=aiKaQFl6lEJSMI_owXP9BZbi-EakzAsjEJqycj6rXG0,45040
|
|
79
|
+
TDCRPy-2.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
80
|
+
TDCRPy-2.1.0.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
|
|
81
|
+
TDCRPy-2.1.0.dist-info/RECORD,,
|
tdcrpy/TDCRPy.py
CHANGED
|
@@ -1129,98 +1129,100 @@ def eff(TD, Rad, pmf_1, kB, V, N=10000, L=1, maxiter=20, xatol=1e-7, disp=False)
|
|
|
1129
1129
|
return L0, L, eff_S, u_eff_S, eff_D, u_eff_D, eff_T, u_eff_T, eff_AB, u_eff_AB, eff_BC, u_eff_BC, eff_AC, u_eff_AC, eff_D2, u_eff_D2
|
|
1130
1130
|
|
|
1131
1131
|
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1132
|
+
def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False):
|
|
1133
|
+
"""
|
|
1134
|
+
Caclulation of the efficiency of a TDCR system based on the model TDCRPy (analytical model).
|
|
1135
|
+
This function includes optimization procedures from scipy.
|
|
1136
1136
|
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1137
|
+
Parameters
|
|
1138
|
+
----------
|
|
1139
|
+
TD : float or tuple
|
|
1140
|
+
measurements. If TD is float, then TD is the measured TDCR parameter. If TD is tuple, then TD must contain the global TDCR parameter followed by specific ones (T/B, T/AB, T/BC, T/AC)
|
|
1141
|
+
Rad : string
|
|
1142
|
+
List of radionuclides (eg. "H-3, Co-60").
|
|
1143
|
+
pmf_1 : string
|
|
1144
|
+
list of probability of each radionuclide (eg. "0.8, 0.2").
|
|
1145
|
+
kB : float
|
|
1146
|
+
Birks constant in cm/keV.
|
|
1147
|
+
V : float
|
|
1148
|
+
volume of the scintillator in ml.
|
|
1149
|
+
maxiter : interger, optional
|
|
1150
|
+
maximum number of iterations of the optimization procedures
|
|
1151
|
+
xatol : float
|
|
1152
|
+
convergence parameter of the Nelder Mead optimisation
|
|
1153
|
+
disp : Boolean
|
|
1154
|
+
to display detailed results of the procedure. Default is False.
|
|
1155
1155
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1156
|
+
Returns
|
|
1157
|
+
-------
|
|
1158
|
+
L0 : float
|
|
1159
|
+
global free parameter.
|
|
1160
|
+
L : tuple
|
|
1161
|
+
free parameters (relevant for the asymetric model).
|
|
1162
|
+
eff_S : float
|
|
1163
|
+
counting efficiency of single events.
|
|
1164
|
+
u_eff_S : float
|
|
1165
|
+
standard uncertainty of eff_S.
|
|
1166
|
+
eff_D : float
|
|
1167
|
+
counting efficiency of double coincidences.
|
|
1168
|
+
u_eff_D : float
|
|
1169
|
+
standard uncertainty of eff_D.
|
|
1170
|
+
eff_T : float
|
|
1171
|
+
counting efficiency of triple coincidences.
|
|
1172
|
+
u_eff_T : float
|
|
1173
|
+
standard uncertainty of eff_T.
|
|
1174
|
+
eff_AB : float
|
|
1175
|
+
counting efficiency of coincidences AB.
|
|
1176
|
+
u_eff_AB : float
|
|
1177
|
+
standard uncertainty of eff_AB.
|
|
1178
|
+
eff_BC : float
|
|
1179
|
+
counting efficiency of coincidences BC.
|
|
1180
|
+
u_eff_BC : float
|
|
1181
|
+
standard uncertainty of eff_BC.
|
|
1182
|
+
eff_AC : float
|
|
1183
|
+
counting efficiency of coincidences AC.
|
|
1184
|
+
u_eff_AC : float
|
|
1185
|
+
standard uncertainty of eff_AC.
|
|
1186
|
+
eff_D : float
|
|
1187
|
+
counting efficiency of double coincidences in C/N configuation (not relevant).
|
|
1188
|
+
u_eff_D : float
|
|
1189
|
+
standard uncertainty of eff_D in C/N configuation (not relevant).
|
|
1190
1190
|
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1191
|
+
"""
|
|
1192
|
+
if isinstance(TD, (tuple, list)):
|
|
1193
|
+
symm = False
|
|
1194
|
+
else:
|
|
1195
|
+
symm = True
|
|
1196
1196
|
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1197
|
+
if symm: r=opt.minimize_scalar(tl.modelAnalytical, args=(TD, TD, TD, TD, Rad, kB, V, "res", 1e3), method='bounded', bounds = (0.1, 5), options={'disp': disp, 'maxiter':maxiter})
|
|
1198
|
+
else: r=opt.minimize_scalar(tl.modelAnalytical, args=(TD[0], TD[1], TD[2], TD[3], Rad, kB, V, "res", 1e3), method='bounded', bounds = (0.1, 5), options={'disp': disp, 'maxiter':maxiter})
|
|
1199
|
+
L0=r.x
|
|
1200
|
+
L=(L0, L0, L0)
|
|
1201
|
+
print(f"global free parameter = {L0} keV-1")
|
|
1202
1202
|
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1203
|
+
if not symm:
|
|
1204
|
+
r=opt.minimize(tl.modelAnalytical, L, args=(TD[0], TD[1], TD[2], TD[3], Rad, kB, V, "res", 1e3), method='nelder-mead',options={'xatol': xatol, 'disp': disp, 'maxiter':maxiter})
|
|
1205
|
+
L=r.x
|
|
1206
|
+
print(f"free parameters = {L} keV-1")
|
|
1207
1207
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
#
|
|
1214
|
-
#
|
|
1215
|
-
#
|
|
1216
|
-
#
|
|
1217
|
-
#
|
|
1218
|
-
#
|
|
1219
|
-
#
|
|
1220
|
-
#
|
|
1221
|
-
#
|
|
1208
|
+
if symm: out=tl.modelAnalytical(L, TD, TD, TD, TD, Rad, kB, V, "eff", 1e3)
|
|
1209
|
+
else: out=tl.modelAnalytical(L, TD[0], TD[1], TD[2], TD[3], Rad, kB, V, "eff", 1e3)
|
|
1210
|
+
eff_S = out[0]
|
|
1211
|
+
eff_D = out[1]
|
|
1212
|
+
eff_T = out[2]
|
|
1213
|
+
# u_eff_S = out[1]
|
|
1214
|
+
# eff_D = out[2]
|
|
1215
|
+
# u_eff_D = out[3]
|
|
1216
|
+
# eff_T = out[4]
|
|
1217
|
+
# u_eff_T = out[5]
|
|
1218
|
+
# eff_AB = out[6]
|
|
1219
|
+
# u_eff_AB = out[7]
|
|
1220
|
+
# eff_BC = out[8]
|
|
1221
|
+
# u_eff_BC = out[9]
|
|
1222
|
+
# eff_AC = out[10]
|
|
1223
|
+
# u_eff_AC = out[11]
|
|
1222
1224
|
|
|
1223
|
-
|
|
1225
|
+
return L0, L, eff_S, eff_D, eff_T #, u_eff_T, eff_AB, u_eff_AB, eff_BC, u_eff_BC, eff_AC, u_eff_AC, u_eff_S, u_eff_D,
|
|
1224
1226
|
|
|
1225
1227
|
|
|
1226
1228
|
|
tdcrpy/TDCR_model_lib.py
CHANGED
|
@@ -132,7 +132,7 @@ def modifyAtmConc(x):
|
|
|
132
132
|
data0 = readConfigAsstr()
|
|
133
133
|
x0 = readParameters()[-6:]
|
|
134
134
|
data1 = data0.replace(f"pH = {x0[0]:.6f}",f"pH = {x[0]:.6f}")
|
|
135
|
-
data1 = data1.replace(f"pC = {x0[1]:.6f}",f"
|
|
135
|
+
data1 = data1.replace(f"pC = {x0[1]:.6f}",f"pC = {x[1]:.6f}")
|
|
136
136
|
data1 = data1.replace(f"pN = {x0[2]:.6f}",f"pN = {x[2]:.6f}")
|
|
137
137
|
data1 = data1.replace(f"pO = {x0[3]:.6f}",f"pO = {x[3]:.6f}")
|
|
138
138
|
data1 = data1.replace(f"pP = {x0[4]:.6f}",f"pP = {x[4]:.6f}") #
|
|
@@ -1277,7 +1277,7 @@ def Em_e(Ei, Ed, kB, nE, Et = Einterp_e*1e3, kB_vec = kB_e):
|
|
|
1277
1277
|
"""
|
|
1278
1278
|
if Ed <= Et or Ei != Ed:
|
|
1279
1279
|
# run the accurate quenching model
|
|
1280
|
-
r = E_quench_e(Ei,Ed,kB,nE)
|
|
1280
|
+
r = E_quench_e(Ei,Ed,kB,int(nE))
|
|
1281
1281
|
else:
|
|
1282
1282
|
# run interpolation
|
|
1283
1283
|
r = run_interpolate(kB_vec, kB , Ei_electron, Em_electron, Ed)
|
|
@@ -2648,7 +2648,7 @@ def relaxation_atom_ph(lacune,element,v):
|
|
|
2648
2648
|
|
|
2649
2649
|
|
|
2650
2650
|
|
|
2651
|
-
def modelAnalytical(L,TD,TAB,TBC,TAC,rad,kB,V,mode,
|
|
2651
|
+
def modelAnalytical(L,TD,TAB,TBC,TAC,rad,kB,V,mode,ne):
|
|
2652
2652
|
"""
|
|
2653
2653
|
TDCR analytical model that is used for pure beta emitting radionuclides
|
|
2654
2654
|
|
|
@@ -2672,8 +2672,6 @@ def modelAnalytical(L,TD,TAB,TBC,TAC,rad,kB,V,mode,symm,ne):
|
|
|
2672
2672
|
volume of the scintillator in ml. run only for 10 ml
|
|
2673
2673
|
mode : string
|
|
2674
2674
|
"res" to return the residual, "eff" to return efficiencies.
|
|
2675
|
-
symm : boolean
|
|
2676
|
-
"True" for symetrical model, "False" for symetrical model.
|
|
2677
2675
|
nE : integer
|
|
2678
2676
|
Number of bins for the quenching function.
|
|
2679
2677
|
|
|
@@ -2699,7 +2697,7 @@ def modelAnalytical(L,TD,TAB,TBC,TAC,rad,kB,V,mode,symm,ne):
|
|
|
2699
2697
|
em[i] = Em_e(ei*1e3,ei*1e3,kB*1e3,ne)*1e-3
|
|
2700
2698
|
|
|
2701
2699
|
|
|
2702
|
-
if
|
|
2700
|
+
if type(L)==float or isinstance(L, np.float64):
|
|
2703
2701
|
eff_S = sum(p*(1-np.exp(-L*em/3)))
|
|
2704
2702
|
eff_T = sum(p*(1-np.exp(-L*em/3))**3)
|
|
2705
2703
|
eff_D = sum(p*(3*(1-np.exp(-L*em/3))**2-2*(1-np.exp(-L*em/3))**3))
|
|
File without changes
|
|
File without changes
|