#!/bin/csh -f source /star/etc/login >& /dev/null source /star/etc/cshrc >& /dev/null source /star/bin/smurf/smurf.csh >& /dev/null kappa >& /dev/null if (`alias kappa` == "") then echo "" echo "Fatal: Initialization error of kappa environment" echo "" exit endif if ($#argv < 1) set argv = "help" if (`printenv obsdate` == "") then echo "" echo "***Error*** variable obsdate not set" set argv = "help" endif if ($argv[1] =~ *"help"* || $argv[1] == "-h") then echo "" echo "Use: sp_get obsnr1 obsnr2 ..." echo " e.g. 'sp_get 10 11 13 15'" echo "" echo " Get a spectra file and run makecube on it." echo " set the variable obsdate to the correct obsdate of" echo " the files to copy. E.g. 'setenv obsdate 20061025'" echo " sp_get will do a 'sp_axis .. vrad' on the resulting file." echo "" exit else set answer = "$argv" endif set obsdir = "/jcmtdata/raw/acsis/spectra/${obsdate}" if !(-e "$obsdir") then echo "" echo "Fatal: obs dir $obsdir not found" echo "" exit endif @ j = 0; echo "" echo "Copying from ${obsdir}:" foreach i ( $argv ) @ j ++ set obsnr = `printf "%5.5d" ${i}` set spcdir = ${obsdir}/${obsnr} set infile = a${obsdate}_${obsnr}_01_0001.sdf set outfile = $infile echo -n " $i ..." if (-e "${spcdir}/${infile}") then \cp -f ${spcdir}/${infile} $outfile if (-e "$outfile") then makecube in=${outfile} autogrid out=ac${obsdate}_${obsnr} else echo "" echo "Failed to copy file $infile" echo "" exit endif else echo "" echo "Fatal: can not find file $infile" echo "" exit endif end echo ""