! %W% (ESO-ASD) %G% %U% !+++++++++++++++++++++++++++++++++++++++++++++++++++++++ !.IDENT seeing.prg !.PURPOSE: ! ! Computes the seeing in the displayed image. An additional feature is ! that the program asks the observer whether there are any extended ! objects in the sample. If there are no extended objects, the program ! goes on to ask the observer whether the mirror fans are switched on and ! whether the dome sideports are open. After this, the program makes a ! shell escape and executes: ! ! see_db d_filt fa_filt fb_filt ports fans fwx fwy ! ! where d_filt is the DFOSC filter, fa_filt is the FASU a filter, ! fb_filt is the FASU b filter, ports refers to whether the sideports are ! in use (y/n), fans refers to whether the fans are in use, and finally ! fwx and fwy are those measured by the script. The program `see_db' is ! actually a C-shell script that recovers information from the TCS, the ! temperature sensors, and the meteomonitor and then calls a C-program to ! enter all of this information into a database. ! !.USE @c seeing !.AUTHOR Cristian Levin !.VERSION 1.0 01/06/92 Creation !.VERSION 2.0 17/05/94 Cleaned up - K.Banse !.VERSION 2.1 10/01/95 Implementation of parameters file (CL) !.VERSION 2.2 19/09/96 Deselection of misfits before averaging !.VERSION 2.3 24/09/96 Adapted for DAISY headers (JST) !.VERSION 2.4 15/09/98 Adapted to call see_db (JBR+API) ! !.KEYWORDS ! ------------------------------------------------------ ! ! EXTERNAL VARIABLES: ! ! From obsinit.prg: imscale, maxcts, obsmode ! ! LOCAL VARIABLES: ! define/local fwx/r/1/1 0.0 define/local fwy/r/1/1 0.0 define/local seeing/r/1/1 0.0 define/local sigfwx/r/1/1 0.0 define/local sigfwy/r/1/1 0.0 define/local ioff/i/1/2 0,0 define/local ratio/r/1/1 0.0 define/local recent/c/1/1 y define/local extend/c/1/1 n define/local d_filt/C/1/10 define/local fa_filt/C/1/10 define/local fb_filt/C/1/10 define/local fans/C/1/1 n define/local ports/C/1/1 y define/local RA/r/1/1 0.0 define/local DEC/r/1/1 0.0 define/local MJD/r/1/1 0.0 define/local date/r/1/1 0. define/local exptime/r/1/1 0. ! ! Create a table for the output ! create/table seeing 15 0 null ! ! Get the image name ! ioff = ididev(6)*ididev(15)+1 !offset into keyword IDIMEMC ioff(2) = ioff(1)+19 define/local cmc/c/1/20 {idimemc({ioff}:{ioff(2)})} ! ! Determine the observing mode... ! @c get_mode {cmc} ! get the observing mode ! if obsmode(1:4) .eq. "NULL" then return endif ! center/gauss cursor seeing if outputi(1) .eq. 0 then write/out write/out Invalid number of coordinates. return endif ! ! Calculate FWHM in X and Y. Avoid saturated objects and misfits ! (no source, iteration failed, etc) ! set/midas output=no !suppress output select/table seeing :icent .le. {maxcts} .and. :status .le. 1 statist/table seeing :xsig fwx = outputr(3) * 2.35482 * imscale sigfwx = outputr(4) * 2.35482 * imscale statist/table seeing :ysig fwy = outputr(3) * 2.35482 * imscale sigfwy = outputr(4) * 2.35482 * imscale ! ! Write out the results ! set/midas output=yes !re-enable output write/out write/out set/format F6.2 write/out "FWHMx = {fwx} arcsecs FWHMy = {fwy} arcsecs" write/out "sigma-x = +/-{sigfwx} arcsecs sigma-y = +/-{sigfwy} arcsecs" ! ! From here to end is related to the database... ! ! ! Let's avoid adding really bad dataa... ! ratio = {fwx}/{fwy} if {ratio} .GT. 1.5 .OR. {ratio} .LT. 0.67 then write/out "Images are not round -- we won't add this to our seeing database" goto STOP endif ! ! Ask the observer about the sample, and status of ports and fan. ! We need the extended object question in case the fwhm of distant ! GCs etc was being measured... ! write/out inquire/key recent/C/1/1 " Did you just acquire this image? (y/n) [{recent}] " if recent .EQ. "n" .AND. recent .EQ. "N" then write/out "OK, we won't add this to our seeing database" goto STOP endif inquire/key extend/C/1/1 "Are any extended objects in the sample? (y/n) [{extend}] " if extend .NE. "n" .AND. extend .NE. "N" then write/out "OK, we won't add this to our seeing database" goto STOP endif inquire/key fans/C/1/1 " Are the mirror fans on? (y/n) [{fans}] " inquire/key ports/C/1/1 " Are the dome side ports open? (y/n) [{ports}] " ! ! Get DFOSC and FASU filter IDs from the image header. Note: MIDAS does ! not like hashes, the format of the DFOSC Filter ID is ESO#XXX, whilst ! that of FASU is #XXX. All of the below is to extract the filter number ! only. ! define/local tmp1/c/1/7 " NF" copy/dk {cmc} _EIO2_ID tmp1 ! DFOSC Filter ID copy/keyword tmp1/c/5/3 d_filt/c/1/3 define/local tmp2/c/1/4 " NF" copy/dk {cmc} _EIO4_ID tmp2 ! FASU B Filter copy/keyword tmp2/c/2/3 fb_filt/c/1/3 define/local tmp3/c/1/4 " NF" copy/dk {cmc} _EIO5_ID tmp3 ! FASU A Filter copy/keyword tmp3/c/2/3 fa_filt/c/1/3 ! ! Get other parameters from image header... ! set/format I5 F12.6 copy/dk {cmc} CAMERA camfoc ! DFOSC Camera focus value copy/dk {cmc} O_POS O_POS copy/dk {cmc} O_TIME O_TIME copy/dk {cmc} ST ST copy/dk {cmc} ZDIST ZD copy/dk {cmc} HA HA ! Note -- must define below variables as I'm not copying... RA = O_POS(1) ! Self explanatory DEC = O_POS(2) ! Self explanatory MJD = O_TIME(4) ! MJD at *start* of observation. date = O_TIME(1) ! Day of exposure (integer days!) exptime = O_TIME(7) ! DFOSC exposure time date = {O_TIME(1)}+({O_TIME(5)}+{O_TIME(7)}/2.0/60.0/60.0)/24.0/365.0 ! ! Call the shell script to write info to the database. Put in background ! in case of problems... ! write/out "Adding measurement to Danish 1.54-m seeing database..." $touch ~meteolog/public/see_db.log $~meteolog/scripts/see_db {d_filt} {fa_filt} {fb_filt} {ports} {fans} {fwx} {fwy} >> ~meteolog/public/see_db.log & ! ! To circumvent a MIDAS 94NOV bug we reassign the output device ! assign/print TERMINAL ! ! The End... ! STOP: