PEARL Procedures  rev-distro-2.0.3-2-g58135e4-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  end
40 
41  submenu "Cameras"
42  PearlMenuEnableFunc("ad_display_profiles") + "Exit Slit Live View", /Q, PearlLiveDisplay("X03DA-OP-PS1:", "OP", "(65280,54528,48896)")
43  help = {"Display preview panel with latest image from Scienta", "Requires ARPES package and EPICS XOP"}
44  PearlMenuEnableFunc("ad_display_profiles") + "Manipulator Live View", /Q, PearlLiveDisplay("X03DA-ES-PS1:", "ES", "(65280,54528,48896)")
45  help = {"Display live panel of the exit slit camera", "Requires ARPES package and EPICS XOP"}
46  end
47 
48  submenu "Display"
49  PearlMenuEnableFunc("ad_display_profiles") + "2D Profiles", /Q, Display2dProfiles()
50  help = {"Profiles display of 2D data", "Requires ARPES package"}
51  PearlMenuEnableFunc("ad_display_brick") + "3D Slicer", /Q, Display3dSlicer()
52  help = {"Slice and profiles display of 3D data", "Requires ARPES package"}
53  PearlMenuEnableFunc("ad_display_brick") + "3D Gizmo", /Q, DisplayGizmoSlicer()
54  help = {"Gizmo display of 3D data", "Requires ARPES package"}
55  end
56 
57  submenu "Process"
58  PearlMenuEnableFunc("asp_show_panel") + "XPD scans", /Q, asp_show_panel()
59  help = {"Data processing of two-pi angle scans", "Requires ARPES package"}
60  end
61 
62  submenu "Services"
63  PearlMenuEnableFunc("pearl_elog") + "Open ELOG Panel", /Q, pearl_elog("")
64  help = {"Open an ELOG panel to send entries to an ELOG logbook"}
65  end
66 
67  submenu "Sample Preparation"
68  PearlMenuEnableFunc("ann_ramp_start") + "Annealing Ramp", /Q, panel_ramp_gen()
69  help = {"Sample annealing ramp generator"}
70  end
71 
72  submenu "Packages"
73  "Load ARPES Package", /Q, LoadPearlArpes()
74  help = {"Data processing and analysis for ARPES experiments"}
75  "Load Preparation Package", /Q, LoadPearlPreparation()
76  help = {"Process control for sample preparation"}
77  "Load Optics Package", /Q, LoadPearlOptics()
78  help = {"Data processing and analysis for beamline commissioning"}
79  end
80 end
81 
82 function /s PearlMenuEnableFunc(funcname)
83  // checks whether a function name exists
84  // and conditionally returns a prefix which disables the menu item
85  // if the function does not exist
86  string funcname
87  if (exists(funcname) >= 3)
88  return ""
89  else
90  return "("
91  endif
92 end
93 
94 function LoadPearlOptics()
95  execute /p/q/z "INSERTINCLUDE \"pearl-optics\""
96  execute /p/q/z "COMPILEPROCEDURES "
97  execute /p/q/z "PearlOpticsPanel#po_InitPanel()"
98  execute /p/q/z "BuildMenu \"PEARL\""
99 end
100 
101 function LoadPearlArpes()
102  execute /p/q/z "INSERTINCLUDE \"pearl-arpes\""
103  execute /p/q/z "COMPILEPROCEDURES "
104  execute /p/q/z "BuildMenu \"PEARL\""
105 end
106 
108  execute /p/q/z "INSERTINCLUDE \"pearl-preparation\""
109  execute /p/q/z "COMPILEPROCEDURES "
110  execute /p/q/z "BuildMenu \"PEARL\""
111 end
112 
114  dfref dfBefore = GetDataFolderDFR()
115  Execute /q/z "CreateBrowser prompt=\"Select 2D wave\", showWaves=1, showVars=0, showStrs=0"
116  dfref dfAfter = GetDataFolderDFR()
117  SetDataFolder dfBefore
118 
119  SVAR list = S_BrowserList
120  NVAR flag = V_Flag
121 
122  if ((flag != 0) && (ItemsInList(list) >= 1))
123  string brickname = StringFromList(0, list)
124  string cmd
125  sprintf cmd, "ad_display_profiles(%s)", brickname
126  execute /q/z cmd
127  endif
128 end
129 
130 function Display3dSlicer()
131  dfref dfBefore = GetDataFolderDFR()
132  Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
133  dfref dfAfter = GetDataFolderDFR()
134  SetDataFolder dfBefore
135 
136  SVAR list = S_BrowserList
137  NVAR flag = V_Flag
138 
139  if ((flag != 0) && (ItemsInList(list) >= 1))
140  string brickname = StringFromList(0, list)
141  string cmd
142  sprintf cmd, "ad_display_slice(%s)", brickname
143  execute /q/z cmd
144  sprintf cmd, "ad_brick_slicer(%s)", brickname
145  execute /q/z cmd
146  endif
147 end
148 
150  dfref dfBefore = GetDataFolderDFR()
151  Execute /q/z "CreateBrowser prompt=\"Select 3D wave\", showWaves=1, showVars=0, showStrs=0"
152  dfref dfAfter = GetDataFolderDFR()
153  SetDataFolder dfBefore
154 
155  SVAR list = S_BrowserList
156  NVAR flag = V_Flag
157 
158  if ((flag != 0) && (ItemsInList(list) >= 1))
159  string brickname = StringFromList(0, list)
160  string cmd
161  sprintf cmd, "ad_display_brick(%s)", brickname
162  execute /q/z cmd
163  sprintf cmd, "ad_brick_slicer(%s)", brickname
164  execute /q/z cmd
165  endif
166 end
167 
168 function PearlLiveDisplay(epicsname, nickname, wbRGB)
169  string epicsname // base name of the detector, e.g. X03DA-SCIENTA:
170  // image1: and cam1: are appended by the function
171  // see ad_connect
172  string nickname // nick name under which this detector is referred to in Igor
173  // must be a valid data folder name
174  // see ad_connect
175  string wbRGB // window background color, e.g. "(32768,49152,55296)"
176  string cmd
177  sprintf cmd, "ad_connect(\"%s\", \"%s\")", epicsname, nickname
178  execute /q/z cmd
179  sprintf cmd, "ad_display_profiles(root:pearl_epics:%s:image)", nickname
180  execute /q/z cmd
181  sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
182  execute /q/z cmd
183  sprintf cmd, "add_roi_controls()"
184  execute /q/z cmd
185 end
186 
187 function PearlAnglescanTracker(epicsname, wbRGB)
188  string epicsname // base name of the detector, e.g. X03DA-SCIENTA:
189  // image1: and cam1: are appended by the function
190  // see ast_setup
191  string wbRGB // window background color, e.g. "(32768,49152,55296)"
192  string cmd
193  sprintf cmd, "ast_setup()"
194  execute /q/z cmd
195  sprintf cmd, "ModifyGraph wbRGB=%s", wbRGB
196  execute /q/z cmd
197 end
variable PearlLiveDisplay(string epicsname, string nickname, string wbRGB)
Definition: pearl-menu.ipf:168
variable DisplayGizmoSlicer()
Definition: pearl-menu.ipf:149
variable ad_load_dialog(string APathName)
load area detector data files selected in a file dialog window
variable ad_brick_slicer(wave data)
open a slicer panel for 3D data.
variable ast_setup()
set up data structures, display graph, and try to connect to analyser.
variable LoadPearlPreparation()
Definition: pearl-menu.ipf:107
variable PearlAnglescanTracker(string epicsname, string wbRGB)
Definition: pearl-menu.ipf:187
variable LoadPearlArpes()
Definition: pearl-menu.ipf:101
variable LoadPearlOptics()
Definition: pearl-menu.ipf:94
variable Display3dSlicer()
Definition: pearl-menu.ipf:130
variable otf_gather_batch(string ywavematch, string xwavematch, string destfolder)
variable asp_show_panel()
create the angle scan processing panel
variable otf_rename_folders(string pattern, variable unique_index=defaultValue, string new_suffix=defaultValue, string match_str=defaultValue)
string ad_display_profiles(wave image, string filter=defaultValue)
open a new profiles graph window.
variable pearl_data_explorer()
string PearlMenuEnableFunc(string funcname)
Definition: pearl-menu.ipf:82
string ad_display_slice(wave data)
display three-dimensional data by 2D slice.
variable pearl_elog(string logbook)
main function to initialize ELOG and to open an ELOG panel.
Definition: pearl-elog.ipf:97
string ad_display_brick(wave data)
open a new "gizmo" window with three-dimensional data.
variable Display2dProfiles()
Definition: pearl-menu.ipf:113