#!/bin/csh -f #+ # nextfcsimage -- return full disk name of the next FCS image # # Purpose: # Constructs and returns the full name of the next image # based on the outdir, outfile, and frameno keywords # # Usage: # nextfcsimage [-tail] # # Arguments: # -tail = print only the tail of the filename # # Output: # The full (or tail) disk name is echoed to stdout # # Example: # 1) Return the full name of the next red image: # nextfcsimage # returns: # /dsk/iraid1/kics/2002jun06/d0606_0046.fits # # 2) Return the tail of the next red image name: # nextfcsimage -tail # returns: # d0606_0046.fits #- # Modification history: # 2000-Nov-15 GDW Original version # 2001-May-07 GDW Added -tail option # 2002-Jun-06 GDW Adapted for DEIMOS # 2003-Feb-05 GDW Adapted for DEIMOS FCS #----------------------------------------------------------------------- # define usage... set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd [-tail]" set tail = 0 # check flags... if ( "$1" == "-tail" ) then set tail = 1 shift endif # check args... if ( $#argv > 0 ) then printf "$usage\n" exit 1 endif # get the current outfile... set outfile = `show -s deifcs -terse outfile` if ( $status ) exit $status # get the current frameno... set frameno = `show -s deifcs -terse frameno` if ( $status ) exit $status # print results... if ( $tail ) then printf "%s%04d.fits\n" $outfile $frameno else # get the current outdir... set outdir = `show -s deifcs -terse outdir` if ( $status ) exit $status printf "%s/%s%04d.fits\n" $outdir $outfile $frameno endif