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
7c30bed9
Commit
7c30bed9
authored
1 year ago
by
Loïc Le Guyader
Browse files
Options
Downloads
Patches
Plain Diff
Split CHEM and FFT database
parent
4abd70c8
Branches
CHEM-BOZ
No related tags found
1 merge request
!24
Adjust bounds and split databases
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/BOZcalc/BOZcalc.py
+52
-5
52 additions, 5 deletions
src/BOZcalc/BOZcalc.py
with
52 additions
and
5 deletions
src/BOZcalc/BOZcalc.py
+
52
−
5
View file @
7c30bed9
...
...
@@ -27,7 +27,7 @@ from BOZcalc.GeoBeams import GeoBeams
SampleN
=
7
# Database of existing zone plates parameters
BOZ_db
=
{
BOZ_
FFT_
db
=
{
'
Custom
'
:
{
'
design_nrj
'
:
860
,
'
BOZwH
'
:
1
,
...
...
@@ -100,6 +100,38 @@ BOZ_db = {
}
}
BOZ_CHEM_db
=
{
'
Custom
'
:
{
'
design_nrj
'
:
860
,
'
BOZwH
'
:
0.8
,
'
BOZwV
'
:
1.0
,
'
BOZoffaxis
'
:
0.75
,
'
grating
'
:
3.1
,
'
F_x
'
:
0.26
,
'
F_y
'
:
0.32
,
'
3beams
'
:
True
},
'
Fe
'
:
{
'
design_nrj
'
:
715
,
'
BOZwH
'
:
0.8
,
'
BOZwV
'
:
1.0
,
'
BOZoffaxis
'
:
0.75
,
'
grating
'
:
3.1
,
'
F_x
'
:
0.26
,
'
F_y
'
:
0.32
,
'
3beams
'
:
True
},
'
Co
'
:
{
'
design_nrj
'
:
785
,
'
BOZwH
'
:
0.8
,
'
BOZwV
'
:
1.0
,
'
BOZoffaxis
'
:
0.75
,
'
grating
'
:
3.1
,
'
F_x
'
:
0.26
,
'
F_y
'
:
0.32
,
'
3beams
'
:
True
},
}
class
BOZcalc
():
def
__init__
(
self
):
...
...
@@ -740,7 +772,7 @@ class BOZcalc():
# BOZ part
self
.
widgets
[
'
Type
'
]
=
widgets
.
Dropdown
(
options
=
list
(
BOZ_db
),
options
=
list
(
BOZ_
FFT_
db
),
value
=
'
Custom
'
,
description
=
'
Type:
'
,
style
=
style
,
...
...
@@ -748,7 +780,11 @@ class BOZcalc():
)
def
BOZtype
(
change
):
v
=
BOZ_db
[
change
.
new
]
if
self
.
widgets
[
'
EndStation
'
].
value
==
'
FFT
'
:
v
=
BOZ_FFT_db
[
change
.
new
]
else
:
v
=
BOZ_CHEM_db
[
change
.
new
]
self
.
widgets
[
'
nrjD
'
].
value
=
v
[
'
design_nrj
'
]
self
.
widgets
[
'
BOZwH
'
].
value
=
v
[
'
BOZwH
'
]
self
.
widgets
[
'
BOZwV
'
].
value
=
v
[
'
BOZwV
'
]
...
...
@@ -772,6 +808,16 @@ class BOZcalc():
disabled
=
False
)
def
switchdb
(
change
):
if
change
.
new
==
'
FFT
'
:
db
=
BOZ_FFT_db
else
:
db
=
BOZ_CHEM_db
self
.
widgets
[
'
Type
'
].
options
=
list
(
db
)
self
.
widgets
[
'
EndStation
'
].
observe
(
switchdb
,
names
=
'
value
'
)
# hidden nominal zone plate focus
self
.
widgets
[
'
F_x
'
]
=
widgets
.
BoundedFloatText
(
value
=
0.25
,
...
...
@@ -866,8 +912,8 @@ class BOZcalc():
self
.
widgets
[
'
dr_label_y
'
]
=
widgets
.
Label
(
value
=
'
dr_y
'
)
self
.
widgets
[
'
d_label
'
]
=
widgets
.
Label
(
value
=
'
dr
'
)
BOZTab
=
VBox
([
HBox
([
self
.
widgets
[
'
Type
'
],
self
.
widgets
[
'
EndStation
'
]]),
HBox
([
self
.
widgets
[
'
EndStation
'
],
self
.
widgets
[
'
Type
'
]]),
HBox
([
self
.
widgets
[
'
nrjD
'
],
self
.
widgets
[
'
F_x
'
],
self
.
widgets
[
'
F_y
'
]
...
...
@@ -877,6 +923,7 @@ class BOZcalc():
self
.
widgets
[
'
3beams
'
]]),
HBox
([
self
.
widgets
[
'
dr_label_x
'
],
self
.
widgets
[
'
dr_label_y
'
]]),
self
.
widgets
[
'
d_label
'
],
HBox
([
widgets
.
Label
(
value
=
'
Optics (mm):
'
),
self
.
widgets
[
'
BOZwH
'
],
self
.
widgets
[
'
BOZwV
'
]]),
...
...
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