Index: /trunk/ippTests/ippCheck/cammask.pro
===================================================================
--- /trunk/ippTests/ippCheck/cammask.pro	(revision 42124)
+++ /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
 
Index: /trunk/ippTests/ippCheck/camstats.pro
===================================================================
--- /trunk/ippTests/ippCheck/camstats.pro	(revision 42124)
+++ /trunk/ippTests/ippCheck/camstats.pro	(revision 42125)
@@ -38,5 +38,5 @@
    # results in magFound, fracFound, numFound
    calc.camstats
-   if ($i == 0)
+   if (numTotal_sum?[] == 0)
      set numTotal_sum = numTotal
      set numFound_sum = numFound
@@ -57,9 +57,13 @@
  end
    
- set numTotal = numTotal_sum
- set numFound = numFound_sum
- set numPoss  = numPoss_sum
- set numGood  = numGood_sum
- delete numTotal_sum numFound_sum numPoss_sum numGood_sum
+ if (numTotal_sum?[] == 0)
+   calc.camstats 
+ else 
+   set numTotal = numTotal_sum
+   set numFound = numFound_sum
+   set numPoss  = numPoss_sum
+   set numGood  = numGood_sum
+   delete numTotal_sum numFound_sum numPoss_sum numGood_sum
+ end
 
  set fracFound = (numTotal > 0) ? numFound / numTotal : zero(numTotal)
@@ -79,11 +83,16 @@
   $BST2 = -tickpad 0.2 -xpad 3.5 -labelpadx 3.0 -ypad 0.5 -labelpady 0.0 +ypad 4.5 +labelpady 4.0 -labels 1001
   
-  section aM 0.00 0.66 0.65 0.33
-  section aR 0.00 0.33 0.65 0.33
-  section aD 0.00 0.00 0.65 0.33
-
-  section bM 0.65 0.66 0.35 0.33
-  section bR 0.65 0.33 0.35 0.33
-  section bD 0.65 0.00 0.35 0.33
+  section aM 0.00 0.66 0.65 0.33;  label -x mag -y "&sd&h mag"
+  section aR 0.00 0.33 0.65 0.33;  label -x mag -y "&sd&h R.A."
+  section aD 0.00 0.00 0.65 0.33;  label -x mag -y "&sd&h Dec" 
+
+  section bM 0.65 0.66 0.35 0.33;  label -x mag -y "&sd&h mag" 
+  section bR 0.65 0.33 0.35 0.33;  label -x mag -y "&sd&h R.A."
+  section bD 0.65 0.00 0.35 0.33;  label -x mag -y "&sd&h Dec" 
+
+  if (RA_PSF?[] == 0)
+    echo "no sources in datafile"
+    return
+  end
 
   set dR = 3600*(RA_PSF - Rref)*dcos(Dref)
@@ -256,4 +265,13 @@
  $Mdel = 0.25
  
+ if (Mref_out?[] == 0)
+   create magBin $Mmin $Mmax $Mdel
+   set numTotal = zero(magBin)
+   set numFound = zero(magBin)
+   set numPoss  = zero(magBin)
+   set numGood  = zero(magBin)
+   return
+ end
+
  delete -q  magBin numTotal numPoss numFound numGood
  for mag $Mmin $Mmax $Mdel
Index: /trunk/ippTests/ippCheck/diffmask.pro
===================================================================
--- /trunk/ippTests/ippCheck/diffmask.pro	(revision 42124)
+++ /trunk/ippTests/ippCheck/diffmask.pro	(revision 42125)
@@ -51,5 +51,22 @@
   # load the reference source table
   # how to choose the name of the filter?
-  data $refsrcs; 
+  data $refsrcs
+
+  # first check if the FITS table has any entries
+  read -fits DATA -sizes
+  if ($table:Ny == 0) 
+    echo "WARNING: empty reference table $refsrcs"
+
+    $OUT_FIELDS = 
+    foreach field $SMF_FIELDS_DIF $REF_FIELDS_DIF $XTR_FIELDS_DIF
+      $OUT_FIELDS = $OUT_FIELDS $field\_out
+      create -empty $field\_out
+    end
+    
+    sprintf output "%s/%s.%s.dif.stf" $OUTDIR $expname $OUTVERSION
+    write -fits DATA $output $OUT_FIELDS
+    return
+  end
+
   if ($USE_CAMSOURCE) 
    read -fits DATA Rref_out Dref_out Mref_out
Index: /trunk/ippTests/ippCheck/ippCheck
===================================================================
--- /trunk/ippTests/ippCheck/ippCheck	(revision 42124)
+++ /trunk/ippTests/ippCheck/ippCheck	(revision 42125)
@@ -59,5 +59,5 @@
   getargs -no-warp  BOOL  -var SKIP_WARP
   getargs -no-diff  BOOL  -var SKIP_DIFF
-  getargs -do-plots BOOL  -var DO_PLOTS;   
+  getargs -no-plots BOOL  -var SKIP_PLOTS;   
   getargs -use-refs BOOL  -var USE_REFSOURCE
   getargs -camera   VALUE -var CAMERA;
@@ -97,5 +97,5 @@
   end
 
-  if ($DO_PLOTS) plot.exposure.real $expname
+  if (not($SKIP_PLOTS)) plot.exposure.real $expname
 end
 
Index: /trunk/ippTests/ippCheck/warpmask.pro
===================================================================
--- /trunk/ippTests/ippCheck/warpmask.pro	(revision 42124)
+++ /trunk/ippTests/ippCheck/warpmask.pro	(revision 42125)
@@ -44,4 +44,23 @@
   # NOTE: Mref is chosen to match filter for this exposure
   data $refsrcs                 ;
+
+  # first check if the FITS table has any entries
+  read -fits DATA -sizes
+  if ($table:Ny == 0) 
+    echo "WARNING: empty reference table $refsrcs"
+
+    # generate empty output vectors for output file
+    $OUT_FIELDS = 
+    foreach field $REF_FIELDS_WRP $XTR_FIELDS_WRP
+      $OUT_FIELDS = $OUT_FIELDS $field\_out
+      create -empty $field\_out
+    end
+    
+    sprintf output "%s/%s.%s.wrp.stf" $OUTDIR $expname $OUTVERSION
+    write -fits DATA $output $OUT_FIELDS
+
+    return
+  end
+
   if ($USE_CAMSOURCE) 
    read -fits DATA Rref_out Dref_out Mref_out
Index: /trunk/ippTests/ippCheck/warpstats.pro
===================================================================
--- /trunk/ippTests/ippCheck/warpstats.pro	(revision 42124)
+++ /trunk/ippTests/ippCheck/warpstats.pro	(revision 42125)
@@ -24,5 +24,5 @@
    # results in magFound, fracFound, numFound
    calc.warpstats
-   if ($i == 0)
+   if (numTotal_sum?[] == 0)
      set numTotal_sum = numTotal
      set numPoss_sum  = numPoss
@@ -39,7 +39,12 @@
  end
    
- set numTotal = numTotal_sum
- set numPoss  = numPoss_sum
- delete numTotal_sum numPoss_sum
+ if (numTotal_sum?[] == 0)
+    # generate vectors for empty inputs
+   calc.warpstats
+ else   
+   set numTotal = numTotal_sum
+   set numPoss  = numPoss_sum
+   delete numTotal_sum numPoss_sum
+ end
 
  set fracPoss  = (numTotal > 0) ? numPoss  / numTotal : zero(numTotal)
@@ -89,4 +94,11 @@
  $Mdel = 0.25
  
+ if (Mref_out?[] == 0)
+   create magBin $Mmin $Mmax $Mdel
+   set numTotal = zero(magBin)
+   set numPoss  = zero(magBin)
+   return
+ end
+
  delete -q  magBin numTotal numPoss
  for mag $Mmin $Mmax $Mdel
