Wiki source code of IDL cheat sheet

Version 57.1 by fwilde on 2024/06/13 14:51

Hide last authors
fwilde 54.1 1 == {{id name="IDLcheatsheet-eCoordinatesystem"/}}eCoordinate system ==
fwilde 22.1 2
fwilde 23.1 3 Right-handed coordinate system with y-direction along the x-ray beam.
4
fwilde 25.1 5 [[image:attach:p05_uct.png||width="700"]]
6
moosmanj 6.1 7 == {{id name="IDLcheatsheet-Samplepositioning"/}}Sample positioning ==
8
fwilde 31.1 9 === {{id name="IDLcheatsheet-Relativemovement"/}}Relative movement ===
10
moosmanj 12.1 11 (% class="wrapped fixed-table" %)
fwilde 1.1 12 |=(((
13 IDL command
14 )))|=(((
15 description
fwilde 3.1 16 )))|=(((
17 motion
fwilde 1.1 18 )))
19 |(((
fwilde 46.1 20 ##**s_stage_x/z, 1**##
fwilde 1.1 21 )))|(((
fwilde 15.1 22 move rotation stage in x/z-direction by 1 mm
fwilde 3.1 23 )))|(((
24 relative [ mm ]
fwilde 1.1 25 )))
26 |(((
fwilde 46.1 27 ##**s_pos_x/y/z, 1**##
fwilde 1.1 28 )))|(((
fwilde 45.1 29 move sample stage in x/y/z-direction by 1 mm (caution with directions: stage mount on rotation axis)
fwilde 3.1 30 )))|(((
31 relative [ mm ]
fwilde 1.1 32 )))
33 |(((
fwilde 52.1 34 ##**s_pos, 1**##
fwilde 18.1 35 )))|(((
36 move sample stage in x-direction by 1 mm, regardless of position of rotation axis
37 )))|(((
38 relative [ mm ]
39 )))
40 |(((
fwilde 46.1 41 ##**s_angle, 90**##
fwilde 3.1 42 )))|(((
moosmanj 9.1 43 rotate sample around z axis
fwilde 3.1 44 )))|(((
moosmanj 9.1 45 relative [ deg ]
fwilde 3.1 46 )))
moosmanj 6.1 47
fwilde 31.1 48 === {{id name="IDLcheatsheet-Absolutemovement"/}}Absolute movement ===
49
fwilde 46.1 50 (% class="relative-table wrapped" style="width: 67.0892%;" %)
fwilde 15.1 51 |=(((
52 IDL command
53 )))|=(((
54 description
55 )))|=(((
56 motion
57 )))
58 |(((
fwilde 46.1 59 ##**goto_s_stage_x/z, 1**##
fwilde 15.1 60 )))|(((
61 move rotation stage in x/z-direction to 1 mm
62 )))|(((
63 absolute [ mm ]
64 )))
65 |(((
fwilde 46.1 66 ##**goto_s_pos_x/y/z, 1**##
fwilde 15.1 67 )))|(((
fwilde 45.1 68 move sample stage in x/y/z-direction to 1  mm
fwilde 15.1 69 )))|(((
70 absolute [ mm ]
71 )))
72 |(((
fwilde 46.1 73 ##**goto_s_angle, 90**##
fwilde 15.1 74 )))|(((
fwilde 46.1 75 rotate sample around z axis to 90° (**alias command: s_rot**)
fwilde 15.1 76 )))|(((
77 absolute [ deg ]
78 )))
79
fwilde 32.1 80 === {{id name="IDLcheatsheet-Getcurrentposition"/}}Get current position ===
fwilde 31.1 81
fwilde 46.1 82 (% class="relative-table wrapped" style="width: 54.0627%;" %)
fwilde 15.1 83 |=(((
84 IDL command
85 )))|=(((
86 description
87 )))
88 |(((
fwilde 46.1 89 ##**pos_s_stage_x/z()**##
fwilde 15.1 90 )))|(((
91 return current rotation stage in x/z position
92 )))
93 |(((
fwilde 46.1 94 ##**pos_s_pos_x/y/z()**##
fwilde 15.1 95 )))|(((
fwilde 45.1 96 return current sample stage in x/y/z position
fwilde 15.1 97 )))
98 |(((
fwilde 46.1 99 ##**pos_s_angle()**##
fwilde 15.1 100 )))|(((
101 return current rotation stage angle
102 )))
103
fwilde 31.1 104 === {{id name="IDLcheatsheet-Predefinedpositions"/}}Predefined positions ===
105
fwilde 45.1 106 (% class="relative-table wrapped" style="width: 55.721%;" %)
fwilde 31.1 107 |=(((
108 IDL command
109 )))|=(((
110 description
111 )))
112 |(((
fwilde 46.1 113 ##**s_in**##
fwilde 31.1 114 )))|(((
115 move sample to "in" position
116 )))
117 |(((
fwilde 46.1 118 ##**s_out**##
fwilde 31.1 119 )))|(((
120 move sample to "out" position
121 )))
122 |(((
fwilde 46.1 123 ##**s_change**##
fwilde 31.1 124 )))|(((
125 move sample to "change" position
126 )))
127 |(((
fwilde 53.1 128 ##**set_s_in_pos(, 0)**##
fwilde 31.1 129 )))|(((
fwilde 53.1 130 set s_in position to current stage position, or optionally to e.g. 0.0 mm
fwilde 31.1 131 )))
132 |(((
fwilde 46.1 133 ##**set_s_out_dist, 10**##
fwilde 31.1 134 )))|(((
135 set s_out distance to 10.0 mm
136 )))
137
fwilde 45.1 138 === {{id name="IDLcheatsheet-Magnificationsets"/}}Magnification sets ===
139
140 (% class="wrapped" %)
141 |=(((
142 IDL command
143 )))|=(((
144 description
145 )))
146 |(((
fwilde 51.1 147 ##**save_magn_set(, name_add)
148 **##
fwilde 45.1 149 )))|(((
fwilde 51.1 150 save current magnification set, optionally add something to the automatically generated name
fwilde 45.1 151 )))
152 |(((
fwilde 51.1 153 ##**restore_magn_set(, name)
154 **##
fwilde 45.1 155 )))|(((
fwilde 51.1 156 restore last magnification set, or optionally load a file with a specific name
fwilde 45.1 157 )))
158
moosmanj 6.1 159 == {{id name="IDLcheatsheet-Detectorpositioning"/}}Detector positioning ==
160
moosmanj 12.1 161 (% class="wrapped fixed-table" %)
moosmanj 6.1 162 |=(((
moosmanj 7.1 163 IDL command
moosmanj 6.1 164 )))|=(((
165 description
166 )))|=(((
167 motion
168 )))
fwilde 3.1 169 |(((
fwilde 50.1 170 ##**o_ccd_dist, 5**##
fwilde 1.1 171 )))|(((
fwilde 50.1 172 move detector in y direction relative by 5 mm
moosmanj 6.1 173 )))|(((
fwilde 50.1 174 relative [ mm ]
moosmanj 6.1 175 )))
176 |(((
fwilde 50.1 177 ##**goto_o_ccd_dist, 30**##
fwilde 3.1 178 )))|(((
fwilde 50.1 179 move detector in y direction absoilute to 30 mm
moosmanj 6.1 180 )))|(((
fwilde 50.1 181 \\
moosmanj 6.1 182 )))
183 |(((
fwilde 50.1 184 ##**pos_o_ccd_dist()**##
moosmanj 6.1 185 )))|(((
fwilde 50.1 186 return current of the camera stage distance
moosmanj 6.1 187 )))|(((
fwilde 3.1 188 \\
fwilde 1.1 189 )))
fwilde 3.1 190
fwilde 45.1 191 == {{id name="IDLcheatsheet-Slitpositioning"/}}Slit positioning ==
192
193 (% class="wrapped" %)
194 |=(((
195 IDL command
196 )))|=(((
197 description
198 )))
199 |(((
fwilde 47.1 200 ##**slit_oh, rx=1 (rz=1)**##
201 )))|(((
202 moves oh slit aperture horizontally (vertically) by 1mm
203 )))
204 |(((
205 ##**slit_oh, rdx=1 (rdz=1)**##
206 )))|(((
207 opens oh the slit aperture horizontally (vertically) by 1 mm
208 )))
209 |(((
fwilde 46.1 210 ##**slit_eh2, rx=1 (rz=1)**##
fwilde 45.1 211 )))|(((
fwilde 47.1 212 moves eh2 slit aperture horizontally (vertically) by 1 mm
fwilde 45.1 213 )))
214 |(((
fwilde 47.1 215 ##**slit_eh2, rdx=1 (rdz=1)**##
fwilde 45.1 216 )))|(((
fwilde 47.1 217 opens eh2 the slit aperture horizontally (vertically) by 1 mm
fwilde 45.1 218 )))
219 |(((
fwilde 46.1 220 ##**slit_info**##
fwilde 45.1 221 )))|(((
222 show all slit positions
223 )))
224
225 rx, rdx, rz and rdz can be concatenated in one command (e.g. slit_oh, rx=1, rz=-2, rdx=0.5, rdz=0.5)
226
fwilde 47.1 227 == {{id name="IDLcheatsheet-Makeandsaveimages"/}}Make and save images ==
moosmanj 7.1 228
moosmanj 12.1 229 (% class="wrapped fixed-table" %)
moosmanj 7.1 230 |=(((
231 IDL command
232 )))|=(((
233 description
234 )))
235 |(((
fwilde 47.1 236 ##**i=quick(100) & display_image, BYSTCL(i, 0, 4096)
237 **##
moosmanj 7.1 238 )))|(((
fwilde 47.1 239 make an image & scale image (eg. from 0 to 4096, usually from 0 to maximum value the camera can do)
moosmanj 7.1 240 )))
241 |(((
fwilde 47.1 242 ##**a=quick_abs(100) & display_image, BYTSCL(a, 0, 2)**##
moosmanj 7.1 243 )))|(((
fwilde 47.1 244 make an absorption image & scale image (usually from 0 to to 2)
moosmanj 7.1 245 )))
fwilde 34.1 246 |(((
fwilde 47.1 247 ##**write_tiff, '/gpfs/current/raw/test_projection.tif', i, /SHORT**##
fwilde 34.1 248 )))|(((
fwilde 47.1 249 save i as 16-bit integer tiff in /gpfs/...
fwilde 34.1 250 )))
fwilde 47.1 251 |(((
252 ##**write_tiff, '/gpfs/current/raw/test_absorption.tif', a, /FLOAT**##
253 )))|(((
254 save a as 32-bit float tiff in /gpfs/...
255 )))
moosmanj 7.1 256
fwilde 54.1 257 == {{id name="IDLcheatsheet-Macrosmotion+images"/}}Macros motion  + images ==
fwilde 49.1 258
fwilde 57.1 259 These macros make images with predefined and internally saved values (like exposure time or display scale). Some move an axis first and then make an image (again with internally saved options likeexposure time, and image type). **Use these macros to quickly align you samples.**
fwilde 54.1 260
fwilde 55.1 261 (% class="relative-table wrapped" style="width: 114.69%;" %)
fwilde 54.1 262 |=(((
263 IDL command
264 )))|=(((
265 description
266 )))
267 |(((
268 **{{code language="none"}}qt (, t=100, scale=[0,4096]){{/code}}**
269 )))|(((
fwilde 57.1 270 Quick **transmission** image at the current position. Options: set new exposure time, set new scale for image display,
fwilde 54.1 271 )))
272 |(((
fwilde 55.1 273 **{{code language="none"}}qa (, t=100, scale=[0,2], /ref, /here){{/code}}**
fwilde 54.1 274 )))|(((
fwilde 57.1 275 Quick **absorption** image at s_in position. Options: set new exposure time, set new scale for image display, make new reference image, make image at current position.
fwilde 54.1 276 )))
277 |(((
fwilde 55.1 278 **{{code language="none"}}qp (, t=100, scale=[0,2], /ref, /here){{/code}}**
fwilde 54.1 279 )))|(((
fwilde 57.1 280 Quick **phase** image at s_in position. Options: set new exposure time, set new scale for image display, make new reference image, make image at current position
fwilde 54.1 281 )))
282 |(((
fwilde 57.1 283 **{{code language="none"}}qr (, t=100, scale=[0,4096]){{/code}}
284 **
285 )))|(((
286 Quick **reference image**. Options: set new exposure time,  set new scale for image display,
287 )))
288 |(((
fwilde 55.1 289 **{{code language="none"}}side, 90 (, t=100, /ref, /rel, /here, imgtype='a') {{/code}}**
fwilde 54.1 290 )))|(((
fwilde 56.1 291 **Rotate** (absolute degrees) and make an image at the new position. Options: set new exposure time, make new reference image, make image at current position, set image type ('a': absorption, 't': transmission, 'p' phase)
fwilde 54.1 292 )))
293 |(((
fwilde 55.1 294 **{{code language="none"}}sshift, 2 (, t=100, /ref, /here, imgtype='a'){{/code}}**
fwilde 54.1 295 )))|(((
fwilde 56.1 296 Move **sample stage laterally** (relative, mm) and make an image at the new position. Options: set exposure time, make new reference image, , make image at current position, set image type ('a': absorption, 't': transmission, 'p' phase)
fwilde 54.1 297 )))
298 |(((
fwilde 55.1 299 ##**sz, 2 (, t=100, /ref, /here, imgtype='a')**##
fwilde 54.1 300 )))|(((
fwilde 56.1 301 Move **rotation stage up or down** (relative, mm) and make an image at the new position. Options: set exposure time, make reference image, make image at current position, set image type ('a': absorption, 't': transmission, 'p' phase)
fwilde 54.1 302 )))
303 |(((
fwilde 55.1 304 **{{code language="none"}}zx, 2 (, t=100, /ref, /here, imgtype='a'){{/code}}
fwilde 54.1 305 **
306 )))|(((
fwilde 56.1 307 Move **rotation stage left or right** (relative, mm) and make an image at the new position. Options: set exposure time, make reference image, make image at current position, set image type ('a': absorption, 't': transmission, 'p' phase)
fwilde 54.1 308 )))
309
fwilde 49.1 310 \\
311
312 {{info title="Monochromator positioning"}}
313 ATTENTION: Setting up a Monochromator as well as positioning front end slits is **only** done by the beamline staff!
314
315 The commands above may be used by users to realign the beam should it beam profile drift with time.
316 {{/info}}
317
fwilde 47.1 318 == {{id name="IDLcheatsheet-DCMpositioning"/}}DCM positioning ==
moosmanj 6.1 319
moosmanj 12.1 320 (% class="wrapped fixed-table" %)
fwilde 3.1 321 |=(((
322 IDL command
323 )))|=(((
324 description
325 )))|=(((
326 motion
327 )))
fwilde 1.1 328 |(((
fwilde 46.1 329 ##**dcm_pitch, 0.00001**##
fwilde 1.1 330 )))|(((
fwilde 4.1 331 move 2nd crystal pitch by 0.00001 deg
fwilde 3.1 332 )))|(((
fwilde 4.1 333 relative [ deg ]
fwilde 3.1 334 )))
335 |(((
fwilde 46.1 336 ##**goto_dcm_pitch,  -0.03976**##
fwilde 3.1 337 )))|(((
fwilde 4.1 338 move 2nd crystal pitch to -0.03976 deg
fwilde 3.1 339 )))|(((
fwilde 4.1 340 absolute [ deg ]
fwilde 1.1 341 )))
fwilde 3.1 342 |(((
fwilde 51.1 343 ##**reflex_opt_single**##
fwilde 3.1 344 )))|(((
fwilde 4.1 345 move 2nd crystal pitch to optimal flux position
fwilde 3.1 346 )))|(((
347 \\
348 )))
fwilde 47.1 349
350 == {{id name="IDLcheatsheet-DMMpositioning"/}}DMM positioning ==
351
fwilde 48.1 352 (% class="fixed-table wrapped" %)
fwilde 47.1 353 |=(((
354 IDL command
355 )))|=(((
356 description
357 )))|=(((
358 motion
359 )))
fwilde 26.1 360 |(((
fwilde 47.1 361 ##**dmm_x2_rot, 0.001**##
362 )))|(((
363 move 2nd crystal pitch by 0.00001 deg
364 )))|(((
365 relative [ deg ]
366 )))
367 |(((
368 ##**goto_dmm_x2_rot,  0.8923
369 **##
370 )))|(((
371 move 2nd crystal pitch to 0.8923 deg
372 )))|(((
373 absolute [ deg ]
374 )))
fwilde 14.1 375
fwilde 47.1 376 \\
377
fwilde 35.1 378 == {{id name="IDLcheatsheet-Generalsyntax"/}}General syntax ==
fwilde 27.1 379
fwilde 46.1 380 (% class="wrapped relative-table" style="width: 45.5603%;" %)
fwilde 27.1 381 |=(((
382 Functionality
383 )))|=(((
384 IDL syntax
385 )))
386 |(((
fwilde 46.1 387 chaining commands
fwilde 27.1 388 )))|(((
389 command_1 **&** command_2 **&** ...
390 )))
391 |(((
392 absolute movement
393 )))|(((
394 **goto_**//motor//, position
395 )))
396 |(((
397 relative movement
398 )))|(((
399 //motor//, position
400 )))
401 |(((
402 current motor position
403 )))|(((
404 **pos_**//motor//()
405 )))
fwilde 45.1 406
407 == {{id name="IDLcheatsheet-BeamshutterandInterlockcontrol"/}}Beamshutter and Interlock control ==
408
fwilde 46.1 409 (% class="wrapped relative-table" style="width: 75.0455%;" %)
fwilde 45.1 410 |=(((
411 IDL command
412 )))|=(((
413 description
414 )))
415 |(((
fwilde 46.1 416 ##**bs_info**##
fwilde 45.1 417 )))|(((
418 prints an overview of the beamline beamshutter status
419 )))
420 |(((
fwilde 46.1 421 ##**bsoh_open / bsoh_close**##
fwilde 45.1 422 )))|(((
423 opens / closes the optics hutch beamshutter. Closing the OH beamshutter will close all following beamshutters (EH1, EH2)
424 )))
425 |(((
fwilde 46.1 426 ##**bseh1_open / bseh1_close**##
fwilde 45.1 427 )))|(((
428 opens / closes the EH1 beamshutter. Opening will open the OH beamshutter as well. Closing the OH beamshutter will the EH2 beamshutter as well
429 )))
430 |(((
fwilde 46.1 431 ##**bseh2_open / bseh2_close**##
fwilde 45.1 432 )))|(((
433 opens / closes the EH2 beamshutter. Openening will open the OH and EH1 beamshutters as well.
434 )))
435 |(((
fwilde 46.1 436 ##**ics_info**##
fwilde 45.1 437 )))|(((
438 prints an overview of the beamline interlock status
439 )))
440 |(((
fwilde 51.1 441 ##**oh_break_ics**##
fwilde 45.1 442 )))|(((
443 closes all P05 beamshutters and breaks OH door interlock. P06 beamshutter must be closed for this command to work!
444 )))
445 |(((
fwilde 51.1 446 ##**eh1_break_ics**##
fwilde 45.1 447 )))|(((
448 closes EH1 beamshutter (and EH2 beamshutter  if open) and breaks EH1 door interlock
449 )))
450 |(((
fwilde 51.1 451 ##**eh2_break_ics**##
fwilde 45.1 452 )))|(((
453 closes EH2 beshutter and breaks EH2 door interlock
454 )))
fwilde 54.1 455
456 == {{id name="IDLcheatsheet-Helpermacros"/}}Helper macros ==
457
458 The helper macros may help to align a sample quickly. Mainly, these are motion commands which subsequently make an image with predefined values.
459
460 (% class="wrapped" %)
461 |=(((
462 IDL command
463 )))|=(((
464 description
465 )))
466 |(((
467 helper_object, /info
468 )))|(((
469 show predefined values
470 )))
471 |(((
472 \\
473 )))|(((
474 \\
475 )))
476 |(((
477 \\
478 )))|(((
479 \\
480 )))
481 |(((
482 \\
483 )))|(((
484 \\
485 )))
486 |(((
487 \\
488 )))|(((
489 \\
490 )))
491 |(((
492 \\
493 )))|(((
494 \\
495 )))
496 |(((
497 \\
498 )))|(((
499 \\
500 )))
501 |(((
502 \\
503 )))|(((
504 \\
505 )))