Index: trunk/ippTests/ippCheck/cammask.pro
===================================================================
--- trunk/ippTests/ippCheck/cammask.pro	(revision 42114)
+++ trunk/ippTests/ippCheck/cammask.pro	(revision 42125)
@@ -78,4 +78,18 @@
  if ($table:Ny == 0)
   echo "ERROR: no reference sources found in $refsrcs"
+
+  # generate an empty output file
+  $OUT_FIELDS = 
+  foreach field $SMF_FIELDS_CAM $REF_FIELDS_CAM $XTR_FIELDS_CAM
+    $OUT_FIELDS = $OUT_FIELDS $field\_out
+    create -empty $field\_out
+  end
+  
+  sprintf output "%s/%s.%s.cam.stf" $OUTDIR $expname $OUTVERSION
+  write -fits DATA $output $OUT_FIELDS
+  
+  # save this name for warp and diff analysis, if desired
+  $CAMSOURCE = $output
+
   break
  end
@@ -271,6 +285,7 @@
    if ($COPYMASKS) exec neb-copy $camMask:$i $OUTDIR
    $j ++
- end
- $camMask:n = $chipName:n
+   if ($j >= $tmpName:n) last
+ end
+ $camMask:n = $tmpName:n
 end
 
