Index: /branches/eam_branches/ipp-20211108/ippTests/ippCheck/Makefile.am
===================================================================
--- /branches/eam_branches/ipp-20211108/ippTests/ippCheck/Makefile.am	(revision 42023)
+++ /branches/eam_branches/ipp-20211108/ippTests/ippCheck/Makefile.am	(revision 42024)
@@ -4,10 +4,12 @@
 
 module_files = \
+  tap.pro   \
+  truth.pro     \
   cammask.pro   \
   camstats.pro  \
   diffmask.pro  \
-  truth.pro     \
   warpmask.pro  \
-  warpstats.pro
+  warpstats.pro \
+  smfcheck.pro
 
 ippchecksdir = $(datadir)/dvo/modules
Index: /branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck
===================================================================
--- /branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck	(revision 42023)
+++ /branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck	(revision 42024)
@@ -2,14 +2,15 @@
 
 # XXX need alternate source for camID (if !cam) and warpID (if !warp)
-# XXX create a config file to hold values like PV3_CATDIR
-
-$PV3_CATDIR = /data/ipp105.0/eugene/3pi.dvo.masters/3pi.pv3.20170919
+
+# .ippcheckrc defines smf.compare books, dvo databases, and other references
+input $HOME/.ippcheckrc
 
 module truth.pro
 module cammask.pro
+module camstats.pro
 module warpmask.pro
+module warpstats.pro
 module diffmask.pro
-module camstats.pro
-module warpstats.pro
+module smfcheck.pro
 
 #####
@@ -227,4 +228,5 @@
   echo "   EG: ippCheck mpc  (expname) (label) [mpcfile]"
   echo "   EG: ippCheck dvo  (expname) (label)"
+  echo "   EG: ippCheck smf  (outroot) (smf1) (smf2) [+plot]"
   echo "   EG: ippCheck plot (expname)"
   echo "   EG: ippCheck plot.glob (expglob) (outroot)"
@@ -256,5 +258,5 @@
 
   if ("$argv:0" == "smf")
-    check.exposure.smf $arglist
+    smf.compare.all.extensions $arglist
     exit 0
   end
Index: /branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro
===================================================================
--- /branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro	(revision 42023)
+++ /branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro	(revision 42024)
@@ -1,56 +1,14 @@
 #!/usr/bin/env dvo
-
 # compare smf-to-smf
+
 if (not($?SAVEPLOT)) set SAVEPLOT = 0
-if (not($?PLOTROOT))
-  $PLOTROOT = smfcompare
-end  
-
-input tap.sh
-
-# for a single chip, I want outputs with names like:
-# expname.chipID.smfcmp.field.png
-# expname.chipID.smfcmp.txt
-
-### example of plotting all outputs for a single chip:
-macro go.sample
-  $SAVEPLOT = 1
-  $KAPA = kapa -noX
-  smf.compare.parse.book fields.bk psfFields
-  smf.compare.onechip o9451g0319o/o9451g0319o.XY01 o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf 2
-end
-
-### example of plotting all outputs for a single chip:
-macro go.warp
-  $SAVEPLOT = 1
-  $KAPA = kapa
-  smf.compare.parse.book fields.bk psfFields
-  smf.compare.onechip w1.phot.rnd w1.phot.v0.fpa.cmf w1.phot.v1.fpa.cmf 0
-end
-
-### example of plotting all outputs for a single chip:
-macro go.test
-  $SAVEPLOT = 1
-  $KAPA = kapa -noX
-#  smf.compare.parse.book test.bk psfFields
-#  smf.compare.onechip test o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf 2
-  smf.compare.onechip o9451g0319o/o9451g0319o.XY01 o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf 2
-end
-
-### example of plotting all outputs for a single chip:
-macro full.test
-  if ($0 != 2)
-    echo "USAGE: full.test (version)"
-    break
-  end
-    
-  $SAVEPLOT = 0
-  $KAPA = kapa -noX
-  check.extensions o9451g0319o.$1/o9451g0319o.$1 o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf
-end
-
-macro check.extensions
+
+module tap.pro
+
+macro smf.compare.all.extensions
+  getargs +plot   BOOL  -var SAVEPLOT
+
   if ($0 != 4)
-    echo "USAGE: check.extensions (output) (smf1) (smf2)"
+    echo "USAGE: smf.compare.all.extensions (output) (smf1) (smf2) [-plot]"
     break
   end
@@ -64,12 +22,15 @@
   mkdir $mydir
 
-  plan 3125
+  # XXX this number depends on the schema of the smfs and the camera (gpc1 vs gpc2)
+  # XXX can we calculate the number of tests based on the number of smf extensions?
+  # plan 3125
+  plan 3065
 
   # load psfField definitions
-  smf.compare.parse.book fields.bk psfFields
-  smf.compare.parse.book hdrKeys.bk hdrKeys
-  smf.compare.parse.book psfKeys.bk psfKeys
-
-  # 
+  smf.compare.parse.book $PSF_FIELDS  psfFields
+  smf.compare.parse.book $PSF_KEYS    psfKeys
+  smf.compare.parse.book $HDR_KEYS    hdrKeys
+
+  # does the smf have the right number of extensions?
   list ext0 -x "ftable -list $smf1"
   list ext1 -x "ftable -list $smf2"
@@ -140,6 +101,6 @@
   # load in the full set of data for this extension
   # NOTE : t0 and t1 are used to label the sets of vectors
-  load.smf.fields $smf1 $extnum t1
-  load.smf.fields $smf2 $extnum t2
+  smf.load.fields $smf1 $extnum t1
+  smf.load.fields $smf2 $extnum t2
 
   # generate the matched lists (index1, index2)
@@ -151,7 +112,7 @@
 
 # load in the data for a pair of smf fields for a single chip 
-macro load.smf.fields
+macro smf.load.fields
   if ($0 != 4)
-    echo "USAGE: load.smf.fields (smffile) (extension) (version)"
+    echo "USAGE: smf.load.fields (smffile) (extension) (version)"
     echo "  loads all fields and saves them with version appended to the names"
     break
@@ -251,4 +212,6 @@
 
 macro smf.fields.magplot.init
+  if (not($SAVEPLOT)) return
+
   clear -s
   antialias 0.4
@@ -568,11 +531,53 @@
 end
 
-if ($SCRIPT)
-  if ($argv:n != 1)
-    echo "USAGE: smfcheck.pro (version)"
-    break
-  end
-  
-  full.test $argv:0
-  exit 0
-end
+########## EXAMPLES:
+
+### example of plotting all outputs for a single chip:
+macro go.sample
+  $SAVEPLOT = 1
+  $KAPA = kapa -noX
+  smf.compare.parse.book fields.bk psfFields
+  smf.compare.onechip o9451g0319o/o9451g0319o.XY01 o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf 2
+end
+
+### example of plotting all outputs for a single chip:
+macro go.warp
+  $SAVEPLOT = 1
+  $KAPA = kapa
+  smf.compare.parse.book fields.bk psfFields
+  smf.compare.onechip w1.phot.rnd w1.phot.v0.fpa.cmf w1.phot.v1.fpa.cmf 0
+end
+
+### example of plotting all outputs for a single chip:
+macro go.test
+  $SAVEPLOT = 1
+  $KAPA = kapa -noX
+#  smf.compare.parse.book test.bk psfFields
+#  smf.compare.onechip test o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf 2
+  smf.compare.onechip o9451g0319o/o9451g0319o.XY01 o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf 2
+end
+
+### example of plotting all outputs for a single chip:
+macro full.test
+  if ($0 != 2)
+    echo "USAGE: full.test (version)"
+    break
+  end
+    
+  $SAVEPLOT = 0
+  $KAPA = kapa -noX
+  check.extensions o9451g0319o.$1/o9451g0319o.$1 o9451g0319o.1833521.cm.2467375.smf o9451g0319o.1833521.cm.2467377.smf
+end
+#########
+
+## if ($SCRIPT)
+##   if ($argv:n != 3)
+##     echo "USAGE: smfcheck.pro (output) (smf1) (smf1) [+plot]"
+##     break
+##   end
+##   
+##   list argv -join arglist
+## 
+##   smf.compare.all.extensions $arglist
+##   exit 0
+## end
Index: /branches/eam_branches/ipp-20211108/ippTests/ippCheck/tap.pro
===================================================================
--- /branches/eam_branches/ipp-20211108/ippTests/ippCheck/tap.pro	(revision 42024)
+++ /branches/eam_branches/ipp-20211108/ippTests/ippCheck/tap.pro	(revision 42024)
@@ -0,0 +1,64 @@
+
+# TAP_VERBOSE levels: 0 : only errors, 1 : major diagnostics, 2 : details
+if (not($?TAP_VERBOSE)) set TAP_VERBOSE = 1
+
+macro plan
+ if ($0 != 2)
+  echo "USAGE: plan (Ntest)"
+  break
+ end
+
+ $tap_Nplan = $1
+ $tap_Npass = 0
+ $tap_Nfail = 0
+ $tap_Ntest = 0
+end
+
+macro done
+ if (not($?tap_Nplan))
+  echo "ERROR: tap tests not planned"
+  break
+ end
+
+ echo "planned $tap_Nplan tests, ran $tap_Ntest"
+ echo "passed $tap_Npass tests, failed $tap_Nfail tests"
+
+ if (($tap_Nfail == 0) && ($tap_Ntest == $tap_Nplan) && ($tap_Npass == $tap_Ntest))
+   echo "PASS: all tests run and passed"
+   return 1
+ end
+
+ if ($tap_Nfail > 0)
+   echo "FAIL: $tap_Nfail tests failed"
+ end
+
+ if ($tap_Ntest != $tap_Nplan)
+   echo "FAIL: not all tests run"
+ end
+
+ if ($tap_Ntest != $tap_Npass + $tap_Nfail)
+   echo "FAIL: inconsistent count: $tap_Ntest tests != $tap_Npass pass + $tap_Nfail fail"
+ end
+end
+
+macro ok
+ if ($0 != 3)
+  echo "USAGE (condition) (label)"
+  break
+ end
+ 
+ if (not($?tap_Nplan))
+  echo "ERROR: tap tests not planned"
+  break
+ end
+ 
+ if ($1)
+  if ($TAP_VERBOSE > 0) echo "ok: $2"
+  $tap_Npass ++
+ else     
+  echo "not ok: $2"
+  $tap_Nfail ++
+ end
+ $tap_Ntest ++
+end
+
Index: anches/eam_branches/ipp-20211108/ippTests/ippCheck/tap.sh
===================================================================
--- /branches/eam_branches/ipp-20211108/ippTests/ippCheck/tap.sh	(revision 42023)
+++ 	(revision )
@@ -1,64 +1,0 @@
-
-# TAP_VERBOSE levels: 0 : only errors, 1 : major diagnostics, 2 : details
-if (not($?TAP_VERBOSE)) set TAP_VERBOSE = 1
-
-macro plan
- if ($0 != 2)
-  echo "USAGE: plan (Ntest)"
-  break
- end
-
- $tap_Nplan = $1
- $tap_Npass = 0
- $tap_Nfail = 0
- $tap_Ntest = 0
-end
-
-macro done
- if (not($?tap_Nplan))
-  echo "ERROR: tap tests not planned"
-  break
- end
-
- echo "planned $tap_Nplan tests, ran $tap_Ntest"
- echo "passed $tap_Npass tests, failed $tap_Nfail tests"
-
- if (($tap_Nfail == 0) && ($tap_Ntest == $tap_Nplan) && ($tap_Npass == $tap_Ntest))
-   echo "PASS: all tests run and passed"
-   return 1
- end
-
- if ($tap_Nfail > 0)
-   echo "FAIL: $tap_Nfail tests failed"
- end
-
- if ($tap_Ntest != $tap_Nplan)
-   echo "FAIL: not all tests run"
- end
-
- if ($tap_Ntest != $tap_Npass + $tap_Nfail)
-   echo "FAIL: inconsistent count: $tap_Ntest tests != $tap_Npass pass + $tap_Nfail fail"
- end
-end
-
-macro ok
- if ($0 != 3)
-  echo "USAGE (condition) (label)"
-  break
- end
- 
- if (not($?tap_Nplan))
-  echo "ERROR: tap tests not planned"
-  break
- end
- 
- if ($1)
-  if ($TAP_VERBOSE > 0) echo "ok: $2"
-  $tap_Npass ++
- else     
-  echo "not ok: $2"
-  $tap_Nfail ++
- end
- $tap_Ntest ++
-end
-
