ver0.3
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -40,14 +40,14 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 68,
|
||||
"execution_count": 4,
|
||||
"id": "5c5feaae-861c-4277-9dd5-aee373b3c174",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"application/vnd.jupyter.widget-view+json": {
|
||||
"model_id": "3910cf673b40428cbbaaa2a78bfa0200",
|
||||
"model_id": "37bb53443b8a4d50bb614d7156907632",
|
||||
"version_major": 2,
|
||||
"version_minor": 0
|
||||
},
|
||||
@ -73,7 +73,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 67,
|
||||
"execution_count": 3,
|
||||
"id": "fecbecdb-0fac-4ac8-a2b3-1ccb3f869a77",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@ -213,15 +213,17 @@
|
||||
"check2name = widg.Checkbox(value=False,description='Resolution gain (ITR)',disabled=False, indent=False,layout=widg.Layout(grid_area='check2name'))\n",
|
||||
"check3name = widg.Checkbox(value=True, description='Recon. box coverage (ITR)',disabled=False, indent=False,layout=widg.Layout(grid_area='check3name'))\n",
|
||||
"check4name = widg.IntSlider(value=70, min=0 ,max=100, step=5, description='Beam overlap (%):', disabled=False, continuous_update=False, orientation='horizontal', readout=True,readout_format='d', layout=widg.Layout(grid_area='check4name', width = '100%'),style=style)\n",
|
||||
"check6name = widg.Checkbox(value=False, description='Overall sampling (ITR)', disabled=False, indent=False,layout=widg.Layout(grid_area='check6name'), style=style)\n",
|
||||
"check6name = widg.BoundedIntText(value=1,min=1,max=20,step=1, description='Overall sampling (ITR)', disabled=False,continuous_update=False,orientation='horizontal',readout=True, readout_format='d', layout=widg.Layout(grid_area='check6name', width = '100%'), style=style)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"### Layout\n",
|
||||
"graph_controls = widg.GridBox(children=[sample_set, ctf_set, ctf_xaxis, element, beam_pos, fov_show, cl_set, overlap_fig, red_box, box_col, check0name, check1name, check2name, check3name,check4name, check6name, ctf_xaxis_name],\n",
|
||||
" layout=widg.Layout(width='109%', grid_template_rows='35px 35px 35px 35px 5px', grid_template_columns='4% 3.5% 14% 1.5% 8% 8% 8% 1% 27% 13%', grid_template_areas='''\n",
|
||||
" layout=widg.Layout(width='109%', grid_template_rows='35px 35px 35px 35px 5px', grid_template_columns='4% 3.5% 14% 1.5% 8% 8% 8% 1% 26% 14%', grid_template_areas='''\n",
|
||||
" \". ctf_set ctf_set . sample_set overlap_fig overlap_fig . cl_set cl_set \" \n",
|
||||
" \". ctf_xaxis_name ctxaxis . fov_show fov_show fov_show . check0name check2name \"\n",
|
||||
" \". ctf_element ctf_element . beam_pos beam_pos beam_pos . check4name check6name \"\n",
|
||||
" \". . . . red_box red_box box_col . check1name check3name \"\n",
|
||||
" \". ctf_element ctf_element . beam_pos beam_pos beam_pos . check4name check3name \"\n",
|
||||
" \". . . . red_box red_box box_col . check1name check6name \"\n",
|
||||
" \". . . . . . . . . . \"'''))\n",
|
||||
"\n",
|
||||
"def ptycho_interact(beam_energy, aperture, aperture_res, aperture_res2, probe_size, cl, matrix, defocus, mag, camera, binning, dwell_time, restr, method,\n",
|
||||
@ -252,7 +254,8 @@
|
||||
" probe_window = (wavelength*cl_det/100)/(size_pixel/1e6)/1000 # now in nm\n",
|
||||
" oversampling = (wavelength/1000)/(2*pixel_angle/1000*step_size_corr)\n",
|
||||
" max_defocus = (probe_window/4)/np.tan(semi_angle_corr/1000)\n",
|
||||
"\n",
|
||||
" z_res = wavelength/(2*np.sin(detector_cover/1000/2)*np.sin(detector_cover/1000/2))/100 # now in A\n",
|
||||
" \n",
|
||||
" ### ALL CAMERA LENGTHS PARAMETERS\n",
|
||||
" cl_all = pty.load_cameralengths(camera, \"nominal\")\n",
|
||||
" cl_eff_all = pty.load_cameralengths(camera, \"effective\")\n",
|
||||
@ -276,7 +279,7 @@
|
||||
" max_defocus_all = (usable_probe_semi_window_all)/np.tan(semi_angle_corr/1000)\n",
|
||||
" max_defocus_all[max_defocus_all < 0] = 'nan'\n",
|
||||
" oversampling_all = (wavelength/1000)/(2*pixel_covers/1000*step_size_corr)\n",
|
||||
"\n",
|
||||
" z_res_all = wavelength/(2*np.sin(detector_cover_all/1000/2)*np.sin(detector_cover_all/1000/2))/100 # now in A\n",
|
||||
"\n",
|
||||
" ### MICROSCOPE SCHEME\n",
|
||||
" width = 550 # in-graph setting\n",
|
||||
@ -387,7 +390,7 @@
|
||||
" if method == 'ssb':\n",
|
||||
" omega, pctf = pty.get_ssb_ctf()\n",
|
||||
" xx = wavelength/(np.sin(semi_angle_corr*omega/1000))/100\n",
|
||||
" fig1.add_trace(go.Scatter(showlegend=True, x=[-1], y=[-1],marker_size=12, marker_color='green', name='Rec step '+str(np.round(xx[-1]/3,2))+' Å')) \n",
|
||||
" fig1.add_trace(go.Scatter(showlegend=True, x=[-100], y=[-100],marker_size=12, marker_color='green', name='Rec step '+str(np.round(xx[-1]/3,2))+' Å')) \n",
|
||||
" fig1.update_layout(legend=dict(orientation=\"v\",yanchor=\"bottom\",y=1.0,xanchor=\"right\",x=0.9))\n",
|
||||
"\n",
|
||||
" fig1.add_trace(go.Scatter(showlegend=False, x = -fov_show/2*np.ones(len(yyy)), y=yyy, opacity=1,mode='markers',marker_symbol = \"triangle-down\",marker=dict(size=20, color=yyy, colorscale='rainbow_r', showscale=False)),secondary_y=True) \n",
|
||||
@ -620,36 +623,40 @@
|
||||
"\n",
|
||||
" ### CAMERA LENGTH TABLE\n",
|
||||
" dictionary = {}\n",
|
||||
" tab = np.array([cl_all, np.round(ptycho_pixel_size_all,2), np.round(detector_cover_all,1), np.round(detector_cover_a_all,1), np.round(probe_window_all,1), np.round(oversampling_all,1)])\n",
|
||||
" tab = np.array([cl_all, np.round(ptycho_pixel_size_all,2), np.round(z_res_all,2), np.round(detector_cover_all,1), np.round(detector_cover_a_all,1), np.round(probe_window_all,1), np.round(oversampling_all,1)])\n",
|
||||
" \n",
|
||||
" for i in range(0,len(cl_eff_all)):\n",
|
||||
" button_style = 'success'\n",
|
||||
" icons=['','','','','','']\n",
|
||||
" data = tab[:,int(i)] # 0.cl, 1. ptycho pix, 2.det cov 3.det cov a, 4.max def, 5.probe window, 6.oversampling\n",
|
||||
" icons=['','','','','','','']\n",
|
||||
" data = tab[:,int(i)] # 0.cl, 1. ptycho pix xy, 2. ptycho pix z, 3.det cov, 4.det cov a, 5.max def, 6.probe window, 7.oversampling\n",
|
||||
" \n",
|
||||
" if cl == data[0]:\n",
|
||||
" icons=['hand-point-left','','','','',''] \n",
|
||||
" icons=['hand-point-left','','','','','',''] \n",
|
||||
" if check2name == True and data[1] > step_size_corr*10: # check2name = 'Ptycho pixel < step size'\n",
|
||||
" icons=['','bell','','','',''] \n",
|
||||
" icons=['','bell','','','','',''] \n",
|
||||
" button_style = 'warning'\n",
|
||||
" if data[2] > 1000*np.radians(check1name): # check1name = 'Low anlge approximation'\n",
|
||||
" icons=['','','bell','','',''] \n",
|
||||
" if data[3] > 1000*np.radians(check1name): # check1name = 'Low anlge approximation'\n",
|
||||
" icons=['','','','bell','','',''] \n",
|
||||
" button_style = 'warning' \n",
|
||||
" if data[3] < check0name[0] or data[3] > check0name[1]: # 'Detector cover'\n",
|
||||
" icons=['','','','bell','',''] \n",
|
||||
" \n",
|
||||
" if data[4] < check0name[0] or data[4] > check0name[1]: # 'Detector cover'\n",
|
||||
" icons=['','','','','bell','',''] \n",
|
||||
" button_style = 'warning'\n",
|
||||
" if check3name == True and beam_diameter > data[4]/2 and beam_diameter < data[4]:\n",
|
||||
" icons=['','','','','','bell'] \n",
|
||||
" if check3name == True and beam_diameter > data[5]/2 and beam_diameter < data[5]:\n",
|
||||
" icons=['','','','','','bell',''] \n",
|
||||
" button_style = 'warning'\n",
|
||||
" if check3name == True and beam_diameter > data[4]:\n",
|
||||
" icons=['','','','','','ban'] \n",
|
||||
" if check3name == True and beam_diameter > data[5]:\n",
|
||||
" icons=['','','','','','ban',''] \n",
|
||||
" button_style = 'danger'\n",
|
||||
" if check6name == True and data[5] < 1: # check6name = 'Sampling > 1' \n",
|
||||
" icons=['','','','','ban',''] \n",
|
||||
" button_style = 'danger' \n",
|
||||
" if data[6] < 1: # check6name = 'Sampling > 1' \n",
|
||||
" icons=['','','','','','','ban'] \n",
|
||||
" button_style = 'danger' \n",
|
||||
" if data[6] > 1 and data[6] < int(check6name): # check6name = 'Sampling > check6name' \n",
|
||||
" icons=['','','','','','','bell'] \n",
|
||||
" button_style = 'warning' \n",
|
||||
" dictionary[i] = widg.ToggleButtons(options=tuple(data), text_color= 'red', button_style=button_style, icons = icons, layout=widg.Layout(width=str(int(graph_size/100*65))+'px'),\n",
|
||||
" style = {'description_width': '0px','button_width': str(int(graph_size/100*63))+'px'}, disabled=True)\n",
|
||||
" legend = widg.ToggleButtons(options=['Nominal CL (cm)','Recon. pixel size (Å)','Detector cover (mrad)','Detector cover (α)', 'Probe box (nm)', 'Overall sampling'],\n",
|
||||
" legend = widg.ToggleButtons(options=['Nominal CL (cm)','Resolution XY (Å)','Resolution Z (Å)', 'Detector cover (mrad)','Detector cover (α)', 'Reconstr. box (nm)', 'Overall sampling'],\n",
|
||||
" button_style='', layout=widg.Layout(width='150px'), style = {'description_width': '0px','button_width': \"150px\"}, disabled=True) \n",
|
||||
" \n",
|
||||
" # FIX here\n",
|
||||
@ -678,7 +685,7 @@
|
||||
" cltab = widg.HBox([legend, dictionary[0], dictionary[1], dictionary[2], dictionary[3], dictionary[4], dictionary[5], dictionary[6], dictionary[7], dictionary[8], dictionary[9], dictionary[10]])\n",
|
||||
"\n",
|
||||
" cltab = widg.VBox([widg.Label('CAMERA LENGTH GUIDE'), cltab])\n",
|
||||
" cltab.layout = widg.Layout(border='solid 0px gray',margin='10px 0px 10px 25px', padding='5px 5px 5px 5px')\n",
|
||||
" cltab.layout = widg.Layout(border='solid 0px gray',margin='0px 0px 0px 0px', padding='5px 5px 5px 5px')\n",
|
||||
"\n",
|
||||
" ### SHOWING\n",
|
||||
" match method: \n",
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
### Packages import
|
||||
import numpy as np
|
||||
from copy import deepcopy
|
||||
|
Reference in New Issue
Block a user