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

Split CHEM and FFT database

parent 4abd70c8
Branches CHEM-BOZ
No related tags found
1 merge request!24Adjust bounds and split databases
......@@ -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']]),
......
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