Index: trunk/tools/eam/teleff/warpmask.pro
===================================================================
--- trunk/tools/eam/teleff/warpmask.pro	(revision 41717)
+++ trunk/tools/eam/teleff/warpmask.pro	(revision 41719)
@@ -2,5 +2,5 @@
 
 $VERBOSE    = 1	       
-$COPYMASKS  = 1
+$COPYMASKS  = 0
 $OUTDIR     = .
 $OUTVERSION = XXX
@@ -46,9 +46,14 @@
   if ($VERBOSE) echo "loaded Rref[] sources from reference $refsrcs"
 
+  # delete any existing output vectors
+  foreach field $REF_FIELDS_WRP $XTR_FIELDS_WRP
+    delete -q $field\_out
+  end
+
   # find matching entries in smf file 
   for i 0 $warpMask:n
     get.warp.mask.stats $warpMask:$i
 
-    foreach field REF_FIELDS_WRP $XTR_FIELDS_WRP
+    foreach field $REF_FIELDS_WRP $XTR_FIELDS_WRP
       concat $field\_onchp $field\_out
       delete $field\_onchp
@@ -61,5 +66,5 @@
   end
 
-  sprintf output "%s/%s.%s.%s.warp.stf" $OUTDIR $expname $skycell:$i $OUTVERSION
+  sprintf output "%s/%s.%s.wrp.stf" $OUTDIR $expname $OUTVERSION
   write -fits DATA $output $OUT_FIELDS
 end
