-
Notifications
You must be signed in to change notification settings - Fork 0
/
mn_signal.py
67 lines (49 loc) · 1.66 KB
/
mn_signal.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import numpy as np
from scipy import constants as const
#Mn (alpha crystal structure)
particle_size = 100 #nm
Vnp = 4/3*np.pi*(particle_size/2)**3
Vunit = 320.085/1000 #nm**3
atoms_unit = 58
natoms = Vnp / Vunit * atoms_unit
sigma = 447.1*1e-4 #m**2/g
atomic_weight = 54.938
amu = 1.6605e-24 #g
mass_atom = amu * atomic_weight # g
sigma_atom = sigma * mass_atom * 1e12 #um**2
#Xray pulse
I0 = 100e-6 #Joule
Iev = I0 / const.e
E = 6.58e3 #photon energy
num_photons = Iev / E
focus_size = 250 #nm
fluence = num_photons * (1e-6/(focus_size*1e-9))**2
#detector
pixel_size = 75e-6
num_pixels = 1024
si_dist = 30e-2 #meter
#Parameter kalpha
det_dist_a = 1 #meter
yield_alpha = 0.31018 * (0.58134 + 0.29394)
#Parameter kbeta
det_dist_b = 1 #meter
yield_beta = 0.31018 * 0.08153
def normed_lorentzian(x, x0, a, gam):
return 1/np.pi * 1/2*gam / ((1/2*gam)**2 + (x-x0)**2)
def calc_solid(det_dist, N, pixel_size):
def calc_omega(l, b, d):
omega = 4 * np.arcsin(l * b / np.sqrt((l**2+4*d**2) * (b**2+4*d**2)))
return omega
omega = calc_omega(pixel_size*N, pixel_size, det_dist)
return omega
omega_a = calc_solid(det_dist_a, num_pixels, pixel_size)
omega_b = calc_solid(det_dist_b, num_pixels, pixel_size)
spec_a = normed_lorentzian(np.arange(1024)-512, 0, 1, 2.92/0.2)
spec_b = normed_lorentzian(np.arange(1024)-512, 0, 1, 2.97/0.28)
Ialpha = np.min([fluence * sigma_atom, 1]) * natoms * yield_alpha * (omega_a*spec_a).sum()
Ibeta = np.min([fluence * sigma_atom, 1]) * natoms * yield_beta * (omega_b*spec_b).sum()
print('Particle size: ', particle_size)
print('fluence: ', fluence)
print('natoms: ', natoms)
print('Ialpha: ', Ialpha)
print('Ibeta: ', Ibeta)