PEARL Procedures rev-distro-2.1.1-1-gf419e92-dirty Igor procedures for the analysis of PEARL data

pearl-menu.ipf
Go to the documentation of this file.
1 #pragma rtGlobals=1 // Use modern global access method.
2 #pragma ModuleName = PearlMenu
3 #pragma version = 1.02
4
5 // main menu for PEARL data acquisition and analysis packages
6
7 // $Id$
8 // author: matthias.muntwiler@psi.ch
9 // Copyright (c) 2013-14 Paul Scherrer Institut
10
11 // Licensed under the Apache License, Version 2.0 (the "License");
12 // you may not use this file except in compliance with the License.
13 // You may obtain a copy of the License at
14 // http://www.apache.org/licenses/LICENSE-2.0
15
16 menu "PEARL"
17
18 submenu "Data Files"
19 PearlMenuEnableFunc("pearl_data_explorer") + "Data Explorer", /Q, pearl_data_explorer()
20 help = {"Data explorer panel with file import and preview", "Requires ARPES package and HDF5 XOP"}
21 PearlMenuEnableFunc("ad_load_dialog") + "AD HDF5", /Q, ad_load_dialog("")
22 help = {"Import area detector HDF5 data file", "Requires ARPES package and HDF5 XOP"}
23 end
24
25 submenu "On-the-Fly Data"
26 PearlMenuEnableFunc("otf_rename_folders") + "Shorten OTF Folder Names", /Q, otf_rename_folders("010")
27 help = {"Renames otf_xxxxxx_yyyyyy_zzzz data folders to otf_yyyyyy (removing date and suffix)", "Requires Optics package"}
28 PearlMenuEnableFunc("otf_gather_batch") + "Gather OTF Batch", /Q, otf_gather_batch("current_ch1", "photonenergy", "otf_batch")
29 help = {"Copies data from all otf_* folders into otf_batch folder", "Requires Optics package"}
30 PearlMenuEnableFunc("PearlOpticsPreviewPanel") + "OTF Preview", /Q, PearlOpticsPreviewPanel()
31 help = {"Opens a preview panel for OTF data in otf_* folders", "Requires Optics package"}
32 end
33
34 submenu "Scienta Analyser"
35 PearlMenuEnableFunc("ad_display_profiles") + "Scienta Live View", /Q, PearlLiveDisplay("X03DA-SCIENTA:", "EA", "(65280,54528,48896)")
36 help = {"Display preview panel with latest image from Scienta", "Requires ARPES package and EPICS XOP"}
37 PearlMenuEnableFunc("ast_setup") + "Angle Scan Tracker", /Q, PearlAnglescanTracker("X03DA-SCIENTA:", "(65280,54528,48896)")
38 help = {"Preview of acquired angle scan data and current detection angles.", "Requires ARPES package and EPICS XOP"}
39 PearlMenuEnableFunc("sample_tracker") + "Sample Tracker", /Q, PearlSampleTracker(1)
40 help = {"Live tracking and adjustment of sample position.", "Requires ARPES package and EPICS XOP"}
41 end
42
43 submenu "Cameras"
44 PearlMenuEnableFunc("ad_display_profiles") + "Exit Slit Camera", /Q, PearlLiveDisplay("X03DA-OP-PS1:", "OP", "(65280,54528,48896)")
45 help = {"Display preview panel with latest image from Scienta", "Requires ARPES package and EPICS XOP"}
46 PearlMenuEnableFunc("ad_display_profiles") + "Manipulator Camera", /Q, PearlCameraDisplay("X03DA-ES-PS1:", "ES", "(32767,32767,32767)")
47 help = {"Display live panel of the exit slit camera", "Requires ARPES package and EPICS XOP"}
48 end
49
50 submenu "Display"
51 PearlMenuEnableFunc("ad_display_profiles") + "2D Profiles", /Q, Display2dProfiles()
52 help = {"Profiles display of 2D data", "Requires ARPES package"}
53 PearlMenuEnableFunc("ad_display_brick") + "3D Slicer", /Q, Display3dSlicer()
54 help = {"Slice and profiles display of 3D data", "Requires ARPES package"}
55 PearlMenuEnableFunc("ad_display_brick") + "3D Gizmo", /Q, DisplayGizmoSlicer()
56 help = {"Gizmo display of 3D data", "Requires ARPES package"}
57 end
58
59 submenu "Process"
60 PearlMenuEnableFunc("asp_show_panel") + "XPD scans", /Q, asp_show_panel()
61 help = {"Data processing of two-pi angle scans", "Requires ARPES package"}
62 end
63
64 submenu "Services"
65 PearlMenuEnableFunc("pearl_elog") + "Open ELOG Panel", /Q, pearl_elog("")
66 help = {"Open an ELOG panel to send entries to an ELOG logbook"}
67 end
68
69 submenu "Sample Preparation"
70 PearlMenuEnableFunc("ramp_generator") + "Annealing Ramp", /Q, ramp_generator()
71 help = {"Sample annealing ramp generator"}
72 end
73
74 submenu "Packages"
75 "Load ARPES Package", /Q, LoadPearlArpes()
76 help = {"Data processing and analysis for ARPES experiments"}
77 "Load Preparation Package", /Q, LoadPearlPreparation()
78 help = {"Process control for sample preparation"}
79 "Load Optics Package", /Q, LoadPearlOptics()
80 help = {"Data processing and analysis for beamline commissioning"}
81 end
82 end
83
89 function /s PearlMenuEnableFunc(funcname)
90 string funcname
91 if (exists(funcname) >= 3)
92 return ""
93 else
94 return "("
95 endif
96 end
97
98 function LoadPearlOptics()
99 execute /p/q/z "INSERTINCLUDE \"pearl-optics\""
100 execute /p/q/z "COMPILEPROCEDURES "
101 execute /p/q/z "BuildMenu \"PEARL\""
102 end
103
104 function LoadPearlArpes()
105 execute /p/q/z "INSERTINCLUDE \"pearl-arpes\""
106 execute /p/q/z "COMPILEPROCEDURES "
107 execute /p/q/z "BuildMenu \"PEARL\""
108 end
109
110 function LoadPearlPreparation()
111 execute /p/q/z "INSERTINCLUDE \"pearl-preparation\""
112 execute /p/q/z "COMPILEPROCEDURES "
113 execute /p/q/z "BuildMenu \"PEARL\""
114 end
115
116 function Display2dProfiles()
117 dfref dfBefore = GetDataFolderDFR()
118 Execute /q/z "CreateBrowser prompt=\"Select 2D wave\", showWaves=1, showVars=0, showStrs=0"
119 dfref dfAfter = GetDataFolderDFR()
120 SetDataFolder dfBefore
121
122 SVAR list = S_BrowserList
123 NVAR flag = V_Flag
124
125 if ((flag != 0) && (ItemsInList(list) >= 1))
126 string brickname = StringFromList(0, list)
127 string cmd
128 sprintf cmd, "ad_display_profiles(%s)", brickname
129 execute /q/z cmd
130 endif
131 end
132
133 function Display3dSlicer()
134 dfref dfBefore = GetDataFolderDFR()
135 Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
136 dfref dfAfter = GetDataFolderDFR()
137 SetDataFolder dfBefore
138
139 SVAR list = S_BrowserList
140 NVAR flag = V_Flag
141
142 if ((flag != 0) && (ItemsInList(list) >= 1))
143 string brickname = StringFromList(0, list)
144 string cmd
145 sprintf cmd, "ad_display_slice(%s)", brickname
146 execute /q/z cmd
147 sprintf cmd, "ad_brick_slicer(%s)", brickname
148 execute /q/z cmd
149 endif
150 end
151
152 function DisplayGizmoSlicer()
153 dfref dfBefore = GetDataFolderDFR()
154 Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
155 dfref dfAfter = GetDataFolderDFR()
156 SetDataFolder dfBefore
157
158 SVAR list = S_BrowserList
159 NVAR flag = V_Flag
160
161 if ((flag != 0) && (ItemsInList(list) >= 1))
162 string brickname = StringFromList(0, list)
163 string cmd
164 sprintf cmd, "ad_display_brick(%s)", brickname
165 execute /q/z cmd
166 sprintf cmd, "ad_brick_slicer(%s)", brickname
167 execute /q/z cmd
168 endif
169 end
170
185 function PearlLiveDisplay(epicsname, nickname, wbRGB)
186 string epicsname
187 string nickname
188 string wbRGB
189
190 string cmd
191 sprintf cmd, "ad_connect(\"%s\", \"%s\")", epicsname, nickname
192 execute /q/z cmd
193 sprintf cmd, "ad_display_profiles(root:pearl_epics:%s:image)", nickname
194 execute /q/z cmd
195 //sprintf cmd, "ad_add_overlay(root:pearl_epics:%s:image)", nickname
196 //execute /q/z cmd
197 sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
198 execute /q/z cmd
199 sprintf cmd, "add_roi_controls()"
200 execute /q/z cmd
201 end
202
218 function PearlCameraDisplay(epicsname, nickname, wbRGB)
219 string epicsname
220 string nickname
221 string wbRGB
222
223 string cmd
224 sprintf cmd, "ad_connect(\"%s\", \"%s\")", epicsname, nickname
225 execute /q/z cmd
226 sprintf cmd, "display; appendimage root:pearl_epics:%s:image", nickname
227 execute /q/z cmd
228 sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
229 execute /q/z cmd
230 cmd = "ModifyGraph height={Plan,1,left,bottom}"
231 execute /q/z cmd
232 end
233
242 function PearlAnglescanTracker(epicsname, wbRGB)
243 string epicsname
244 string wbRGB
245
246 string cmd
247 sprintf cmd, "ast_setup()"
248 execute /q/z cmd
249 sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
250 execute /q/z cmd
251 end
252
261 function PearlSampleTracker(action)
262 variable action
263 string cmd
264 sprintf cmd, "sample_tracker(%u)", action
265 execute /q/z cmd
266 end
267
ad_load_dialog
variable ad_load_dialog(string APathName)
load area detector data files selected in a file dialog window
Definition: pearl-area-import.ipf:167
ad_brick_slicer
variable ad_brick_slicer(wave data)
open a slicer panel for 3D data.
Definition: pearl-area-display.ipf:1256
ast_setup
variable ast_setup()
set up data structures, display graph, and try to connect to analyser.
Definition: pearl-anglescan-tracker.ipf:194
otf_gather_batch
variable otf_gather_batch(string ywavematch, string xwavematch, string destfolder)
Definition: pearl-otf-import.ipf:152
asp_show_panel
variable asp_show_panel()
create the angle scan processing panel
Definition: pearl-anglescan-panel.ipf:900
otf_rename_folders
variable otf_rename_folders(string pattern, variable unique_index=defaultValue, string new_suffix=defaultValue, string match_str=defaultValue)
Definition: pearl-otf-import.ipf:231
ad_display_profiles
string ad_display_profiles(wave image, string filter=defaultValue)
open a new profiles graph window.
Definition: pearl-area-display.ipf:166
pearl_data_explorer
variable pearl_data_explorer()
Definition: pearl-data-explorer.ipf:45
ad_display_slice
string ad_display_slice(wave data)
display three-dimensional data by 2D slice.
Definition: pearl-area-display.ipf:1404
pearl_elog
variable pearl_elog(string logbook)
main function to initialize ELOG and to open an ELOG panel.
Definition: pearl-elog.ipf:97
ad_display_brick
string ad_display_brick(wave data)
open a new "gizmo" window with three-dimensional data.
Definition: pearl-area-display.ipf:1141