TDCRPy 1.10.0__py3-none-any.whl → 1.11.1__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 CHANGED
@@ -758,7 +758,7 @@ def stoppingpower(e,rho=RHO,Z=Z,A=A,emin=0,file=data_TanXia_f):
758
758
 
759
759
  #==================== Fonction pour lire BetaShape ========================================
760
760
 
761
- def readBetaShape(rad,mode,level,z=z_betashape):
761
+ def readBetaShape(rad,mode,level,z=z_betashape,contH=True):
762
762
  """
763
763
  This funcion reads the beta spectra calculated by the code BetaShape and published in the DDEP web page.
764
764
 
@@ -809,7 +809,7 @@ def readBetaShape(rad,mode,level,z=z_betashape):
809
809
  data.remove([])
810
810
 
811
811
  for i in range(len(data)):
812
- ind = i
812
+ # ind = i
813
813
  if data[i][0] == 'E(keV)':break
814
814
 
815
815
  for j in range(i+1,len(data)):
@@ -823,7 +823,7 @@ def readBetaShape(rad,mode,level,z=z_betashape):
823
823
  else:
824
824
  p.append(p0 * (e[k]-e[k-1]))
825
825
 
826
- e=(np.asarray(e[:-1])+np.asarray(e[1:]))/2 # deal with the continuity hypothesis
826
+ if contH: e=(np.asarray(e[:-1])+np.asarray(e[1:]))/2 # deal with the continuity hypothesis
827
827
  p.pop(-1)
828
828
  p /= sum(np.asarray(p)) # normalization
829
829
  p = list(p); e = list(e)
@@ -2667,6 +2667,11 @@ def buildBetaSpectra(rad, V, N, prt=False):
2667
2667
  with open(file_path, "w") as file:
2668
2668
  for i, b in enumerate(bin_centers):
2669
2669
  file.write(f"{b}\t{p2[i]}\n")
2670
+ print("file written in distrib.")
2671
+ with open(f"./MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_{rad}.txt", "w") as file:
2672
+ for i, b in enumerate(bin_centers):
2673
+ file.write(f"{b}\t{p2[i]}\n")
2674
+ print("file written in local")
2670
2675
 
2671
2676
 
2672
2677
  # N = 1e7
Binary file