REDUCING BACHES EXPECTRA WITH MIDAS ECHELLE CONTEXT ------------------------------------------------------ For MIDAS to process echelle images they have to be oriented with blue to the left and blut to the button. The fits files might be rotated 180 degres. To rotate an image: # rotate/clock ff rff 2 Reset the start & step values to 1,1 after rotation # write/desc rff.fit start/d/1/2 1,1 # write/desc rff.fit step/d/1/2 1,1 Sometimes you can also rotate (but it overwrites the original!) flip/ima ff.fit y (up-down) flip/ima ff.fit x (left-right) write/desc ff.fit start/d/1/2 1,1 write/desc ff.fit step/d/1/2 1,1 Intiate echelle context: set/context echelle initia/echelle get a copy of the TH table: tutorial/echelle auto Rest display reset/dis Create graph and display windows. Less than 970,650 and the image will be displayed reduced create/disp 0 970,650 Load the flat field # load/lut heat # load ff.fit display/echelle ff.fit yes This operation will iron the camel shape of the flat field # compute/image fflog = log(ff.fit+3000) To see all Echelle parameters (note defaults: NBORDI=0, WIDTHI=0 THRESI=0) show/eche To see all Echelle parameters regading wave calibration show/eche w Echelle values: (from left to right?) scan/echelle ff.fit cursor (limit scan area, particular broken lines) with in pixels of the ff orders. We can set it to 0, and the program may find the with itself (check show/eche o) set/echelle widthi = 13 And number of orders to display. When using the default it will be conservative and may miss some lines that we know they can be detected. set/echelle nbordi = 28 set/echelle nbordi = 27 Identify order: (unfortunately we need for define/hough *.bdf files) indisk/fits ff.fit ff.bdf define/hough ff.bdf or define/hough rfflog Save the session each time a better result is obtained save/eche baches (ignore message error line.tbl) Convert the thar table from FITS to thar.tbl indisk/fits thar.fit thar.tbl Display now the TH lamp, adjust the start/step values to 1,1 # rotate/clock th rth 2 # write/desc rth start/d/1/2 1,1 # write/desc rth step/d/1/2 1,1 indisk/fits th.fit th.bdf display/echel th Set echelle to use th or rth: Nevertheless you need *.bdf again indisk/fits th.fit th.bdf set/eche wlc=th set/eche slit = 10 extract/echelle {wlc} extwlc thres2 = 10. search/ech extwlc If it detects noise as lines, increase threshold value (thres2) With above values I obtained 1551 lines Set initially the threshold high and display the orders load/search save/eche baches Clean the order lines: clear/chan over Convert the table thar.mt to tbl format indisk/fits thar.fit thar.tbl Point LINCAT to the local thar.tbl set/eche lincat = thar.tbl And run a first identification: identify/echelle A square box will appear in the display, reduce it with the arrows to the size of the lines to be identified and select two pairs of identical lines at consecutive orders Enter absolute order number: 40 (one less than the one calculated by Zmax) Sequence...: 6593.93 (fist line in Angstroms) ..........: 4288.55 If we want to restart, and to avoid the tedius identification, execute: set/ech wlcmtd=restart Now we initiate a round of many identification sessions. The process uses the guess mode, i.e. it will use the previous session to improve next one. set/eche guess=baches save/eche baches set/ech wlcmtd=guess Each identification session finish reporting the lines identified and the accuracy. We will save a session whenever the number of lines increases and the accuracy reduces. We will finish the round when we do not get neither more lines identified without compromising the smallest accuracy. identi/eche For Baches we finished with 929 lines identified and 0.7 pixels of accuracy. The paramater to play are Tolerance (we will start with a big one 2.2 and reducing it. A good solution is with tol=.2 and more than 50% of lines identified set/eche tol = 2.2 Wlciter(2) a value between 0-1, the closet to 0 the more restrict the identification is. wlciter(2) = 0.25 Polinomial order: 5 or 6, better to use a lower polinomial i.e. 4, although it implies less identifications but more accurately. dc = 5 Results: with set/echelle widthi = 13 set/echelle nbordi = 28 dc = 5 wlciter(2) = 0.2 slit = 13 I've obtained: 1176 lines or 82 % identified with MEAN RMS: 0.00982 To se( all echelle parameter type: show/ech w show/ech o To plot the identified lines in a given plot order (eg. 22, this is not the orde number, but the line order, i.e. first 1 is blue last (22) is red, if there were 22 orders identified in the flat-field) plot/ident extwlc 22 If the scale is not good, adjust it with e.g. 0,2000 cuts extwlc 0,2000 Once a good identification is found, save it. Now you can reduce any expectra: (w wavelenth calibrated, r for rebin) indisk/fits .fit .bdf extract/ech w_ rebin/ech w_ rw_ To plot an order(e.g. order 10) plot/ech rw_ 10 To merge all the orders in one single plot (m for merge) merge/ech rw_ mrw_ plot mrw_ To initiate a pipeline with the baches session: set/context echelle initia/echelle baches Plot just a piece (e.g from 4000A to 4100) plot/axes 4000,4100 0,2000 overplot mrw_ Calculate FHWM center/gaus gcursor To print an image: copy/display ppbla76 copy/display ppbla76 prmode=LB8NZ (it does not work on dmdlinb) export PRINTER=ppbla76 lp screen01.ps How I created the th_ref_ident.tbl =================================== Table created with th_ref_ident.dat Where first two columns X, Y are obtained in th_ref.fit with GET/CURSOR 161 943 6834.924#32 1487 883 6834.924#33 327 329 4579.390#48 1213 289 4579.390#49 and th_ref_ident.fmt: DEFINE/FIELD 4 8 I :X DEFINE/FIELD 11 17 I :Y DEFINE/FIELD 25 35 C :IDENT CREA/TABL th_ref_ident 3 4 th_ref_ident.dat th_ref_ident.fmt My sequence =========== #CREATE/DISP 0 970,650,0,0 SET/CONTEXT ECHELLE INITIA/ECHE (nectab.tbl is created) RESET/DIS CREATE/DISP 0 590,390,0,0 LOAD/LUT heat INDISK/FITS ff.fit ff.bdf (i__i.cat and r__r.cat are created) DISPLA/ECHE ff SET/ECHE widthi = 10 SET/ECHE nbordi = 28 DEFINE/HOUG ff.bdf (middumm*.* are created) (outnames.cat, back.tbl, order.tbl are created) SAVE/ECHE baches (bachesORDER.tbl is created) (it requires order.tbl line.tbl back.tbl) (ignores line.tbl) # Clean $ rm i__i.cat r__r.cat $ rm middumm* $ rm outnames.cat back.tbl order.tbl $ rm dat.dat bachesLINE.tbl bachesORDE.tbl line.tbl $ rm extwlc.bdf nectab.tbl graph_wnd000.plt x__x0000.bdf $ rm bachesback.tbl # ask to continue CLEAR/CHAN OVER CREATE/DISP 0 590,390,0,0 LOAD/LUT heat CREATE/DISP 1 590,390,0,390 INDISK/FITS th_ref.fit th_ref.bdf INDISK/FITS th_ref_ident.fit th_ref_ident.tbl LOAD/LUT heat DISPLA/ECHE th_ref CLEAR/CHAN OVER LOAD/TABLE th_ref_ident :X :Y :IDENT 0 6 ASSIGN/DISP 0 INDISK/FITS th.fit th.bdf LOAD/LUT heat DISPLA/ECHE th SET/ECHE wlc=th SET/ECHE slit = 10 EXTRAC/ECHe {wlc} extwlc thres2 = 10. SEARCH/ECHE extwlc (no. of detections: 1598) LOAD/SEAR SAVE/ECHE baches CLEAR/CHAN OVER INDISK/FITS thar.fit thar.tbl SET/ECHE lincat = thar.tbl SET/ECHE tol = 2.2 wlciter(2) = 0.25 dc = 5 IDENTI/ECH SAVE/ECHE baches (851, RMS 0.07362) SET/ECHE guess=baches SAVE/ECHE baches SET/ECHE wlcmtd=guess IDENTI/ECH (954, RMS 0.06238) SAVE/ECHE baches IDENTI/ECH (985, RMS 0.05691) SAVE/ECHE baches SET/ECHE tol = 1.5 IDENTI/ECH (1037, RMS 0.04160) SAVE/ECHE baches IDENTI/ECH (1143, RMS 0.03490) SAVE/ECHE baches IDENTI/ECH (1165, RMS 0.03770) SAVE/ECHE baches SET/ECHE tol = 1.0 IDENTI/ECH (1169, RMS 0.02639) SAVE/ECHE baches IDENTI/ECH (1238, RMS 0.02702) SET/ECHE tol = 0.5 IDENTI/ECH (1174, RMS 0.01847) SAVE/ECHE baches IDENTI/ECH (1205, RMS 0.01858) SAVE/ECHE baches IDENTI/ECH (1216, RMS 0.01823) SAVE/ECHE baches wlciter(2) = 0.2 IDENTI/ECH (1206, RMS 0.01787) SAVE/ECHE baches wlciter(2) = 0.2 IDENTI/ECH (1205, RMS 0.01772) wlciter(2) = 0.1 IDENTI/ECH (1159, RMS 0.01601) SAVE/ECHE baches IDENTI/ECH (1163, RMS 0.01638) SAVE/ECHE baches SET/ECHE tol = 0.2 IDENTI/ECH (1027, RMS 0.00941) SET/ECHE tol = 0.4 IDENTI/ECH (1139, RMS 0.01420) dc = 3 IDENTI/ECH (1196, RMS 0.01451) SAVE/ECHE baches SET/ECHE tol = 0.4 IDENTI/ECH (1274, RMS 0.01465) SAVE/ECHE baches IDENTI/ECH (1303, RMS 0.01459) SAVE/ECHE baches SET/ECHE tol = 0.2 wlciter(2) = 0.1 IDENTI/ECH (1154, RMS 0.00951) SAVE/ECHE baches