#!/bin/csh -f

#tile is set to process and tile H images.  Uncomment the relivant lines to process V images instead (remember to comment the lines which relate to h.fits files)

rm planet_data.txt
touch planet_data.txt
rm names.list
touch names.list

@ i = 27745
@ c = 0
 
while ( $i <= 27760 )

  ./quicklook ./Saturn/sharc2-0$i.fits -r rgm.dat -d Jan7 -y 20060107  
  mv h.fits h.$i.fits
  #mv v.fits v.$i.fits
  echo "./h.$i.fits" >> names.list
  #echo "./v.$i.fits" >> names.list
  @ i++
  @ c++  

end

@ i = 27905
 
while ( $i <= 27920 )

  ./quicklook ./Saturn/sharc2-0$i.fits -r rgm.dat -d Jan8 -y 20060108  
  mv h.fits quick.$i.fits
  #mv v.fits v.$i.fits
  echo "./h.$i.fits" >> names.list
  #echo "./v.$i.fits" >> names.list
  @ i++
  @ c++  

end


./quicktile -n $c -f names.list

@ i = 27745
 
while ( $i <= 27760 )

  rm h.$i.fits
  #rm v.$i.fits
  @ i++
  
end

@ i = 27905
 
while ( $i <= 27920 )

  rm h.$i.fits
  #rm v.$i.fits
  @ i++
  
end

rm v.fits
#rm h.fits

