TDCRPy 1.12.13__py3-none-any.whl → 1.12.14__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.12.13
3
+ Version: 1.12.14
4
4
  Summary: TDCR model
5
5
  Home-page: https://pypi.org/project/TDCRPy/
6
6
  Author: RomainCoulon (Romain Coulon)
@@ -1,6 +1,6 @@
1
- tdcrpy/TDCRPy.py,sha256=zdUZAf00Tm3Oy09G2A4tkfLYhZkj-ep67mL5FrfS-sM,65543
1
+ tdcrpy/TDCRPy.py,sha256=6Lvttr2ULiLE25Zh4MUfsyKM9k0eZv0PhzGP_0Kmcnw,65388
2
2
  tdcrpy/TDCRPy1.py,sha256=QTBZh5B5JWnGB0BQfD-cFmwA9W080OD4sG-aj50-ejo,38106
3
- tdcrpy/TDCR_model_lib.py,sha256=Vqbd-JVhGdF9BzW9axYwCHl2MOBfupCJ1ih5Nz_aXts,106906
3
+ tdcrpy/TDCR_model_lib.py,sha256=WYR2-z187MLDOHR_wdOGdOkKKLYuP2f1VE-pTQ3wAzc,107934
4
4
  tdcrpy/TDCRoptimize.py,sha256=c2XIGveeLdVYYek4Rg6dygMvVA2xIrIkMb3L-_jUucM,6496
5
5
  tdcrpy/__init__.py,sha256=vQslGLsoZPIceaitnSHOqN6lUdjEyJ3YhfJ6tYdXt-s,127
6
6
  tdcrpy/config.toml,sha256=d_olKEgxfobBHkZ2wEj9EgKE7I8Wbpim9ZAsi5ImFxk,1470
@@ -1079,14 +1079,10 @@ tdcrpy/docs/_build/html/index.html,sha256=KbgBWH_0ixaswXk_lCM_pMk10v4rLs5qdPubj2
1079
1079
  tdcrpy/docs/_build/html/search.html,sha256=IeTP6CsRdqKWOJttbtskg1oBgdN8norKlzai4Tmk8Kc,2799
1080
1080
  tdcrpy/docs/_build/html/source/modules.html,sha256=Jf-qxVBId0UgpwyvYuyjtMNG-ezPOK1oH_IxRXAWTRs,3601
1081
1081
  tdcrpy/docs/_build/html/source/tdcrpy.html,sha256=-38lHMNFB22p1tWJEeN3yDqfDiCYE304vxDamO1-iRc,3779
1082
- tdcrpy/recordFiles/Temp_E0.txt,sha256=I8lJwaMRmBaHPlN7of3ieycfk4gaMT7j2ZJpJvxnVxM,980
1083
- tdcrpy/recordFiles/Temp_E1.txt,sha256=pYitCNjrVK1vfpGTxycgNB1cWZIWj2rwUnFw1KLNa5M,983
1084
- tdcrpy/recordFiles/Temp_E2.txt,sha256=nHzLeX6f7bOerL0LZSWCO6zg2WgA8tqDwPhMyUsI85w,992
1085
- tdcrpy/recordFiles/Temp_E3.txt,sha256=mmg3kPoW5EXXCn8XHbRqDTt1vRHz_q5uVXRMAQvrTIU,902
1086
1082
  tdcrpy/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1087
1083
  tdcrpy/test/test_tdcrpy.py,sha256=JINqSEMFoNpptE4f3h6ZzTYW1rBx90KkaoQzltSg-No,4692
1088
- TDCRPy-1.12.13.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
1089
- TDCRPy-1.12.13.dist-info/METADATA,sha256=Jsiz9os_184vLMBQZ6NkXuQQGCE138ik61N0yBEvlbg,15833
1090
- TDCRPy-1.12.13.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
1091
- TDCRPy-1.12.13.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
1092
- TDCRPy-1.12.13.dist-info/RECORD,,
1084
+ TDCRPy-1.12.14.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
1085
+ TDCRPy-1.12.14.dist-info/METADATA,sha256=zMqiloAvp2aN0UeMAUoG3VXP71N7ZhaCLIZJnOhlFBQ,15833
1086
+ TDCRPy-1.12.14.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
1087
+ TDCRPy-1.12.14.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
1088
+ TDCRPy-1.12.14.dist-info/RECORD,,
tdcrpy/TDCRPy.py CHANGED
@@ -15,6 +15,8 @@ from importlib.resources import files
15
15
  import configparser
16
16
  import numpy as np
17
17
  from tqdm import tqdm
18
+ import tempfile
19
+ import os
18
20
 
19
21
  def relaxAtom(daughter_relax,particle_vec,energy_vec,rad,Display=False,uncData=False):
20
22
 
@@ -167,8 +169,8 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
167
169
  Standard uncertainty from calculation associated with the estimation of the efficiency of double coincidences for C/N systems. (only in mode="eff")
168
170
  """
169
171
  if record:
170
- # recfile1 = "recordFiles/"+Rad+"_"+pmf_1+"_"+str(N)+".dhf1"
171
- recfile1 = "recordFiles/Temp_E0.txt"
172
+ temp_dir = tempfile.gettempdir()
173
+ recfile1 = os.path.join(temp_dir, "Temp_E0.txt")
172
174
  header_content1 = """# TDCRPy output: inital energies from nuclear decays
173
175
  # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
174
176
  # Column 2: Energy in eV (> ECNUC)
@@ -177,10 +179,9 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
177
179
  # Column 5: Particle age in seconds (since decay started)
178
180
  # 2 3 4 5
179
181
  """
180
- with open(recfile1, "w") as file: file.write(header_content1)
182
+ with open(recfile1, 'w') as file: file.write(header_content1)
181
183
 
182
- # recfile2 = "recordFiles/"+Rad+"_"+pmf_1+"_"+str(N)+".dhf2"
183
- recfile2 = "recordFiles/Temp_E1.txt"
184
+ recfile2 = os.path.join(temp_dir, "Temp_E1.txt")
184
185
  header_content2 = """# TDCRPy output: deposited energies from nuclear decays
185
186
  # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
186
187
  # Column 2: Energy in eV (> ECNUC)
@@ -191,8 +192,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
191
192
  """
192
193
  with open(recfile2, "w") as file: file.write(header_content2)
193
194
 
194
- # recfile3 = "recordFiles/"+Rad+"_"+pmf_1+"_"+str(N)+".dhf3"
195
- recfile3 = "recordFiles/Temp_E2.txt"
195
+ recfile3 = os.path.join(temp_dir, "Temp_E2.txt")
196
196
  header_content3 = """# TDCRPy output: deposited quenched energies from nuclear decays
197
197
  # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
198
198
  # Column 2: Energy in eV (> ECNUC)
@@ -210,8 +210,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
210
210
  # Column 4: detection probability if triple coincidences
211
211
  # 2 3 4
212
212
  """
213
- # recfile4 = "recordFiles/"+Rad+"_"+pmf_1+"_"+str(N)+".dhf4"
214
- recfile4 = "recordFiles/Temp_E3.txt"
213
+ recfile4 = os.path.join(temp_dir, "Temp_E3.txt")
215
214
  with open(recfile4, "w") as file: file.write(header_content4)
216
215
 
217
216
  if barp: tl.display_header()
@@ -1085,9 +1084,9 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
1085
1084
  # mode = "eff"
1086
1085
  # mode2 = "sym"
1087
1086
 
1088
- # out = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=True, barp=False,uncData=False)
1089
- # print("TDCR", out[4]/out[2])
1090
- # print("Eff D", out[2])
1087
+ # # out = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=True, barp=False,uncData=False)
1088
+ # # print("TDCR", out[4]/out[2])
1089
+ # # print("Eff D", out[2])
1091
1090
 
1092
1091
 
1093
1092
  # out = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, 20, kB, V, mode, mode2, Display=True, barp=False, Smodel=True, syst = "TDCR", record = "phf1", uncData=False)
tdcrpy/TDCR_model_lib.py CHANGED
@@ -23,6 +23,7 @@ import os
23
23
  import scipy.interpolate as interp
24
24
  import matplotlib.pyplot as plt
25
25
  from tqdm import tqdm
26
+ import tempfile
26
27
 
27
28
  """
28
29
  ======= Import ressource data =======
@@ -168,6 +169,26 @@ def modifyMicCorr(x):
168
169
  data1 = data0.replace(f"micCorr = {x0}",f"micCorr= {x}")
169
170
  writeConfifAsstr(data1)
170
171
 
172
+ def read_temp_files(copy=False, path="C:"):
173
+
174
+ temp_dir = tempfile.gettempdir()
175
+ file_path1 = os.path.join(temp_dir, 'Temp_E0.txt')
176
+ file_path2 = os.path.join(temp_dir, 'Temp_E1.txt')
177
+ file_path3 = os.path.join(temp_dir, 'Temp_E2.txt')
178
+ file_path4 = os.path.join(temp_dir, 'Temp_E3.txt')
179
+ with open(file_path1, 'r') as temp_file: content1 = temp_file.read()
180
+ with open(file_path2, 'r') as temp_file: content2 = temp_file.read()
181
+ with open(file_path3, 'r') as temp_file: content3 = temp_file.read()
182
+ with open(file_path4, 'r') as temp_file: content4 = temp_file.read()
183
+
184
+ if copy:
185
+ with open(path+'Temp_E0.txt', 'w') as temp_file: temp_file.write(content1)
186
+ with open(path+'Temp_E1.txt', 'w') as temp_file: temp_file.write(content2)
187
+ with open(path+'Temp_E2.txt', 'w') as temp_file: temp_file.write(content3)
188
+ with open(path+'Temp_E3.txt', 'w') as temp_file: temp_file.write(content4)
189
+
190
+ return content1, content2, content3, content4,
191
+
171
192
  # import PenNuc data
172
193
  with importlib.resources.as_file(files('tdcrpy').joinpath('decayData')) as data_path:
173
194
  #with importlib.resources.path('tdcrpy', 'decayData') as data_path:
@@ -1,37 +0,0 @@
1
- # TDCRPy output: inital energies from nuclear decays
2
- # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
3
- # Column 2: Energy in eV (> ECNUC)
4
- # Column 3: Decay number mod 100, two digits
5
- # Column 4: Cascade number mod 10, one digit
6
- # Column 5: Particle age in seconds (since decay started)
7
- # 2 3 4 5
8
- 1 8.900000E+04 0 1 0
9
- 1 3.620000E+05 1 1 0
10
- 1 1.210000E+05 2 1 0
11
- 1 3.000000E+03 3 1 0
12
- 2 2.083662E+05 3 1 0
13
- 1 4.759900E+04 3 1 0
14
- 2 5.579090E+04 3 1 0
15
- 1 7.750000E+03 3 1 0
16
- 1 6.100000E+04 4 1 0
17
- 2 2.083662E+05 4 1 0
18
- 1 1.024262E+05 4 1 0
19
- 1 7.750000E+03 4 1 0
20
- 1 2.350000E+05 5 1 0
21
- 1 2.280000E+05 6 1 0
22
- 1 1.800000E+05 7 1 0
23
- 1 3.150000E+05 8 1 0
24
- 1 4.200000E+04 9 1 0
25
- 1 6.000000E+03 10 1 0
26
- 1 1.010000E+05 11 1 0
27
- 1 6.100000E+04 12 1 0
28
- 1 3.230000E+05 13 1 0
29
- 1 1.220000E+05 14 1 0
30
- 1 4.400000E+04 15 1 0
31
- 2 2.083662E+05 15 1 0
32
- 1 1.024262E+05 15 1 0
33
- 1 7.750000E+03 15 1 0
34
- 1 4.700000E+04 16 1 0
35
- 1 3.400000E+04 17 1 0
36
- 1 9.900000E+04 18 1 0
37
- 1 8.500000E+04 19 1 0
@@ -1,37 +0,0 @@
1
- # TDCRPy output: deposited energies from nuclear decays
2
- # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
3
- # Column 2: Energy in eV (> ECNUC)
4
- # Column 3: Decay number mod 100, two digits
5
- # Column 4: Cascade number mod 10, one digit
6
- # Column 5: Particle age in seconds (since decay started)
7
- # 2 3 4 5
8
- 1 8.900000E+04 0 1 0
9
- 1 3.620000E+05 1 1 0
10
- 1 1.210000E+05 2 1 0
11
- 1 3.000000E+03 3 1 0
12
- 1 0.000000E+00 3 1 0
13
- 1 4.759900E+04 3 1 0
14
- 1 1.283191E+04 3 1 0
15
- 1 7.750000E+03 3 1 0
16
- 1 6.100000E+04 4 1 0
17
- 1 0.000000E+00 4 1 0
18
- 1 1.024262E+05 4 1 0
19
- 1 7.750000E+03 4 1 0
20
- 1 2.350000E+05 5 1 0
21
- 1 2.280000E+05 6 1 0
22
- 1 1.800000E+05 7 1 0
23
- 1 2.125648E+05 8 1 0
24
- 1 4.200000E+04 9 1 0
25
- 1 6.000000E+03 10 1 0
26
- 1 1.010000E+05 11 1 0
27
- 1 6.100000E+04 12 1 0
28
- 1 3.230000E+05 13 1 0
29
- 1 1.220000E+05 14 1 0
30
- 1 4.400000E+04 15 1 0
31
- 1 0.000000E+00 15 1 0
32
- 1 1.024262E+05 15 1 0
33
- 1 7.750000E+03 15 1 0
34
- 1 4.700000E+04 16 1 0
35
- 1 3.400000E+04 17 1 0
36
- 1 9.900000E+04 18 1 0
37
- 1 8.500000E+04 19 1 0
@@ -1,37 +0,0 @@
1
- # TDCRPy output: deposited quenched energies from nuclear decays
2
- # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
3
- # Column 2: Energy in eV (> ECNUC)
4
- # Column 3: Decay number mod 100, two digits
5
- # Column 4: Cascade number mod 10, one digit
6
- # Column 5: Particle age in seconds (since decay started)
7
- # 2 3 4 5
8
- 1 7.256485E+04 0 1 0
9
- 1 3.126531E+05 1 1 0
10
- 1 1.004394E+05 2 1 0
11
- 1 1.350593E+03 3 1 0
12
- 1 0.000000E+00 3 1 0
13
- 1 3.690230E+04 3 1 0
14
- 1 1.095075E+04 3 1 0
15
- 1 4.466165E+03 3 1 0
16
- 1 4.836887E+04 4 1 0
17
- 1 0.000000E+00 4 1 0
18
- 1 8.423896E+04 4 1 0
19
- 1 4.466165E+03 4 1 0
20
- 1 2.005481E+05 5 1 0
21
- 1 1.943812E+05 6 1 0
22
- 1 1.521483E+05 7 1 0
23
- 1 1.870476E+05 8 1 0
24
- 1 3.214612E+04 9 1 0
25
- 1 3.252983E+03 10 1 0
26
- 1 8.299727E+04 11 1 0
27
- 1 4.836887E+04 12 1 0
28
- 1 2.781928E+05 13 1 0
29
- 1 1.013130E+05 14 1 0
30
- 1 3.384221E+04 15 1 0
31
- 1 0.000000E+00 15 1 0
32
- 1 8.423896E+04 15 1 0
33
- 1 4.466165E+03 15 1 0
34
- 1 3.639232E+04 16 1 0
35
- 1 2.540040E+04 17 1 0
36
- 1 8.125656E+04 18 1 0
37
- 1 6.909427E+04 19 1 0
@@ -1,26 +0,0 @@
1
- # TDCRPy output: detection probabilities
2
- # Column 1: Decay number mod 100, two digits
3
- # Column 2: detection probability of single events
4
- # Column 3: detection probability if double coincidences
5
- # Column 4: detection probability if triple coincidences
6
- # 2 3 4
7
- 0 1.0 0.9999999999999998 0.9999999999061827
8
- 1 1.0 1.0 1.0
9
- 2 1.0 1.0 0.9999999999999913
10
- 3 1.0 0.9999999999999991 0.999999948994126
11
- 4 1.0 1.0 1.0
12
- 5 1.0 1.0 1.0
13
- 6 1.0 1.0 1.0
14
- 7 1.0 1.0 1.0
15
- 8 1.0 1.0 1.0
16
- 9 0.999999999999989 0.9999999985213657 0.9999333984161588
17
- 10 0.9613412941994496 0.7343237230821587 0.2899479433902926
18
- 11 1.0 1.0 0.9999999999971023
19
- 12 1.0 0.99999999999997 0.999999701455034
20
- 13 1.0 1.0 1.0
21
- 14 1.0 1.0000000000000002 0.9999999999999937
22
- 15 1.0 1.0 1.0
23
- 16 0.9999999999999999 0.9999999999128106 0.99998382697656
24
- 17 0.9999999999906943 0.9999998672938257 0.9993691221325874
25
- 18 1.0 1.0 0.9999999999948235
26
- 19 1.0 1.0 0.9999999997016666