Wiki source code of IDL cheat sheet
Version 28.1 by fwilde on 2018-12-18 12:09
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
25.1 | 1 | This is an overview of the most commonly used commands during a beamtime. |
| |
1.1 | 2 | |
| |
22.1 | 3 | == {{id name="IDLcheatsheet-Coordinatesystem"/}}Coordinate system == |
| 4 | |||
| |
23.1 | 5 | Right-handed coordinate system with y-direction along the x-ray beam. |
| 6 | |||
| |
25.1 | 7 | \\ |
| |
22.1 | 8 | |
| |
25.1 | 9 | [[image:attach:p05_uct.png||width="700"]] |
| 10 | |||
| |
6.1 | 11 | == {{id name="IDLcheatsheet-Samplepositioning"/}}Sample positioning == |
| 12 | |||
| |
12.1 | 13 | (% class="wrapped fixed-table" %) |
| |
1.1 | 14 | |=((( |
| 15 | IDL command | ||
| 16 | )))|=((( | ||
| 17 | description | ||
| |
3.1 | 18 | )))|=((( |
| 19 | motion | ||
| |
1.1 | 20 | ))) |
| 21 | |((( | ||
| |
15.1 | 22 | s_stage_x/z, 1 |
| |
1.1 | 23 | )))|((( |
| |
15.1 | 24 | move rotation stage in x/z-direction by 1 mm |
| |
3.1 | 25 | )))|((( |
| 26 | relative [ mm ] | ||
| |
1.1 | 27 | ))) |
| 28 | |((( | ||
| |
18.1 | 29 | s_pos_z, 1 |
| |
1.1 | 30 | )))|((( |
| |
18.1 | 31 | move sample stage in z-direction by 1 mm, |
| |
3.1 | 32 | )))|((( |
| 33 | relative [ mm ] | ||
| |
1.1 | 34 | ))) |
| 35 | |((( | ||
| |
18.1 | 36 | s_pos_lateral, 1 |
| 37 | )))|((( | ||
| 38 | move sample stage in x-direction by 1 mm, regardless of position of rotation axis | ||
| 39 | )))|((( | ||
| 40 | relative [ mm ] | ||
| 41 | ))) | ||
| 42 | |((( | ||
| |
9.1 | 43 | s_angle, 90 |
| |
3.1 | 44 | )))|((( |
| |
9.1 | 45 | rotate sample around z axis |
| |
3.1 | 46 | )))|((( |
| |
9.1 | 47 | relative [ deg ] |
| |
3.1 | 48 | ))) |
| |
7.1 | 49 | |((( |
| 50 | s_in | ||
| 51 | )))|((( | ||
| 52 | move sample to "in" position | ||
| 53 | )))|((( | ||
| 54 | predefined | ||
| 55 | ))) | ||
| 56 | |((( | ||
| 57 | s_out | ||
| 58 | )))|((( | ||
| 59 | move sample to "out" position | ||
| 60 | )))|((( | ||
| 61 | predefined | ||
| 62 | ))) | ||
| 63 | |((( | ||
| 64 | s_change | ||
| 65 | )))|((( | ||
| 66 | move sample to "change" position | ||
| 67 | )))|((( | ||
| 68 | predefined | ||
| 69 | ))) | ||
| |
6.1 | 70 | |
| |
26.1 | 71 | \\ |
| 72 | |||
| 73 | \\ | ||
| 74 | |||
| |
28.1 | 75 | (% class="relative-table wrapped" style="width: 63.2385%;" %) |
| |
15.1 | 76 | |=((( |
| 77 | IDL command | ||
| 78 | )))|=((( | ||
| 79 | description | ||
| 80 | )))|=((( | ||
| 81 | motion | ||
| 82 | ))) | ||
| 83 | |((( | ||
| 84 | goto_s_stage_x/z, 1 | ||
| 85 | )))|((( | ||
| 86 | move rotation stage in x/z-direction to 1 mm | ||
| 87 | )))|((( | ||
| 88 | absolute [ mm ] | ||
| 89 | ))) | ||
| 90 | |((( | ||
| 91 | goto_s_pos_x/y/z, 1 | ||
| 92 | )))|((( | ||
| 93 | move sample stage in x/y/z-direction to 1 mm | ||
| 94 | )))|((( | ||
| 95 | absolute [ mm ] | ||
| 96 | ))) | ||
| 97 | |((( | ||
| 98 | goto_s_angle, 90 | ||
| 99 | )))|((( | ||
| 100 | rotate sample around z axis to 90° | ||
| 101 | )))|((( | ||
| 102 | absolute [ deg ] | ||
| 103 | ))) | ||
| 104 | |||
| |
28.1 | 105 | (% class="relative-table wrapped" style="width: 51.477%;" %) |
| |
15.1 | 106 | |=((( |
| 107 | IDL command | ||
| 108 | )))|=((( | ||
| 109 | description | ||
| 110 | ))) | ||
| 111 | |((( | ||
| 112 | pos_s_stage_x/z() | ||
| 113 | )))|((( | ||
| 114 | return current rotation stage in x/z position | ||
| 115 | ))) | ||
| 116 | |((( | ||
| 117 | pos_s_pos_x/y/z() | ||
| 118 | )))|((( | ||
| 119 | return current sample stage in x/y/z position | ||
| 120 | ))) | ||
| 121 | |((( | ||
| 122 | pos_s_angle() | ||
| 123 | )))|((( | ||
| 124 | return current rotation stage angle | ||
| 125 | ))) | ||
| 126 | |||
| |
6.1 | 127 | == {{id name="IDLcheatsheet-Detectorpositioning"/}}Detector positioning == |
| 128 | |||
| |
12.1 | 129 | (% class="wrapped fixed-table" %) |
| |
6.1 | 130 | |=((( |
| |
7.1 | 131 | IDL command |
| |
6.1 | 132 | )))|=((( |
| 133 | description | ||
| 134 | )))|=((( | ||
| 135 | motion | ||
| 136 | ))) | ||
| |
3.1 | 137 | |((( |
| |
6.1 | 138 | pressure_on |
| |
1.1 | 139 | )))|((( |
| |
6.1 | 140 | enable detector y movement |
| 141 | )))|((( | ||
| |
5.1 | 142 | \\ |
| |
6.1 | 143 | ))) |
| 144 | |((( | ||
| 145 | o_ccd_dist, 5 | ||
| |
3.1 | 146 | )))|((( |
| |
6.1 | 147 | move detector in y direction |
| 148 | )))|((( | ||
| 149 | relative [ mm ] | ||
| 150 | ))) | ||
| 151 | |((( | ||
| 152 | pressure_off | ||
| 153 | )))|((( | ||
| 154 | disable detector movement | ||
| 155 | )))|((( | ||
| |
3.1 | 156 | \\ |
| |
1.1 | 157 | ))) |
| |
3.1 | 158 | |
| |
7.1 | 159 | == {{id name="IDLcheatsheet-Makeimage"/}}Make image == |
| 160 | |||
| |
12.1 | 161 | (% class="wrapped fixed-table" %) |
| |
7.1 | 162 | |=((( |
| 163 | IDL command | ||
| 164 | )))|=((( | ||
| 165 | description | ||
| 166 | ))) | ||
| 167 | |((( | ||
| 168 | i=quick(100) & tv_quick, i & draw_box, [ x1, x2 ,z1 ,z2 ] | ||
| 169 | )))|((( | ||
| 170 | make an image & show image & draw box | ||
| 171 | ))) | ||
| 172 | |((( | ||
| |
10.1 | 173 | a=quick_abs(100) & tv_quick, a & draw_box, [ x1, x2 ,z1 ,z2 ] |
| |
7.1 | 174 | )))|((( |
| |
10.1 | 175 | make an absorption image & show image & draw box |
| |
7.1 | 176 | ))) |
| 177 | |||
| |
6.1 | 178 | == {{id name="IDLcheatsheet-Monochromatorpositioning"/}}Monochromator positioning == |
| 179 | |||
| |
12.1 | 180 | (% class="wrapped fixed-table" %) |
| |
3.1 | 181 | |=((( |
| 182 | IDL command | ||
| 183 | )))|=((( | ||
| 184 | description | ||
| 185 | )))|=((( | ||
| 186 | motion | ||
| 187 | ))) | ||
| |
1.1 | 188 | |((( |
| |
3.1 | 189 | calc_dcm_energy, 10000, /set |
| 190 | )))|((( | ||
| 191 | set DCM and undulator to 10 keV | ||
| 192 | )))|((( | ||
| |
1.1 | 193 | \\ |
| |
3.1 | 194 | ))) |
| 195 | |((( | ||
| 196 | dcm_pitch, 0.00001 | ||
| |
1.1 | 197 | )))|((( |
| |
4.1 | 198 | move 2nd crystal pitch by 0.00001 deg |
| |
3.1 | 199 | )))|((( |
| |
4.1 | 200 | relative [ deg ] |
| |
3.1 | 201 | ))) |
| 202 | |((( | ||
| |
4.1 | 203 | goto_dcm_pitch, -0.03976 |
| |
3.1 | 204 | )))|((( |
| |
4.1 | 205 | move 2nd crystal pitch to -0.03976 deg |
| |
3.1 | 206 | )))|((( |
| |
4.1 | 207 | absolute [ deg ] |
| |
1.1 | 208 | ))) |
| |
3.1 | 209 | |((( |
| |
4.1 | 210 | reflex_opt |
| |
3.1 | 211 | )))|((( |
| |
4.1 | 212 | move 2nd crystal pitch to optimal flux position |
| |
3.1 | 213 | )))|((( |
| 214 | \\ | ||
| 215 | ))) | ||
| |
26.1 | 216 | |((( |
| 217 | gap, 0.01 | ||
| 218 | )))|((( | ||
| 219 | move undulator gap by 0.01 mm | ||
| 220 | )))|((( | ||
| 221 | relative [ mm ] | ||
| 222 | ))) | ||
| |
14.1 | 223 | |
| 224 | == {{id name="IDLcheatsheet-Saveanimageastiff"/}}Save an image as tiff == | ||
| 225 | |||
| |
28.1 | 226 | (% class="wrapped relative-table" style="width: 60.1204%;" %) |
| |
14.1 | 227 | |=((( |
| 228 | IDL command | ||
| 229 | )))|=((( | ||
| 230 | desciption | ||
| 231 | ))) | ||
| 232 | |((( | ||
| 233 | write_tiff, '/gpfs/current/raw/test.tif', i, /SHORT | ||
| 234 | )))|((( | ||
| 235 | save i as 16-bit tiff in /gofs/... | ||
| 236 | ))) | ||
| |
27.1 | 237 | |
| 238 | == {{id name="IDLcheatsheet-Generalremarks"/}}General remarks == | ||
| 239 | |||
| |
28.1 | 240 | (% class="wrapped relative-table" style="width: 51.5317%;" %) |
| |
27.1 | 241 | |=((( |
| 242 | Functionality | ||
| 243 | )))|=((( | ||
| 244 | IDL syntax | ||
| 245 | ))) | ||
| 246 | |((( | ||
| 247 | Chaining commands | ||
| 248 | )))|((( | ||
| 249 | command_1 **&** command_2 **&** ... | ||
| 250 | ))) | ||
| 251 | |((( | ||
| 252 | absolute movement | ||
| 253 | )))|((( | ||
| 254 | **goto_**//motor//, position | ||
| 255 | ))) | ||
| 256 | |((( | ||
| 257 | relative movement | ||
| 258 | )))|((( | ||
| 259 | //motor//, position | ||
| 260 | ))) | ||
| 261 | |((( | ||
| 262 | current motor position | ||
| 263 | )))|((( | ||
| 264 | **pos_**//motor//() | ||
| 265 | ))) |