Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BOZcalc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCS
BOZcalc
Commits
02196291
Commit
02196291
authored
4 years ago
by
Loïc Le Guyader
Browse files
Options
Downloads
Patches
Plain Diff
Database of optics for quick selection
parent
fff75ab7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
TZPGcalc.py
+62
-8
62 additions, 8 deletions
TZPGcalc.py
with
62 additions
and
8 deletions
TZPGcalc.py
+
62
−
8
View file @
02196291
...
@@ -31,6 +31,39 @@ KBS_F = f1 - d # KBS focus distance from TZPG
...
@@ -31,6 +31,39 @@ KBS_F = f1 - d # KBS focus distance from TZPG
# number of membrane to show
# number of membrane to show
SampleN
=
7
SampleN
=
7
TZPG_db
=
{
'
Custom
'
:
{
'
design_nrj
'
:
860
,
'
TZPGwH
'
:
1
,
'
TZPGwV
'
:
1
,
'
TZPGoffaxis
'
:
0.75
,
'
grating
'
:
3.8
},
'
O
'
:
{
'
design_nrj
'
:
530
,
'
TZPGwH
'
:
0.8
,
'
TZPGwV
'
:
0.8
,
'
TZPGoffaxis
'
:
0.55
,
'
grating
'
:
3.1
},
'
Fe
'
:
{
'
design_nrj
'
:
715
,
'
TZPGwH
'
:
0.8
,
'
TZPGwV
'
:
0.8
,
'
TZPGoffaxis
'
:
0.55
,
'
grating
'
:
3.1
},
'
Ni
'
:
{
'
design_nrj
'
:
860
,
'
TZPGwH
'
:
0.8
,
'
TZPGwV
'
:
0.8
,
'
TZPGoffaxis
'
:
0.55
,
'
grating
'
:
3.1
},
'
Gd
'
:
{
'
design_nrj
'
:
1210
,
'
TZPGwH
'
:
0.8
,
'
TZPGwV
'
:
0.8
,
'
TZPGoffaxis
'
:
0.55
,
'
grating
'
:
3.1
},
}
class
TZPGcalc
():
class
TZPGcalc
():
def
__init__
(
self
):
def
__init__
(
self
):
self
.
initFig
()
self
.
initFig
()
...
@@ -374,6 +407,26 @@ class TZPGcalc():
...
@@ -374,6 +407,26 @@ class TZPGcalc():
self
.
UpdateFig
()
self
.
UpdateFig
()
# TZPG part
# TZPG part
self
.
type
=
widgets
.
Dropdown
(
options
=
TZPG_db
.
keys
(),
value
=
'
Custom
'
,
description
=
'
Type:
'
,
disabled
=
False
)
def
TZPGtype
(
change
):
v
=
TZPG_db
[
change
.
new
]
self
.
design_nrj_slider
.
value
=
v
[
'
design_nrj
'
]
self
.
TZPGwH_slider
.
value
=
v
[
'
TZPGwH
'
]
self
.
TZPGwV_slider
.
value
=
v
[
'
TZPGwV
'
]
self
.
TZPGoffaxis_slider
.
value
=
v
[
'
TZPGoffaxis
'
]
self
.
grating_slider
.
value
=
v
[
'
grating
'
]
# necessary to recompute grating pitch and outer zone plate width
self
.
UpdateFig
()
self
.
type
.
observe
(
TZPGtype
,
names
=
'
value
'
)
self
.
nrj_slider
=
widgets
.
FloatRangeSlider
(
self
.
nrj_slider
=
widgets
.
FloatRangeSlider
(
value
=
[
840.
,
880.
],
value
=
[
840.
,
880.
],
min
=
450.
,
min
=
450.
,
...
@@ -418,14 +471,15 @@ class TZPGcalc():
...
@@ -418,14 +471,15 @@ class TZPGcalc():
)
)
self
.
dr_label
=
widgets
.
Label
(
value
=
'
dr
'
)
self
.
dr_label
=
widgets
.
Label
(
value
=
'
dr
'
)
self
.
d_label
=
widgets
.
Label
(
value
=
'
dr
'
)
self
.
d_label
=
widgets
.
Label
(
value
=
'
dr
'
)
TZPGTab
=
VBox
(
children
=
[
HBox
([
widgets
.
Label
(
value
=
'
Energy (eV):
'
),
self
.
nrj_slider
]),
TZPGTab
=
VBox
(
children
=
[
self
.
type
,
HBox
([
widgets
.
Label
(
value
=
'
Design Energy (eV):
'
),
self
.
design_nrj_slider
]),
HBox
([
widgets
.
Label
(
value
=
'
Energy (eV):
'
),
self
.
nrj_slider
]),
HBox
([
widgets
.
Label
(
value
=
r
'
Grating $\theta$ (mrad):
'
),
self
.
grating_slider
]),
HBox
([
widgets
.
Label
(
value
=
'
Design Energy (eV):
'
),
self
.
design_nrj_slider
]),
self
.
d_label
,
self
.
dr_label
,
HBox
([
widgets
.
Label
(
value
=
r
'
Grating $\theta$ (mrad):
'
),
self
.
grating_slider
]),
HBox
([
widgets
.
Label
(
value
=
'
TZPG horiz. width (mm):
'
),
self
.
TZPGwH_slider
]),
self
.
d_label
,
self
.
dr_label
,
HBox
(
children
=
[
HBox
([
widgets
.
Label
(
value
=
'
TZPG vert. width (mm):
'
),
self
.
TZPGwV_slider
]),
HBox
([
widgets
.
Label
(
value
=
'
TZPG horiz. width (mm):
'
),
self
.
TZPGwH_slider
]),
HBox
([
widgets
.
Label
(
value
=
'
TZPG off axis (mm):
'
),
self
.
TZPGoffaxis_slider
])
HBox
(
children
=
[
HBox
([
widgets
.
Label
(
value
=
'
TZPG vert. width (mm):
'
),
self
.
TZPGwV_slider
]),
])])
HBox
([
widgets
.
Label
(
value
=
'
TZPG off axis (mm):
'
),
self
.
TZPGoffaxis_slider
])
])])
# sample part
# sample part
self
.
samz_slider
=
widgets
.
FloatSlider
(
self
.
samz_slider
=
widgets
.
FloatSlider
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment