TDCRPy 1.8.14__py3-none-any.whl → 1.8.15__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TDCRPy
3
- Version: 1.8.14
3
+ Version: 1.8.15
4
4
  Summary: TDCR model
5
5
  Home-page: https://pypi.org/project/TDCRPy/
6
6
  Author: RomainCoulon (Romain Coulon)
@@ -30,7 +30,7 @@ Requires-Dist: matplotlib
30
30
 
31
31
  # TDCRPy
32
32
 
33
- `TDCRPy` is a Python code to calculate detection efficiency of a liquide scintillation counter using 3-photomultiplier tubes.
33
+ `TDCRPy` is a Python code to calculate detection efficiency of a liquid scintillation counter using 3-photomultiplier tubes.
34
34
  The calculation is based on the photo-physical model called of the Triple-to-Double-Coincidence-Ratio method (TDCR) and a Monte-Carlo sampling allowing to adress complexe decay schemes and radionuclide mixtures.
35
35
 
36
36
  The code is developped and maintained by the BIPM (MIT license).
@@ -88,111 +88,6 @@ At first, the TDCRPy module must be imported.
88
88
  ```python
89
89
  import tdcrpy
90
90
  ```
91
-
92
- ### TDCRoptimize.eff()
93
-
94
- In practice, `TDCRoptimize.eff()` is the fonction used to estimate the counting efficiency of a TDCR system. It approximates the free parameter(s) `L` in order to minimize the residual estimated by `TDCRPy()` for a given set of measurement data. In `mode2 = "sym"`, the *golden section search technique* is applied with a maximum number of iterations of 20. In `mode2 = "asym"`, the *Nelder-Mead technique* is applied with a maximum number of iterations of 20.
95
-
96
- `TDCRoptimize.eff()` is parametrised by the following parameters:
97
- * `TD` (type `float`) is the quotient of the triple coincidence count rate divided by the logic sum of the double coincidence count rate.
98
- * `TAB` (type `float`) is the quotient of the triple coincidence count rate divided by the double coincidence count rate between the channel A and B.
99
- * `TBC` (type `float`) is the quotient of the triple coincidence count rate divided by the double coincidence count rate between the channel B and C.
100
- * `TAC` (type `float`) is the quotient of the triple coincidence count rate divided by the double coincidence count rate between the channel A and C.
101
- * `rad` (type `string`) is the list of radionuclides contained in the solution, e.g. `"H-3"`, `"H-3, Co-60"`.
102
- * `pmf_1` (type `string`) is the probability of each radionuclide contained in `rad`. If `rad = "H-3, Co-60"` and `pmf_1="0.8, 0.2"`, the solution contains 80 % of tritium and 20 % of cobalt 60.
103
- * `kB` (type `float`) is the Birks constant caracterizing the scintillator. It is espressed in cm/keV.
104
- * `V` (type `float`) is the volume in ml of the scintillator.
105
- * `mode2` sets whether the TDCR system has to be considered symetrical `mode2="sym"` or not symetrical `mode2="asym"`.
106
- * `N` (type `integer`) is the number of Monte-Carlo trials corresponding each, to a simulated nuclear decay in the scintillator. Monte-Carlo calculation is not used in the case of pure beta emitting radionuclides where the analytical model is implemented. It is an optional parameter set by default at `N = 10000`.
107
- * `L` (type `float`) initial guess of the free parameter(s) in keV^-1^. It represents the number of photoelectrons produced by the PMTs per unit of ionisation energy released in the scintillator during a decay and in the abscence of scintillation quenching. It is set by default at `L = 1`.
108
-
109
- `TDCRoptimize.eff()` returns:
110
- * the global free parameter *L*,
111
- * the free parameters related to each channel (*L<sub>A</sub>*, *L<sub>B</sub>*, *L<sub>C</sub>*),
112
- * the estimation of the counting efficiency of single events *S*,
113
- * the standard uncertainty of the estimation of *S*,
114
- * the estimation of the counting efficiency of double coincidences *D*,
115
- * the standard uncertainty of the estimation of *D*,
116
- * the estimation of the counting efficiency of triple coincidences *T*,
117
- * the standard uncertainty of the estimation of *T*.
118
-
119
- Example with `mode2 = "sym"`:
120
-
121
- ```python
122
- import tdcrpy
123
-
124
- TD = 0.977667386529166
125
- TAB = 0.992232838598821
126
- TBC = 0.992343419459002
127
- TAC = 0.99275350064608
128
- Rad="Co-60"
129
- pmf_1="1"
130
- N = 250
131
- kB =1.0e-5
132
- V = 10
133
- mode2 = "sym"
134
-
135
- result = tdcrpy.TDCRoptimize.eff(TD, TAB, TBC, TAC, Rad, pmf_1, kB, V, mode2, N=N)
136
-
137
- print("Global free parameter = \t", round(result[0],4), " keV-1")
138
- print("Free parameter (PMT A) = \t", round(result[1][0],4) , " keV-1")
139
- print("Free parameter (PMT B) = \t", round(result[1][1],4) , " keV-1")
140
- print("Free parameter (PMT C) = \t", round(result[1][2],4) , " keV-1")
141
- print("efficiency S = \t", round(result[2],4), "+/-", round(result[3],4))
142
- print("efficiency D = \t", round(result[4],4), "+/-", round(result[5],4))
143
- print("efficiency T = \t", round(result[6],4), "+/-", round(result[7],4))
144
- ```
145
-
146
- ```Console
147
- Global free parameter = 1.3061 keV-1
148
- Free parameter (PMT A) = 1.3061 keV-1
149
- Free parameter (PMT B) = 1.3061 keV-1
150
- Free parameter (PMT C) = 1.3061 keV-1
151
- efficiency S = 0.979 +/- 0.0067
152
- efficiency D = 0.9833 +/- 0.0064
153
- efficiency T = 0.963 +/- 0.0096
154
- ```
155
-
156
- Example with `mode2 = "asym"`:
157
-
158
- ```python
159
- import tdcrpy
160
-
161
- TD = 0.977667386529166
162
- TAB = 0.992232838598821
163
- TBC = 0.992343419459002
164
- TAC = 0.99275350064608
165
- Rad="Co-60"
166
- pmf_1="1"
167
- N = 250
168
- kB =1.0e-5
169
- V = 10
170
- mode2 = "asym"
171
-
172
- result = tdcrpy.TDCRoptimize.eff(TD, TAB, TBC, TAC, Rad, pmf_1, kB, V, mode2, N=N)
173
-
174
- print("Global free parameter = \t", round(result[0],4), " keV-1")
175
- print("Free parameter (PMT A) = \t", round(result[1][0],4) , " keV-1")
176
- print("Free parameter (PMT B) = \t", round(result[1][1],4) , " keV-1")
177
- print("Free parameter (PMT C) = \t", round(result[1][2],4) , " keV-1")
178
- print("efficiency S = \t", round(result[2],4), "+/-", round(result[3],4))
179
- print("efficiency D = \t", round(result[4],4), "+/-", round(result[5],4))
180
- print("efficiency T = \t", round(result[6],4), "+/-", round(result[7],4))
181
- ```
182
-
183
- ```Console
184
- Global free parameter = 1.3061 keV-1
185
- Free parameter (PMT A) = 1.3061 keV-1
186
- Free parameter (PMT B) = 1.3061 keV-1
187
- Free parameter (PMT C) = 1.3061 keV-1
188
- efficiency S = 0.979 +/- 0.0067
189
- efficiency D = 0.9833 +/- 0.0064
190
- efficiency T = 0.963 +/- 0.0096
191
- ```
192
-
193
-
194
-
195
-
196
91
  ### TDCRPy()
197
92
 
198
93
  The main function of the TDCRPy module is `TDCRPy()` in which the Monte-Carlo Triple-to-Double Coincidence Ratio model is implemented. The computation is made for a given solution containing a radionuclide (or a mixture of radionuclides) `rad`, a given volume of scintillator `V` and a given Birks constant `kB`.
@@ -334,4 +229,105 @@ An advanced setting can be configured in the `config.toml` file for functions `T
334
229
  and `nE_alpha = 1000`. These values ensure an error on quenched energy estimation from numerical approximation below 10^-3^.
335
230
  * By default the calculation is set for Ultima-Gold cocktail mixed with a small amount of aqueous solution. You can adapt for a specific scintillator by changing the `density` (default `density=0.96`), the mean charge number `Z` (default `Z=5.2`) and the mean mass number `A` (default `A=11.04`) of the scintillator.
336
231
  * To optimize the speed of the Monte-Carlo calculation, a spline interpolation on precalculated quenched energy is applied. The parameter `depthSpline` (default `depthSpline = 5`) sets the number of bins on each side of the energy point on which the interpolation is applied. The parameter `Einterp` (default `Einterp = 1`) set the energy (in keV) above which the interpolation is applied.
232
+
233
+ ### TDCRoptimize.eff()
234
+
235
+ An optimization procedure `TDCRoptimize.eff()` is proposed to estimate the counting efficiency of a TDCR system. It approximates the free parameter(s) `L` in order to minimize the residual estimated by `TDCRPy()` for a given set of measurement data. In `mode2 = "sym"`, the *golden section search technique* is applied with a maximum number of iterations of 20. In `mode2 = "asym"`, the *Nelder-Mead technique* is applied with a maximum number of iterations of 20.
236
+
237
+ `TDCRoptimize.eff()` is parametrised by the following parameters:
238
+ * `TD` (type `float`) is the quotient of the triple coincidence count rate divided by the logic sum of the double coincidence count rate.
239
+ * `TAB` (type `float`) is the quotient of the triple coincidence count rate divided by the double coincidence count rate between the channel A and B.
240
+ * `TBC` (type `float`) is the quotient of the triple coincidence count rate divided by the double coincidence count rate between the channel B and C.
241
+ * `TAC` (type `float`) is the quotient of the triple coincidence count rate divided by the double coincidence count rate between the channel A and C.
242
+ * `rad` (type `string`) is the list of radionuclides contained in the solution, e.g. `"H-3"`, `"H-3, Co-60"`.
243
+ * `pmf_1` (type `string`) is the probability of each radionuclide contained in `rad`. If `rad = "H-3, Co-60"` and `pmf_1="0.8, 0.2"`, the solution contains 80 % of tritium and 20 % of cobalt 60.
244
+ * `kB` (type `float`) is the Birks constant caracterizing the scintillator. It is espressed in cm/keV.
245
+ * `V` (type `float`) is the volume in ml of the scintillator.
246
+ * `mode2` sets whether the TDCR system has to be considered symetrical `mode2="sym"` or not symetrical `mode2="asym"`.
247
+ * `N` (type `integer`) is the number of Monte-Carlo trials corresponding each, to a simulated nuclear decay in the scintillator. Monte-Carlo calculation is not used in the case of pure beta emitting radionuclides where the analytical model is implemented. It is an optional parameter set by default at `N = 10000`.
248
+ * `L` (type `float`) initial guess of the free parameter(s) in keV^-1^. It represents the number of photoelectrons produced by the PMTs per unit of ionisation energy released in the scintillator during a decay and in the abscence of scintillation quenching. It is set by default at `L = 1`.
249
+
250
+ `TDCRoptimize.eff()` returns:
251
+ * the global free parameter *L*,
252
+ * the free parameters related to each channel (*L<sub>A</sub>*, *L<sub>B</sub>*, *L<sub>C</sub>*),
253
+ * the estimation of the counting efficiency of single events *S*,
254
+ * the standard uncertainty of the estimation of *S*,
255
+ * the estimation of the counting efficiency of double coincidences *D*,
256
+ * the standard uncertainty of the estimation of *D*,
257
+ * the estimation of the counting efficiency of triple coincidences *T*,
258
+ * the standard uncertainty of the estimation of *T*.
259
+
260
+ Example with `mode2 = "sym"`:
261
+
262
+ ```python
263
+ import tdcrpy
264
+
265
+ TD = 0.977667386529166
266
+ TAB = 0.992232838598821
267
+ TBC = 0.992343419459002
268
+ TAC = 0.99275350064608
269
+ Rad="Co-60"
270
+ pmf_1="1"
271
+ N = 250
272
+ kB =1.0e-5
273
+ V = 10
274
+ mode2 = "sym"
275
+
276
+ result = tdcrpy.TDCRoptimize.eff(TD, TAB, TBC, TAC, Rad, pmf_1, kB, V, mode2, N=N)
277
+
278
+ print("Global free parameter = \t", round(result[0],4), " keV-1")
279
+ print("Free parameter (PMT A) = \t", round(result[1][0],4) , " keV-1")
280
+ print("Free parameter (PMT B) = \t", round(result[1][1],4) , " keV-1")
281
+ print("Free parameter (PMT C) = \t", round(result[1][2],4) , " keV-1")
282
+ print("efficiency S = \t", round(result[2],4), "+/-", round(result[3],4))
283
+ print("efficiency D = \t", round(result[4],4), "+/-", round(result[5],4))
284
+ print("efficiency T = \t", round(result[6],4), "+/-", round(result[7],4))
285
+ ```
286
+
287
+ ```Console
288
+ Global free parameter = 1.3061 keV-1
289
+ Free parameter (PMT A) = 1.3061 keV-1
290
+ Free parameter (PMT B) = 1.3061 keV-1
291
+ Free parameter (PMT C) = 1.3061 keV-1
292
+ efficiency S = 0.979 +/- 0.0067
293
+ efficiency D = 0.9833 +/- 0.0064
294
+ efficiency T = 0.963 +/- 0.0096
295
+ ```
296
+
297
+ Example with `mode2 = "asym"`:
298
+
299
+ ```python
300
+ import tdcrpy
301
+
302
+ TD = 0.977667386529166
303
+ TAB = 0.992232838598821
304
+ TBC = 0.992343419459002
305
+ TAC = 0.99275350064608
306
+ Rad="Co-60"
307
+ pmf_1="1"
308
+ N = 250
309
+ kB =1.0e-5
310
+ V = 10
311
+ mode2 = "asym"
312
+
313
+ result = tdcrpy.TDCRoptimize.eff(TD, TAB, TBC, TAC, Rad, pmf_1, kB, V, mode2, N=N)
314
+
315
+ print("Global free parameter = \t", round(result[0],4), " keV-1")
316
+ print("Free parameter (PMT A) = \t", round(result[1][0],4) , " keV-1")
317
+ print("Free parameter (PMT B) = \t", round(result[1][1],4) , " keV-1")
318
+ print("Free parameter (PMT C) = \t", round(result[1][2],4) , " keV-1")
319
+ print("efficiency S = \t", round(result[2],4), "+/-", round(result[3],4))
320
+ print("efficiency D = \t", round(result[4],4), "+/-", round(result[5],4))
321
+ print("efficiency T = \t", round(result[6],4), "+/-", round(result[7],4))
322
+ ```
323
+
324
+ ```Console
325
+ Global free parameter = 1.3061 keV-1
326
+ Free parameter (PMT A) = 1.3061 keV-1
327
+ Free parameter (PMT B) = 1.3061 keV-1
328
+ Free parameter (PMT C) = 1.3061 keV-1
329
+ efficiency S = 0.979 +/- 0.0067
330
+ efficiency D = 0.9833 +/- 0.0064
331
+ efficiency T = 0.963 +/- 0.0096
332
+ ```
337
333
 
@@ -1,9 +1,9 @@
1
1
  tdcrpy/TDCRPy.py,sha256=XJHHuGwsp_yn422nupus6luRAp4a58vZPT9PO8ilOVE,53211
2
2
  tdcrpy/TDCRPy1.py,sha256=QTBZh5B5JWnGB0BQfD-cFmwA9W080OD4sG-aj50-ejo,38106
3
- tdcrpy/TDCR_model_lib.py,sha256=PE4365_HRBc5lB_4n0W2-UQ32LF9juA0Z_mI4M2cxtI,96132
3
+ tdcrpy/TDCR_model_lib.py,sha256=eVM1CrraMJx6PxFUohGS4d1ht_J7FNfTbeuoOsqzYXg,96252
4
4
  tdcrpy/TDCRoptimize.py,sha256=c2XIGveeLdVYYek4Rg6dygMvVA2xIrIkMb3L-_jUucM,6496
5
5
  tdcrpy/__init__.py,sha256=vQslGLsoZPIceaitnSHOqN6lUdjEyJ3YhfJ6tYdXt-s,127
6
- tdcrpy/config.toml,sha256=xPejXoPI4m4FgG8hIYLEyMA-y8MBCF3PaWtv55TqHeQ,1646
6
+ tdcrpy/config.toml,sha256=n6RdM0st4et_hlc7vO7wTcjLK8pnplJ2mLD0NJawl14,1648
7
7
  tdcrpy/test2.py,sha256=poLLXJyIaCeqh1VSkwgbi-udvY7lQjxz_YStKjJXGhU,501
8
8
  tdcrpy/EfficiencyCurves/Ag-108/EffD_Ag-108_[1]_1e-05.txt,sha256=OUoMuqPTw3fXLu5qaHUFN2iW0dPJ9cRyh99a6mUcEus,43
9
9
  tdcrpy/EfficiencyCurves/Ag-108/EffS_Ag-108_[1]_1e-05.txt,sha256=hojCq_MFAw8ONjoDmQfeE9gCXISwhScgAk-N0Pjbg00,45
@@ -1078,8 +1078,8 @@ tdcrpy/docs/_build/html/source/modules.html,sha256=Jf-qxVBId0UgpwyvYuyjtMNG-ezPO
1078
1078
  tdcrpy/docs/_build/html/source/tdcrpy.html,sha256=-38lHMNFB22p1tWJEeN3yDqfDiCYE304vxDamO1-iRc,3779
1079
1079
  tdcrpy/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1080
1080
  tdcrpy/test/test_tdcrpy.py,sha256=3b9PeT2ROGGEFM_G4EVlDQMdP4B3ONp4a0kh1bKyVkI,4003
1081
- TDCRPy-1.8.14.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
1082
- TDCRPy-1.8.14.dist-info/METADATA,sha256=tsr1_9F0SFVSoetVUUZtOPfQGkxQ0UU1LAaFqidjI20,15601
1083
- TDCRPy-1.8.14.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
1084
- TDCRPy-1.8.14.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
1085
- TDCRPy-1.8.14.dist-info/RECORD,,
1081
+ TDCRPy-1.8.15.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
1082
+ TDCRPy-1.8.15.dist-info/METADATA,sha256=K1sUlZPjiGH_knFFaIrDZIexMXvKho6iVJWC8T55sSY,15600
1083
+ TDCRPy-1.8.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
1084
+ TDCRPy-1.8.15.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
1085
+ TDCRPy-1.8.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
tdcrpy/TDCR_model_lib.py CHANGED
@@ -712,9 +712,11 @@ def readBetaShape(rad,mode,level,z=z_betashape):
712
712
  p.append(p0 * (e[k+1])-e[k])
713
713
  else:
714
714
  p.append(p0 * (e[k]-e[k-1]))
715
-
715
+
716
+ e=(np.asarray(e[:-1])+np.asarray(e[1:]))/2
717
+ p.pop(-1)
716
718
  p /= sum(np.asarray(p)) # normalization
717
- p = list(p)
719
+ p = list(p); e = list(e)
718
720
  return e, p
719
721
 
720
722
 
@@ -2333,12 +2335,13 @@ def modelAnalytical(L,TD,TAB,TBC,TAC,rad,kB,V,mode,mode2,ne):
2333
2335
 
2334
2336
  """
2335
2337
 
2336
- # e, p = readBetaShape(rad, 'beta-', 'tot')
2337
- e, p = readBetaSpectra(rad)
2338
+ e, p = readBetaShape(rad, 'beta-', 'tot')
2339
+ # e, p = readBetaSpectra(rad)
2338
2340
  em=np.empty(len(e))
2339
2341
  for i, ei in enumerate(e):
2340
- ed = energie_dep_beta(ei)
2341
- em[i] = E_quench_e(ed*1e3,ed*1e3,kB*1e3,ne)*1e-3
2342
+ # ed = energie_dep_beta2(ei,V)
2343
+ # em[i] = E_quench_e(ei*1e3,ed*1e3,kB*1e3,ne)*1e-3
2344
+ em[i] = Em_e(ei*1e3,ed*1e3,kB*1e3,ne)*1e-3
2342
2345
 
2343
2346
 
2344
2347
  if mode2=="sym":
tdcrpy/config.toml CHANGED
@@ -42,4 +42,4 @@ tau = 50
42
42
  depthSpline = 5
43
43
  # energy (in keV) above which interpolation is applied.
44
44
  Einterp_a = 100
45
- Einterp_e = 1
45
+ Einterp_e = 1.5