!------------------------------------------------------------------------ ! E.S.O. - VLT project ! ! "@(#) $Id: inemmi.prg,v 2.3+ 2003/11/15 01:29:20 vltsccm Exp $" ! ! usage: ! @@ inemmi ONTT.2002-01-02T03:04:05.678.fits ! output: E02T030405.bdf ! or ! crea/aca emmi ONTT*fits ! exec/cat @@ inemmi emmi.cat ! or ! @@ inemmi toto.fits toto ! output: toto.bdf ! ! purpose: read in an EMMI frame produced by the new chip ! and pastes the pieces into a file with a ! civilized name ! ! NOTE: ! works best with Midas version >= 02FEB. With prior version, some ! keywords will be missing from the final image. ! ! EMMI context: ! indisk/emmi ! inemmi/telescope ! ! ! who when what ! --------- -------- ---------------------------------------------- ! ohainaut 2004-08-05 update for new extensions (2 extn) ! ohainaut 2002-05-19 ready for archiving ! ohainaut 2002-04-19 outputc contains the name of the output image ! ohainaut 2002-05-17 CCD pre-scan adjusted to get correct gap. New Starts ! ohainaut 2002-05-13 hardcoded "START" to correct gap position ! ohainaut 2002-05-12 creation ! !------------------------------------------------------------------------- defi/par p1 ? ? "input image" defi/par p2 emmi ? "output image" defi/loc i/i/1/1 0 !- create output image file name defi/loc outname/c/1/72 {p2} if outname .eq. "emmi" .or. m$len(outname) .eq. 0 then if "{p1(1:5)}" .eq. "ONTT." .or. "{p1(1:5)}" .eq. "EMMI." then outname = "{p1(14:15)}T{p1(17:18)}{p1(20:21)}{p1(23:24)}" endif endif !- remove temporary files $ rm -f emmiTmp0*bdf !- which version of MIDAS are we using? defi/loc midVers/c/1/2 {MID$SESS(16:17)} defi/loc flagVers/i/1/1 0 if {midVers} .ge. 98 flagVers = 1 if {midvers} .le. 01 flagVers = 1 !- read in the fits if flagVers .eq. 1 then writ/out "WARNING: using Midas version earlier than 02FEB" writ/out " some keywords will be missing from the header" writ/out " You may want to upgrade " indis/fits {p1} emmiTmp | $ cat - > /dev/null $ mv -f emmiTmp.bdf emmiTmp0001.bdf $ mv -f emmiTmpa.bdf emmiTmp0002.bdf $ mv -f emmiTmpb.bdf emmiTmp0003.bdf $ mv -f emmiTmpc.bdf emmiTmp0004.bdf else indisk/mfits {p1} emmiTmp | $ cat - > /dev/null endif !- check if it was a multiple extension fits i = m$exist("emmiTmp0002.bdf") if i .eq. 1 then !-- we have a mult. extension $ mv emmiTmp0000.bdf emmiTmpHdr.bdf crea/ica emmiTmp emmiTmp000*.bdf aver/ima {outname} = emmiTmp.cat M 0 average writ/out "...done" !- update descriptors writ/out "updating descriptors..." if flagVers .eq. 0 then copy/dd emmiTmpHdr *,3 {outname} dele/desc {outname} IDENT copy/dd emmiTmpHdr ESO.OBS.NAME {outname} IDENT endif copy/dd emmiTmp0002 *DET*,3 {outname} dele/desc {outname} CUNIT copy/dd emmiTmp0001 CUNIT {outname} CUNIT else !- this was not a mult. ext. image $ mv emmiTmp0001.bdf {outname}.bdf endif defi/loc emode/c/1/72 X emode = "{{outname},ESO.INS.MODE}" outputc = "e{emode(1:1)}_{outname}.bdf" $ mv {outname}.bdf {outputc} wri/out "--> output file in {outputc}" ! --oOo--