# Auto-generated batch file Thu Apr 10 21:25:30 2014
#PBS -l nodes=1
#PBS -l walltime=48:00:00
#PBS -W umask=0022
#PBS -V
#PBS -j oe
cd $PBS_O_WORKDIR

#- Echo commands to make debugging easier
set -o verbose

#- The real work
setup idlspec2d v5_7_0
echo 'sdss_plate_sort,"spPlan2d-3928-55328.par"' | idl
echo 'sdss_plate_sort,"spPlan2d-3928-55329.par"' | idl
echo 'sdss_plate_sort,"spPlan2d-3928-55330.par"' | idl
echo 'sdss_plate_sort,"spPlan2d-3928-55331.par"' | idl
echo 'spreduce2d,"spPlan2d-3928-55328.par"' | idl
echo 'spreduce2d,"spPlan2d-3928-55329.par"' | idl
echo 'spreduce2d,"spPlan2d-3928-55330.par"' | idl
echo 'spreduce2d,"spPlan2d-3928-55331.par"' | idl
echo 'spcombine_v5,"spPlancomb-3928-55331.par"' | idl
setup idlspec2d v5_7_0
echo 'spreduce1d,"spPlate-3928-55331.fits",run1d="v5_7_0"' | idl

#- Make pretty pictures
idl -e "plate_spec_image, 3928, mjd=55331, run1d='v5_7_0', run2d='v5_7_0', /silent" 2>&1 | grep -v "Number of Polygon vertices"
