#!/bin/tcsh -f # SAOTNG.CSH -- Startup saotng version of the ximtool program # # Eric Mandel 12/29/93 # unalias rm set doverbose = "f" if ( $?SAORD_NOINTR == 0 ) then onintr cleanup endif # initialize SAORD variables if ( $?SAORD_ROOT == 0 ) then setenv SAORD_ROOT /scisoft/saord endif if ( -e ${SAORD_ROOT}/xpa1 ) then setenv XPA_VERSION 1 else setenv XPA_VERSION 2 endif if ( $?SAORD_BIN == 0 ) then setenv SAORD_BIN ${SAORD_ROOT}/bin.`${SAORD_ROOT}/getarch` endif # load user preferences as soon as we can if ( -e ~/.saotng ) then source ~/.saotng else if ( -e ${SAORD_BIN}/saotng-defaults ) then source ${SAORD_BIN}/saotng-defaults endif if ( $?SAORD_TMPDIR == 0 ) then setenv SAORD_TMPDIR /tmp endif setenv SAORD_VERSION "`cat ${SAORD_ROOT}/VERSION`" # end of SAORD initialization set noglob # This initialization variable was used for older X programs if ( $?SAORD_GUIFLAVOR == 0 ) setenv SAORD_GUIFLAVOR DEFAULT # make sure we have the program if ( $?SAOTNGEXE == 0 ) then setenv SAOTNGEXE ${SAORD_BIN}/SAOtng else echo "Using alternate SAOtng program: ${SAOTNGEXE}" endif if (! -e $SAOTNGEXE) then echo "$SAOTNGEXE program could not be found ... exiting ..." exit(1) endif # Seed the XRM variable set XRM = "" # these are used by others, so define them first if ( $?SAOTNG == 0 ) then setenv SAOTNG SAOtng endif if ( $?SAOTNG_TITLE == 0 ) then setenv SAOTNG_TITLE ${SAOTNG} endif if ( $?SAORD_GUIFLAVOR == 0 ) then setenv SAORD_GUIFLAVOR DEFAULT endif if ( $?SAOTNG_ACCEL != 0 ) then set XRM = "${XRM} -xrm *accel:${SAOTNG_ACCEL}" endif if ( $?SAOTNG_ACOLORS != 0 ) then set XRM = "${XRM} -xrm *accelcolors:${SAOTNG_ACOLORS}" endif if ( $?SAOTNG_ALLOWTCL != 0 ) then set XRM = "${XRM} -xrm *allowtcl:${SAOTNG_ALLOWTCL}" endif if ( $?SAOTNG_ANAL != 0 ) then set XRM = "${XRM} -xrm *amgr:${SAOTNG_ANAL}" endif if ( $?SAOTNG_AUTOCONFIG != 0 ) then set XRM = "${XRM} -xrm *autoconfig:${SAOTNG_AUTOCONFIG}" else if ( $?XIMTOOL_FRAME_WIDTH != 0 ) then set XRM = "${XRM} -xrm *autoconfig:false" endif if ( $?XIMTOOL_FRAME_HEIGHT != 0 ) then set XRM = "${XRM} -xrm *autoconfig:false" endif endif if ( $?SAOTNG_AUTOFLIP != 0 ) then set XRM = "${XRM} -xrm *autoflip:${SAOTNG_AUTOFLIP}" endif if ( $?SAOTNG_BLOCK != 0 ) then if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; blocking $SAOTNG_BLOCK" else setenv SAOTNG_INITCMDS "blocking $SAOTNG_BLOCK" endif endif if ( $?SAOTNG_BLOCKPREF != 0 ) then set XRM = "${XRM} -xrm *blocking_preference:${SAOTNG_BLOCKPREF}" endif if ( $?SAOTNG_CHECKNAN != 0 ) then set XRM = "${XRM} -xrm *checkNaN:${SAOTNG_CHECKNAN}" endif if ( $?SAOTNG_CMAPNAME != 0 ) then set XRM = "${XRM} -xrm *cmapName:${SAOTNG_CMAPNAME}" endif if ( $?SAOTNG_CMAP1 != 0 ) then set XRM = "${XRM} -xrm *cmapDir1:${SAOTNG_CMAP1}" else set XRM = "${XRM} -xrm *cmapDir1:${SAORD_ROOT}/Colormaps/" endif if ( $?SAOTNG_CMAP2 != 0 ) then set XRM = "${XRM} -xrm *cmapDir2:${SAOTNG_CMAP2}" endif if ( $?SAOTNG_COLORMAP != 0 ) then if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; colormap $SAOTNG_COLORMAP" else setenv SAOTNG_INITCMDS "colormap $SAOTNG_COLORMAP" endif endif if ( $?SAOTNG_COLOROPT != 0 ) then if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; colormap $SAOTNG_COLOROPT" else setenv SAOTNG_INITCMDS "colormap $SAOTNG_COLOROPT" endif endif if ( $?SAOTNG_COORDS != 0 ) then if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; coords $SAOTNG_COORDS" else setenv SAOTNG_INITCMDS "coords $SAOTNG_COORDS" endif endif if ( $?SAOTNG_FIFO != 0 ) then set XRM = "${XRM} -xrm *input_fifo:${SAOTNG_FIFO}i" set XRM = "${XRM} -xrm *output_fifo:${SAOTNG_FIFO}o" endif if ( $?SAOTNG_FILES != 0 ) then set XRM = "${XRM} -xrm *fmgr:${SAOTNG_FILES}" endif if ( $?SAOTNG_FITSEVEN != 0 ) then set XRM = "${XRM} -xrm *fitseven:${SAOTNG_FITSEVEN}" endif if ( $?SAOTNG_FIXMARKERS != 0 ) then set XRM = "${XRM} -xrm *fixmarkers:${SAOTNG_FIXMARKERS}" endif if ( $?SAOTNG_FLIP != 0 ) then set XRM = "${XRM} -xrm *flip:${SAOTNG_FLIP}" endif if ( $?SAOTNG_FRAME != 0 ) then if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; frame ${SAOTNG_FRAME}" else setenv SAOTNG_INITCMDS "frame ${SAOTNG_FRAME}" endif endif if ( $?SAOTNG_GUI != 0 ) then set XRM = "${XRM} -xrm *gui:${SAOTNG_GUI}" endif if ( $?SAOTNG_HELPDIR == 0 ) then setenv SAOTNG_HELPDIR ${SAORD_ROOT}/Help/ endif if ( $?SAOTNG_HELPPAGE == 0 ) then setenv SAOTNG_HELPPAGE "help.html" endif if ( $?SAOTNG_HOGMEMORY != 0 ) then set XRM = "${XRM} -xrm *hogmemory:${SAOTNG_HOGMEMORY}" endif if ( $?SAOTNG_IFIFO != 0 ) then set XRM = "${XRM} -xrm *input_fifo:${SAOTNG_IFIFO}" endif if ( $?SAOTNG_KNOTSIZE != 0 ) then set XRM = "${XRM} -xrm *markerLineKnotSize: ${SAOTNG_KNOTSIZE}" set XRM = "${XRM} -xrm *markerPgonKnotSize: ${SAOTNG_KNOTSIZE}" set XRM = "${XRM} -xrm *markerRectKnotSize: ${SAOTNG_KNOTSIZE}" endif if ( $?SAOTNG_MANAL != 0 ) then set XRM = "${XRM} -xrm *mmgr:${SAOTNG_MANAL}" endif if ( $?SAOTNG_MAXSIZE != 0 ) then set XRM = "${XRM} -xrm *maxsize:${SAOTNG_MAXSIZE}" endif if ( $?SAOTNG_OFIFO != 0 ) then set XRM = "${XRM} -xrm *output_fifo:${SAOTNG_OFIFO}" endif if ( $?SAOTNG_PFILES == 0 ) then set SAOTNG_PFILES = ${SAORD_ROOT}/PFILES endif if ( $?SAOTNG_PORT != 0 ) then set XRM = "${XRM} -xrm *port:${SAOTNG_PORT}" endif if ( $?SAOTNG_PRINTER != 0 ) then set XRM = "${XRM} -xrm *printer:${SAOTNG_PRINTER}" endif if ( $?SAOTNG_RNAMES != 0 ) then set XRM = "${XRM} -xrm *regionnames:${SAOTNG_RNAMES}" endif if ( $?SAOTNG_SAVESCALED != 0 ) then set XRM = "${XRM} -xrm *savescaled:${SAOTNG_SAVESCALED}" endif if ( $?SAOTNG_SCALE != 0 ) then set XRM = "${XRM} -xrm *scale:${SAOTNG_SCALE}" endif if ( $?SAOTNG_SCALELIMS != 0 ) then set XRM = "${XRM} -xrm *scalelims:${SAOTNG_SCALELIMS}" endif if ( $?SAOTNG_SCALES != 0 ) then set XRM = "${XRM} -xrm *smgr:${SAOTNG_SCALES}" endif if ( $?SAOTNG_UNIXADDR != 0 ) then set XRM = "${XRM} -xrm *unixaddr:${SAOTNG_UNIXADDR}" endif if ( $?SAOTNG_WARNING != 0 ) then set XRM = "${XRM} -xrm *warnings:${SAOTNG_WARNING}" endif if ( $?SAOTNG_WELCOME == 0 ) then setenv SAOTNG_WELCOME "Welcome to SAOtng $SAORD_VERSION" endif if ( $?SAOTNG_WINHEIGHT != 0 ) then set XRM = "${XRM} -xrm *winHeight:${SAOTNG_WINHEIGHT}" endif if ( $?SAOTNG_WINWIDTH != 0 ) then set XRM = "${XRM} -xrm *winWidth:${SAOTNG_WINWIDTH}" endif if ( $?SAOTNG_XDIR != 0 ) then set doxdir = ${SAOTNG_XDIR} else set doxdir = "False" endif if ( $?SAOTNG_ZOOM != 0 ) then if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; zoom $SAOTNG_ZOOM" else setenv SAOTNG_INITCMDS "zoom $SAOTNG_ZOOM" endif endif setenv XPA_TARGET ${SAOTNG} setenv UIRAFSUBS ${SAORD_BIN}/uiraf.subs # make sure there is an IMAGE_PATH, even if NULL if ( $?IMAGE_PATH == 0 ) then setenv IMAGE_PATH "" endif # get args from command line set n = 1 while ("$n" <= "$#argv") if ( "$argv[$n]" == "-echo" ) then set echo else if ( "$argv[$n]" == "-accel" ) then @ n++ set XRM = "${XRM} -xrm *accel:$argv[$n]" else if ( "$argv[$n]" == "-accelcolor" ) then @ n++ set XRM = "${XRM} -xrm *accelcolors:$argv[$n]" else if ( "$argv[$n]" == "-allowtcl" ) then @ n++ set XRM = "${XRM} -xrm *allowtcl:$argv[$n]" else if ( "$argv[$n]" == "-analysis" ) then @ n++ set XRM = "${XRM} -xrm *amgr:$argv[$n]" else if ( "$argv[$n]" == "-analformat" ) then @ n++ setenv SAOTNG_ANALFORMAT "$argv[$n]" else if ( "$argv[$n]" == "-autoconfig" ) then @ n++ set XRM = "${XRM} -xrm *autoconfig:$argv[$n]" else if ( "$argv[$n]" == "-autoflip" ) then @ n++ set XRM = "${XRM} -xrm *autoflip:$argv[$n]" else if ( "$argv[$n]" == "-backgroundcolor" ) then @ n++ setenv SAOTNG_BACKGROUNDCOLOR "$argv[$n]" else if ( "$argv[$n]" == "-b" ) then setenv SAORD_GUIFLAVOR BEAUTIFUL set XRM = "${XRM} -xrm *accelcolors:multi" else if ( "$argv[$n]" == "-beautiful" ) then setenv SAORD_GUIFLAVOR BEAUTIFUL set XRM = "${XRM} -xrm *accelcolors:multi" else if ( "$argv[$n]" == "-bland" ) then setenv SAORD_GUIFLAVOR BLAND else if ( "$argv[$n]" == "-block" ) then @ n++ if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; blocking $argv[$n]" else setenv SAOTNG_INITCMDS "blocking $argv[$n]" endif else if ( "$argv[$n]" == "-blocking_preference" ) then @ n++ set XRM = "${XRM} -xrm *blocking_preference:$argv[$n]" else if ( "$argv[$n]" == "-checkNaN" ) then @ n++ set XRM = "${XRM} -xrm *checkNaN:$argv[$n]" else if ( "$argv[$n]" == "-cmapname" ) then @ n++ set XRM = "${XRM} -xrm *cmapName:$argv[$n]" else if ( "$argv[$n]" == "-cmaps" ) then @ n++ set XRM = "${XRM} -xrm *cmapDir2:$argv[$n]" else if ( "$argv[$n]" == "-colormap" ) then @ n++ if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; colormap $argv[$n]" else setenv SAOTNG_INITCMDS "colormap $argv[$n]" endif else if ( "$argv[$n]" == "-coloropt" ) then @ n++ if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; colormap $argv[$n]" else setenv SAOTNG_INITCMDS "colormap $argv[$n]" endif else if ( "$argv[$n]" == "-commandbackground" ) then @ n++ setenv SAOTNG_COMMANDBACKGROUND "$argv[$n]" else if ( "$argv[$n]" == "-commandforeground" ) then @ n++ setenv SAOTNG_COMMANDFOREGROUND "$argv[$n]" else if ( "$argv[$n]" == "-commandfont" ) then @ n++ setenv SAOTNG_COMMANDFONT "$argv[$n]" else if ( "$argv[$n]" == "-controlpanel" ) then @ n++ setenv SAOTNG_CONTROLPANEL "$argv[$n]" else if ( "$argv[$n]" == "-coords" ) then @ n++ if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; coords $argv[$n]" else setenv SAOTNG_INITCMDS "coords $argv[$n]" endif else if ( "$argv[$n]" == "-defaultcolor" ) then @ n++ setenv SAOTNG_DEFAULTCOLOR "$argv[$n]" else if ( "$argv[$n]" == "-dialogcolor" ) then @ n++ setenv SAOTNG_DIALOGCOLOR "$argv[$n]" else if ( "$argv[$n]" == "-display" ) then @ n++ setenv DISPLAY "$argv[$n]" else if ( "$argv[$n]" == "-errorlog" ) then @ n++ setenv SAOTNG_ERRORLOG "$argv[$n]" else if ( "$argv[$n]" == "-fifo" ) then @ n++ set XRM = "${XRM} -xrm *input_fifo:$argv[$n]i" set XRM = "${XRM} -xrm *output_fifo:$argv[$n]o" else if ( "$argv[$n]" == "-files" ) then @ n++ set XRM = "${XRM} -xrm *fmgr:$argv[$n]" else if ( "$argv[$n]" == "-flavor" ) then @ n++ setenv SAORD_GUIFLAVOR "$argv[$n]" else if ( "$argv[$n]" == "-fix" ) then @ n++ set XRM = "${XRM} -xrm *fixmarkers:$argv[$n]" else if ( "$argv[$n]" == "-flip" ) then @ n++ set XRM = "${XRM} -xrm *flip:$argv[$n]" else if ( "$argv[$n]" == "-frame" ) then @ n++ if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; frame $argv[$n]" else setenv SAOTNG_INITCMDS "frame $argv[$n]" endif else if ( "$argv[$n]" == "-frameheight" ) then @ n++ setenv XIMTOOL_FRAME_HEIGHT "$argv[$n]" set XRM = "${XRM} -xrm *autoconfig:false" else if ( "$argv[$n]" == "-framesize" ) then @ n++ setenv XIMTOOL_FRAME_WIDTH "$argv[$n]" setenv XIMTOOL_FRAME_HEIGHT "$argv[$n]" set XRM = "${XRM} -xrm *autoconfig:false" else if ( "$argv[$n]" == "-framewidth" ) then @ n++ setenv XIMTOOL_FRAME_WIDTH "$argv[$n]" set XRM = "${XRM} -xrm *autoconfig:false" else if ( "$argv[$n]" == "-gui" ) then @ n++ set XRM = "${XRM} -xrm *gui:$argv[$n]" else if ( "$argv[$n]" == "-helpdir" ) then @ n++ setenv SAOTNG_HELPDIR "$argv[$n]" else if ( "$argv[$n]" == "-helppage" ) then @ n++ setenv SAOTNG_HELPPAGE "$argv[$n]" else if ( "$argv[$n]" == "-helpuserdir" ) then @ n++ setenv SAOTNG_HELPUSERDIR "$argv[$n]" else if ( "$argv[$n]" == "-hog" ) then @ n++ set XRM = "${XRM} -xrm *hogmemory:$argv[$n]" else if ( "$argv[$n]" == "-imgdir" ) then @ n++ setenv SAOTNG_IMGDIR "$argv[$n]" else if ( "$argv[$n]" == "-imgfilter" ) then @ n++ setenv SAOTNG_IMGFILTER "$argv[$n]" else if ( "$argv[$n]" == "-init" ) then @ n++ if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; $argv[$n]" else setenv SAOTNG_INITCMDS "$argv[$n]" endif else if ( "$argv[$n]" == "-input_fifo" ) then @ n++ set XRM = "${XRM} -xrm *input_fifo:$argv[$n]" else if ( "$argv[$n]" == "-kbprefix" ) then @ n++ setenv SAOTNG_KBPREFIX "$argv[$n]" else if ( "$argv[$n]" == "-knotsize" ) then @ n++ set XRM = "${XRM} -xrm *markerLineKnotSize:$argv[$n]" set XRM = "${XRM} -xrm *markerPgonKnotSize:$argv[$n]" set XRM = "${XRM} -xrm *markerRectKnotSize:$argv[$n]" else if ( "$argv[$n]" == "-largefont1" ) then @ n++ setenv SAOTNG_LARGEFONT1 "$argv[$n]" else if ( "$argv[$n]" == "-manalysis" ) then @ n++ set XRM = "${XRM} -xrm *mmgr:$argv[$n]" else if ( "$argv[$n]" == "-marker" ) then @ n++ setenv SAOTNG_MARKER "$argv[$n]" else if ( "$argv[$n]" == "-markerfont" ) then @ n++ setenv SAOTNG_MARKERFONT "$argv[$n]" else if ( "$argv[$n]" == "-markerwarning" ) then @ n++ setenv SAOTNG_MARKERWARNING "$argv[$n]" else if ( "$argv[$n]" == "-maxsize" ) then @ n++ set XRM = "${XRM} -xrm *maxsize:$argv[$n]" else if ( "$argv[$n]" == "-menubackground" ) then @ n++ setenv SAOTNG_MENUBACKGROUND "$argv[$n]" else if ( "$argv[$n]" == "-menuforeground" ) then @ n++ setenv SAOTNG_MENUFOREGROUND "$argv[$n]" else if ( "$argv[$n]" == "-menufont" ) then @ n++ setenv SAOTNG_MENUFONT "$argv[$n]" else if ( "$argv[$n]" == "-messages" ) then @ n++ setenv SAOTNG_MESSAGES "$argv[$n]" else if ( "$argv[$n]" == "-ncolors" ) then @ n++ set XRM = "${XRM} -xrm *ncolors:$argv[$n]" else if ( "$argv[$n]" == "-output_fifo" ) then @ n++ set XRM = "${XRM} -xrm *output_fifo:$argv[$n]" else if ( "$argv[$n]" == "-panmag" ) then @ n++ setenv SAOTNG_PANMAG "$argv[$n]" else if ( "$argv[$n]" == "-port" ) then @ n++ set XRM = "${XRM} -xrm *port:$argv[$n]" else if ( "$argv[$n]" == "-printer" ) then @ n++ set XRM = "${XRM} -xrm *printer:$argv[$n]" else if ( "$argv[$n]" == "-prosregions" ) then setenv SAOTNG_SAVEREGIONS 'xpaget $xpa regions | sed -f \${SAORD_BIN}/prosregions.sed > $filename' else if ( "$argv[$n]" == "-regdir" ) then @ n++ setenv SAOTNG_REGDIR "$argv[$n]" else if ( "$argv[$n]" == "-regfilter" ) then @ n++ setenv SAOTNG_REGFILTER "$argv[$n]" else if ( "$argv[$n]" == "-regargs" ) then @ n++ setenv SAOTNG_REGARGS "$argv[$n]" else if ( "$argv[$n]" == "-rv" ) then @ n++ setenv SAOTNG_REVERSEVIDEO "$argv[$n]" else if ( "$argv[$n]" == "-rnames" ) then @ n++ set XRM = "${XRM} -xrm *regionnames:$argv[$n]" else if ( "$argv[$n]" == "-savescaled" ) then @ n++ set XRM = "${XRM} -xrm *savescaled:$argv[$n]" else if ( "$argv[$n]" == "-scale" ) then @ n++ set XRM = "${XRM} -xrm *scale:$argv[$n]" else if ( "$argv[$n]" == "-scalelims" ) then @ n++ set XRM = "${XRM} -xrm *scalelims:$argv[$n]" else if ( "$argv[$n]" == "-scales" ) then @ n++ set XRM = "${XRM} -xrm *smgr:$argv[$n]" else if ( "$argv[$n]" == "-smallfont1" ) then @ n++ setenv SAOTNG_SMALLFONT1 "$argv[$n]" else if ( "$argv[$n]" == "-smallfont2" ) then @ n++ setenv SAOTNG_SMALLFONT2 "$argv[$n]" else if ( "$argv[$n]" == "-smallfont3" ) then @ n++ setenv SAOTNG_SMALLFONT3 "$argv[$n]" else if ( "$argv[$n]" == "-textbkgd" ) then @ n++ setenv SAOTNG_TEXTBKGD "$argv[$n]" else if ( "$argv[$n]" == "-textdisplay" ) then @ n++ setenv SAOTNG_TEXTDISPLAY "$argv[$n]" else if ( "$argv[$n]" == "-title" ) then @ n++ setenv SAOTNG "$argv[$n]" setenv SAOTNG_TITLE "$SAOTNG" else if ( "$argv[$n]" == "-tmpdir" ) then @ n++ setenv SAORD_TMPDIR "$argv[$n]" else if ( "$argv[$n]" == "-transprefix" ) then @ n++ setenv SAOTNG_TRANSPREFIX "$argv[$n]" else if ( "$argv[$n]" == "-unixaddr" ) then @ n++ set XRM = "${XRM} -xrm *unixaddr:$argv[$n]" else if ( "$argv[$n]" == "-verbose" ) then @ n++ setenv SAOTNG_VERBOSE "$argv[$n]" else if ( "$argv[$n]" == "-warning" ) then @ n++ set XRM = "${XRM} -xrm *warnings:$argv[$n]" else if ( "$argv[$n]" == "-winwidth" ) then @ n++ set XRM = "${XRM} -xrm *winWidth:$argv[$n]" else if ( "$argv[$n]" == "-winheight" ) then @ n++ set XRM = "${XRM} -xrm *winHeight:$argv[$n]" else if ( "$argv[$n]" == "-winsize" ) then @ n++ set XRM = "${XRM} -xrm *winWidth:$argv[$n]" set XRM = "${XRM} -xrm *winHeight:$argv[$n]" else if ( "$argv[$n]" == "-xdir" ) then setenv SAOTNG_XDIR "True" set doxdir = "True" else if ( "$argv[$n]" == "-xrm" ) then @ n++ set XRM = "${XRM} -xrm $argv[$n]" else if ( "$argv[$n]" == "-zoom" ) then @ n++ if ( $?SAOTNG_INITCMDS != 0 ) then setenv SAOTNG_INITCMDS "${SAOTNG_INITCMDS}; zoom $argv[$n]" else setenv SAOTNG_INITCMDS "zoom $argv[$n]" endif else if ( `${SAORD_BIN}/access $argv[$n] r ". $IMAGE_PATH $path"` != "" ) then set XRM = "${XRM} -xrm *file:$argv[$n]" else echo "ERROR: bad command-line option (or non-existent file): $argv[$n]" exit(1) endif endif @ n++ end # now that we have the title, we can set the error log if ( $?SAOTNG_ERRORLOG == 0 ) then set XRM = "${XRM} -xrm *errorlog:${SAOTNG_TITLE}_error.log" else set XRM = "${XRM} -xrm *errorlog:${SAOTNG_ERRORLOG}" endif if ( $?SAOTNG_VERBOSE != 0 ) then if ( ($SAOTNG_VERBOSE == "True") || ($SAOTNG_VERBOSE == "true") || ($SAOTNG_VERBOSE == "TRUE") ) then set doverbose = "t" endif endif # this is the final saotng hack 4/29/99 ... uggh ... if ( $?SAOTNG_REVERSEVIDEO != 0 ) then if ( ($SAOTNG_REVERSEVIDEO == "True") || ($SAOTNG_REVERSEVIDEO == "true") || ($SAOTNG_REVERSEVIDEO == "TRUE") ) then set XRM = "${XRM} -xrm *color0:white" set XRM = "${XRM} -xrm *color1:black" set XRM = "${XRM} -xrm *color0Str:white" set XRM = "${XRM} -xrm *color1Str:black" endif endif # look for xpa1 name conflict if ( "$XPA_VERSION" == "1" ) then if ( `${SAORD_BIN}/xpaaccess ${SAOTNG_TITLE}` == "yes" ) then echo "You can run only one SAOtng with the title '${SAOTNG_TITLE}' on a given machine." echo "Please use -title to run multiple SAOtng's on the same machine ..." exit(1) endif endif # either set PFILES, or add the SAOTNG PFILES directory if ($?PFILES == 0) then setenv PFILES ";${SAOTNG_PFILES}" else set expar=`${SAORD_BIN}/paccess fitsextract` if ( $expar != "" ) then grep -s ofits $expar >& /dev/null if ( $status == 1 ) then echo "The file $expar is outdated. Please delete it now." endif endif echo $PFILES | grep -s ";" >& /dev/null if ( $status == 0 ) then setenv PFILES "${PFILES}:${SAOTNG_PFILES}" else setenv PFILES "${PFILES};${SAOTNG_PFILES}" endif endif # bring up xdir, if necessary if ( "$doxdir" == "True" ) then xdir & endif # We tell SAOtng that we are running from a script (which is required) setenv SAOTNG_STANDALONE False # bring up saotng if ( $doverbose == "t" ) then echo "Executing: ${SAOTNGEXE} -title ${SAOTNG_TITLE} ${XRM}" endif ${SAOTNGEXE} -title ${SAOTNG_TITLE} ${XRM} cleanup: unset noglob # kill processes if ( $?SAORD_BIN != 0 ) then ${SAORD_BIN}/killp "xpaset ${SAOTNG}" >& /dev/null ${SAORD_BIN}/killp "xpaget ${SAOTNG}" >& /dev/null endif # delete temp files if ( $?SAORD_TMPDIR != 0 ) then rm -f ${SAORD_TMPDIR}/{saotng.lut,clvars.csh} >& /dev/null rm -f ${SAORD_TMPDIR}/{fitsextract.par,scale.par} >& /dev/null rm -f ${SAORD_TMPDIR}/{blkfits.par,hdrfits.par,imcnts.par} >& /dev/null rm -f ${SAORD_TMPDIR}/{t,}wwwtng_* >& /dev/null endif if ( $?SAOTNG_ERRORLOG == 0 ) then if ( $?SAOTNG_TITLE != 0 ) then rm -f ${SAOTNG_TITLE}_error.log >& /dev/null endif else rm -f ${SAOTNG_ERRORLOG} >& /dev/null endif if ( $doverbose == "t" ) then echo " " echo "All done\!" echo " " endif exit(0)