-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBSF.py
33 lines (25 loc) · 1.38 KB
/
BSF.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import numpy as np
def BSF(E,X,Y):
# this function determines the backscattering factors based on experimental data from (Zavgorodni et al, 20014)
field_sizes = [1,2,3,6,10,15,25,40] # from (Zavgorodni et al, 20014)
BSF = {}
BSF[6] = np.array([
[0.988, 0.988, 0.988, 0.988, 0.988, 0.988, 0.988, 0.989],
[0.998, 0.999, 0.999, 0.999, 0.999, 0.999, 1.000, 1.000],
[0.998, 0.999, 0.999, 0.999, 0.999, 1.000, 1.000, 1.000],
[0.999, 0.999, 0.999, 1.000, 1.000, 1.000, 1.001, 1.001],
[0.999, 0.999, 1.000, 1.000, 1.000, 1.001, 1.001, 1.001],
[1.000, 1.000, 1.001, 1.001, 1.001, 1.001, 1.002, 1.002],
[1.001, 1.001, 1.001, 1.002, 1.002, 1.002, 1.002, 1.003]]) # from (Zavgorodni et al, 20014)
BSF[10] = np.array([
[0.993, 0.993, 0.993, 0.993, 0.993, 0.993, 0.994, 0.994],
[0.998, 0.998, 0.998, 0.998, 0.998, 0.999, 0.999, 0.999],
[0.998, 0.998, 0.999, 0.999, 0.999, 1.000, 1.000, 1.000],
[0.999, 0.999, 0.999, 1.000, 1.000, 1.000, 1.001, 1.001],
[1.000, 1.000, 1.001, 1.001, 1.001, 1.002, 1.002, 1.002],
[1.001, 1.001, 1.002, 1.003, 1.003, 1.004, 1.004, 1.005]]) # from (Zavgorodni et al, 20014)
JawX = min(field_sizes, key=lambda x: abs(x - X))
JawY = min(field_sizes, key=lambda x: abs(x - Y))
index_JawX = field_sizes.index(JawX)
index_JawY = field_sizes.index(JawY)
return BSF[E][index_JawY,index_JawX]