TDCRPy 1.3.0__py3-none-any.whl → 1.5.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/TDCR_model_lib.py CHANGED
@@ -76,7 +76,8 @@ with importlib.resources.as_file(files('tdcrpy').joinpath('MCNP-MATRIX')) as dat
76
76
  fe2 = data_path / 'matrice/fichier/matrice_10ml-beta-_200_2000k.txt' # electron-10ml-200-2000keV-niveau 1
77
77
  fe3 = data_path / 'matrice/fichier/matrice_10ml-beta-_2000_10000k.txt' # electron-10ml-2000-10000keV-niveau 2
78
78
  fe4 = data_path / 'matrice/fichier/matrice_16ml-beta-_1_200k.txt' # electron-16ml-1-200keV-niveau 0
79
- fe5 = data_path / 'matrice/fichier/matrice_16ml-beta-_200_2000k.txt' # electron-16ml-1-200keV-niveau 1
79
+ fe5 = data_path / 'matrice/fichier/matrice_16ml-beta-_200_2000k.txt' # electron-16ml-200-2000keV-niveau 1
80
+ fe6 = data_path / 'matrice/fichier/matrice_16ml-beta-_2000_10000k.txt' # electron-16ml-2000-10000keV-niveau 2
80
81
  fe = data_path / 'matrice/fichier/E_depose.txt' # electron-10ml-énergie-niveau 'e'
81
82
 
82
83
  # import beta spectra calculated for the analytical model (BetaShape + MCNP6 calculation)
@@ -999,6 +1000,7 @@ Matrice10_e_2 = read_matrice(fe2,1)
999
1000
  Matrice10_e_3 = read_matrice(fe3,2)
1000
1001
  Matrice16_e_1 = read_matrice(fe4,0)
1001
1002
  Matrice16_e_2 = read_matrice(fe5,1)
1003
+ Matrice16_e_3 = read_matrice(fe6,2)
1002
1004
  #Matrice_e = read_matrice(fe,'e')
1003
1005
 
1004
1006
  def energie_dep_gamma(e_inci,v,matrice10_1=Matrice10_p_1,matrice10_2=Matrice10_p_2,matrice10_3=Matrice10_p_3,matrice16_1=Matrice16_p_1,matrice16_2=Matrice16_p_2,matrice16_3=Matrice16_p_3,ed=Matrice_e):
@@ -1144,28 +1146,7 @@ def energie_dep_gamma2(e_inci,v,matrice10_1=Matrice10_p_1,matrice10_2=Matrice10_
1144
1146
  if result > e_inci: result = e_inci
1145
1147
  return result
1146
1148
 
1147
- def energie_dep_beta(e_inci,*,matrice10_1=Matrice10_e_1,matrice10_2=Matrice10_e_2,matrice10_3=Matrice10_e_3,matrice16_1=Matrice16_e_1,ed=Matrice_e):
1148
- """ This function samples the energy deposited by an electron in the scintillator using response calculated by the Monte-Carlo code MCNP6.
1149
-
1150
- Parameters
1151
- ----------
1152
- e_inci : float
1153
- energy of the electron in keV.
1154
- matrice10_1 : list[list], optional
1155
- response matrix for electrons in the range [1-200] keV and for a scintillator volume of 10 ml.
1156
- matrice10_2 : list[list], optional
1157
- response matrix for electrons in the range [200-2000] keV and for a scintillator volume of 10 ml.
1158
- matrice10_3 : list[list], optional
1159
- response matrix for electrons in the range [2000-10000] keV and for a scintillator volume of 10 ml.
1160
- ed : list[list], optional
1161
- matrix of input energies. column 0: [1-200] keV; column 1: [200-2000] keV; column 2: [2000-10000] keV
1162
-
1163
- Returns
1164
- -------
1165
- result : float
1166
- deposited energy in keV.
1167
-
1168
- """
1149
+ def energie_dep_beta(e_inci,*,matrice10_1=Matrice10_e_1,matrice10_2=Matrice10_e_2,matrice10_3=Matrice10_e_3,matrice16_1=Matrice16_e_1,matrice16_2=Matrice16_e_2,ed=Matrice_e):
1169
1150
  ## sort keV / entrée : keV
1170
1151
  if e_inci <= 200:
1171
1152
  if e_inci < 1:
@@ -1197,7 +1178,7 @@ def energie_dep_beta(e_inci,*,matrice10_1=Matrice10_e_1,matrice10_2=Matrice10_e_
1197
1178
  return result
1198
1179
 
1199
1180
 
1200
- def energie_dep_beta2(e_inci,*,matrice10_1=Matrice10_e_1,matrice10_2=Matrice10_e_2,matrice10_3=Matrice10_e_3,matrice16_1=Matrice16_e_1,ed=Matrice_e):
1181
+ def energie_dep_beta2(e_inci,v,matrice10_1=Matrice10_e_1,matrice10_2=Matrice10_e_2,matrice10_3=Matrice10_e_3,matrice16_1=Matrice16_e_1,matrice16_2=Matrice16_e_2,matrice16_3=Matrice16_e_3,ed=Matrice_e):
1201
1182
  """ This function samples the energy deposited by an electron in the scintillator using response calculated by the Monte-Carlo code MCNP6.
1202
1183
 
1203
1184
  Parameters
@@ -1225,25 +1206,44 @@ def energie_dep_beta2(e_inci,*,matrice10_1=Matrice10_e_1,matrice10_2=Matrice10_e
1225
1206
  index = 0 # index de colonne de la matrice de l'énergie incidente la plus proche
1226
1207
  else:
1227
1208
  index = int(e_inci)-1
1228
- matrice = matrice10_1[1:,index]
1229
- matrice0 = matrice10_1[0,index]
1209
+
1210
+ if v == 10:
1211
+ matrice = matrice10_1[1:,index]
1212
+ matrice0 = matrice10_1[0,index]
1213
+ elif v == 16:
1214
+ matrice = matrice16_1[1:,index]
1215
+ matrice0 = matrice16_1[0,index]
1216
+ else:
1217
+ matrice = (matrice16_1[1:,index]-matrice10_1[1:,index])*v/6 + (matrice10_1[1:,index]-(matrice16_1[1:,index]-matrice10_1[1:,index])*10/6)
1218
+ matrice0 = (matrice16_1[0,index]-matrice10_1[0,index])*v/6 + (matrice10_1[0,index]-(matrice16_1[0,index]-matrice10_1[0,index])*10/6)
1230
1219
  e = ed[:,0]
1231
1220
 
1232
1221
  elif e_inci <= 2000:
1233
1222
  index = int((e_inci-200)/2)
1234
- #doc = 'MCNP-MATRIX/matrice/matrice_p_200_2000k.txt'
1235
- matrice = matrice10_2[1:,index]
1236
- matrice0 = matrice10_2[0,index]
1237
- #taille_x = 901
1223
+ if v == 10:
1224
+ matrice = matrice10_2[1:,index]
1225
+ matrice0 = matrice10_2[0,index]
1226
+ elif v == 16:
1227
+ matrice = matrice16_2[1:,index]
1228
+ matrice0 = matrice16_2[0,index]
1229
+ else:
1230
+ matrice = (matrice16_2[1:,index]-matrice10_2[1:,index])*v/6 + (matrice10_2[1:,index]-(matrice16_2[1:,index]-matrice10_2[1:,index])*10/6)
1231
+ matrice0 = (matrice16_2[0,index]-matrice10_2[0,index])*v/6 + (matrice10_2[0,index]-(matrice16_2[0,index]-matrice10_2[0,index])*10/6)
1238
1232
  e = ed[:,1]
1239
1233
 
1240
1234
  else:
1241
1235
  index = (int(e_inci)-2000)//10
1242
- #doc = 'MCNP-MATRIX/matrice/matrice_p_2000_10000k.txt'
1243
- matrice = matrice10_3[1:,index]
1244
- matrice0 = matrice10_3[0,index]
1245
- #taille_x = 801
1236
+ if v == 10:
1237
+ matrice = matrice10_3[1:,index]
1238
+ matrice0 = matrice10_3[0,index]
1239
+ elif v == 16:
1240
+ matrice = matrice16_3[1:,index]
1241
+ matrice0 = matrice16_3[0,index]
1242
+ else:
1243
+ matrice = (matrice16_3[1:,index]-matrice10_3[1:,index])*v/6 + (matrice10_3[1:,index]-(matrice16_3[1:,index]-matrice10_3[1:,index])*10/6)
1244
+ matrice0 = (matrice16_3[0,index]-matrice10_3[0,index])*v/6 + (matrice10_3[0,index]-(matrice16_3[0,index]-matrice10_3[0,index])*10/6)
1246
1245
  e = ed[:,2]
1246
+
1247
1247
 
1248
1248
  inde = sampling(matrice)
1249
1249
  if inde == 1 : result = 0
@@ -1253,6 +1253,7 @@ def energie_dep_beta2(e_inci,*,matrice10_1=Matrice10_e_1,matrice10_2=Matrice10_e
1253
1253
  return result
1254
1254
 
1255
1255
 
1256
+
1256
1257
  def writeEffcurves(x,y,uy,rad,p,kB,SDT):
1257
1258
  """
1258
1259
  This function writes efficiency curves
File without changes