Index: trunk/tools/run.setphot
===================================================================
--- trunk/tools/run.setphot	(revision 34869)
+++ trunk/tools/run.setphot	(revision 34870)
@@ -1,8 +1,37 @@
 #!/bin/csh -f
 
-set ubercal = ucalqv_noref.fits
-set catdir_3pi = ../3pi.20111229/catdir.3pi
+if ($#argv != 1) then 
+  echo "USAGE: run.setphot (catdir)"
+  exit 2
+endif
 
-echo -n "--- starting setphot $catdir_3pi ---"; date
+set REALRUN = 0
+
+set  catdir = $argv[1]
+set ubercal = ~ipp/ucalqw_noref.fits
+
+alias run.setphot \
+  'echo -n "--- starting setphot $catdir --- "; date; \
+   echo          setphot $options -D CATDIR $catdir $ubercal; \
+   if ($REALRUN) setphot $options -D CATDIR $catdir $ubercal'
+
+set options = ""
+set options = "$options -update"
+set options = "$options -ubercal"
+set options = "$options -no-metadata"
+
+# activate parallel mode when catdir is parallel
+# set options = "$options -parallel"
+
+# the new ubercal file includes Eddie's offsets relative to JT (so, no need to supply -zpt-offsets)
+run.setphot
+if ($status) then
+  echo "failed setphot"
+  echo -n "--- done with setphot ---"; date
+  exit 1
+endif
+echo -n "--- done with setphot ---"; date
+exit 0
+
 
 # old command lines with zpt offsets
@@ -10,9 +39,2 @@
 # setphot -images-only -parallel -reset -zpt-offsets g,r,i,z,y -0.013,+0.012,+0.001,-0.016,-0.021 -update -ubercal -no-metadata -D CATDIR $catdir_3pi $ubercal
 
-# the new ubercal file includes Eddie's offsets relative to JT (so, no need to supply -zpt-offsets)
-echo setphot -parallel -update -ubercal -no-metadata -D CATDIR $catdir_3pi $ubercal
-setphot -parallel -update -ubercal -no-metadata -D CATDIR $catdir_3pi $ubercal
-if ($status) then
-  echo "failed setphot"
-endif
-echo -n "--- done with setphot ---"; date
