Skip to content
Snippets Groups Projects
Commit 4b6b8408 authored by Loïc Le Guyader's avatar Loïc Le Guyader
Browse files

Merge branch 'dr' into 'master'

Fix outer zone width calculation

Closes #2

See merge request SCS/tzpgcalc!6
parents 730e7c6a db8eb661
No related branches found
No related tags found
1 merge request!6Fix outer zone width calculation
......@@ -17,7 +17,7 @@ from ipywidgets import HBox, VBox, Layout
from IPython.display import display
# zone plate focal length
F = 250*1e-3 # [m]
F0 = 250*1e-3 # [m]
# Z position of the zone plate optic from the first interaction point (sample Z stage at 0 mm)
Z0 = 230*1e-3 # [m]
......@@ -25,7 +25,7 @@ Z0 = 230*1e-3 # [m]
# zone plate nominal focal sorthened by the KBS focusing
d = 3.3 - Z0 # distance between HFM and TZPG
f1 = 7.3 # HFM focus 2 m behind second interaction point
F = F*(d-f1)/(d-f1-F)
F = F0*(d-f1)/(d-f1-F0)
KBS_F = f1 - d # KBS focus distance from TZPG
# number of membrane to show
......@@ -363,14 +363,18 @@ class TZPGcalc():
self.d_label.value = f'Grating Pitch:{int(np.round(d_nominal*1e9))} nm'
rn = TZPGwV + TZPGo
dr_nominal = wl * F / (2*rn)
dr_nominal = wl * F0 / (2*np.sqrt(rn**2 + (TZPGwV/2)**2))
self.dr_label.value = f'Outer Zone Plate width dr:{int(np.round(dr_nominal*1e9))} nm'
# configuration for the low energy and high energy photon
confL = {'F':(2*rn)*dr_nominal/wlL,
F0_temp = (2*np.sqrt(rn**2 + (TZPGwV/2)**2))*dr_nominal/wlL
F_temp = F0_temp*(d-f1)/(d-f1-F0_temp)
confL = {'F':F_temp,
'theta_grating':np.arcsin(wlL/d_nominal),
'TZPGwH':TZPGwH, 'TZPGwV':TZPGwV, 'TZPGo':TZPGo}
confH = {'F':(2*rn)*dr_nominal/wlH,
F0_temp = (2*np.sqrt(rn**2 + (TZPGwV/2)**2))*dr_nominal/wlH
F_temp = F0_temp*(d-f1)/(d-f1-F0_temp)
confH = {'F':F_temp,
'theta_grating':np.arcsin(wlH/d_nominal),
'TZPGwH':TZPGwH, 'TZPGwV':TZPGwV, 'TZPGo':TZPGo}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment