TDCRPy 1.12.12__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.12
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=FkVcr_YOu3dqp5BcQjxp9h6lRC-WitUF6jUr3-5Ffj0,65329
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
@@ -1081,8 +1081,8 @@ tdcrpy/docs/_build/html/source/modules.html,sha256=Jf-qxVBId0UgpwyvYuyjtMNG-ezPO
1081
1081
  tdcrpy/docs/_build/html/source/tdcrpy.html,sha256=-38lHMNFB22p1tWJEeN3yDqfDiCYE304vxDamO1-iRc,3779
1082
1082
  tdcrpy/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1083
1083
  tdcrpy/test/test_tdcrpy.py,sha256=JINqSEMFoNpptE4f3h6ZzTYW1rBx90KkaoQzltSg-No,4692
1084
- TDCRPy-1.12.12.dist-info/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
1085
- TDCRPy-1.12.12.dist-info/METADATA,sha256=69f5ox0Jet4v5ocTEhc7tcDml7F_QKW0LyU_yqZKt7o,15833
1086
- TDCRPy-1.12.12.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
1087
- TDCRPy-1.12.12.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
1088
- TDCRPy-1.12.12.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,7 +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"
172
+ temp_dir = tempfile.gettempdir()
173
+ recfile1 = os.path.join(temp_dir, "Temp_E0.txt")
171
174
  header_content1 = """# TDCRPy output: inital energies from nuclear decays
172
175
  # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
173
176
  # Column 2: Energy in eV (> ECNUC)
@@ -176,9 +179,9 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
176
179
  # Column 5: Particle age in seconds (since decay started)
177
180
  # 2 3 4 5
178
181
  """
179
- with open(recfile1, "w") as file: file.write(header_content1)
182
+ with open(recfile1, 'w') as file: file.write(header_content1)
180
183
 
181
- recfile2 = "recordFiles/"+Rad+"_"+pmf_1+"_"+str(N)+".dhf2"
184
+ recfile2 = os.path.join(temp_dir, "Temp_E1.txt")
182
185
  header_content2 = """# TDCRPy output: deposited energies from nuclear decays
183
186
  # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
184
187
  # Column 2: Energy in eV (> ECNUC)
@@ -189,7 +192,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
189
192
  """
190
193
  with open(recfile2, "w") as file: file.write(header_content2)
191
194
 
192
- recfile3 = "recordFiles/"+Rad+"_"+pmf_1+"_"+str(N)+".dhf3"
195
+ recfile3 = os.path.join(temp_dir, "Temp_E2.txt")
193
196
  header_content3 = """# TDCRPy output: deposited quenched energies from nuclear decays
194
197
  # Column 1: KPAR (1=electron, 2=photon, 3=positron, 4=alpha)
195
198
  # Column 2: Energy in eV (> ECNUC)
@@ -207,7 +210,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
207
210
  # Column 4: detection probability if triple coincidences
208
211
  # 2 3 4
209
212
  """
210
- recfile4 = "recordFiles/"+Rad+"_"+pmf_1+"_"+str(N)+".dhf4"
213
+ recfile4 = os.path.join(temp_dir, "Temp_E3.txt")
211
214
  with open(recfile4, "w") as file: file.write(header_content4)
212
215
 
213
216
  if barp: tl.display_header()
@@ -1068,22 +1071,22 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
1068
1071
 
1069
1072
  # print(out)
1070
1073
 
1071
- L = 1
1072
- TD = 0.977667386529166
1073
- TAB = 0.992232838598821
1074
- TBC = 0.992343419459002
1075
- TAC = 0.99275350064608
1076
- Rad="Lu-177"
1077
- pmf_1="1"
1078
- N = 1000
1079
- kB =1.0e-5
1080
- V = 10
1081
- mode = "eff"
1082
- mode2 = "sym"
1074
+ # L = 1
1075
+ # TD = 0.977667386529166
1076
+ # TAB = 0.992232838598821
1077
+ # TBC = 0.992343419459002
1078
+ # TAC = 0.99275350064608
1079
+ # Rad="Lu-177"
1080
+ # pmf_1="1"
1081
+ # N = 1000
1082
+ # kB =1.0e-5
1083
+ # V = 10
1084
+ # mode = "eff"
1085
+ # mode2 = "sym"
1083
1086
 
1084
- # out = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=True, barp=False,uncData=False)
1085
- # print("TDCR", out[4]/out[2])
1086
- # 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])
1087
1090
 
1088
1091
 
1089
- 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)
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: