Index: branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck
===================================================================
--- branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck	(revision 42029)
+++ branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck	(revision 42030)
@@ -229,4 +229,5 @@
   echo "   EG: ippCheck dvo  (expname) (label)"
   echo "   EG: ippCheck smf  (outroot) (smf1) (smf2) [+plot]"
+  echo "   EG: ippCheck smf.dgrp (outroot) (smf1) (smf2) [+plot]"
   echo "   EG: ippCheck plot (expname)"
   echo "   EG: ippCheck plot.glob (expglob) (outroot)"
@@ -262,4 +263,9 @@
   end
 
+  if ("$argv:0" == "smf.dgrp")
+    smf.compare.by.datagroups $arglist
+    exit 0
+  end
+
   if ("$argv:0" == "plot")
     plot.exposure.user $arglist
Index: branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro
===================================================================
--- branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro	(revision 42029)
+++ branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro	(revision 42030)
@@ -5,4 +5,32 @@
 
 module tap.pro
+
+macro smf.compare.by.datagroups
+  $CAMERA = gpc1  
+
+  getargs +plot     BOOL  -var SAVEPLOT
+  getargs -camera   VALUE -var CAMERA
+
+  if ($0 != 5)
+    echo "USAGE: smf.compare.by.datagroups (output) (expname) (DG1) (DG2) [+plot] [-camera gpc2]"
+    break
+  end
+
+  local output expname dgrp1 dgrp2 
+  $output  = $1
+  $expname = $2
+  $dgrp1   = $3
+  $dgrp2   = $4
+
+  get.camera.metadata.by.datagroup $CAMERA $expname $dgrp1
+  $smffile = $camPath.smf     
+  $smf1    = `neb-locate -p $smffile`
+
+  get.camera.metadata.by.datagroup $CAMERA $expname $dgrp2
+  $smffile = $camPath.smf     
+  $smf2    = `neb-locate -p $smffile`
+
+  smf.compare.all.extensions $output $smf1 $smf2
+end
 
 macro smf.compare.all.extensions
@@ -37,4 +65,10 @@
 
   ok ($ext0:n == $ext1:n) "same number of extensions"
+  if ($ext0:n != $ext1:n) 
+    echo "impossible to continue with mismatched extensions"
+    echo "smf1 : $smf1"
+    echo "smf2 : $smf2"
+    exit 3
+  end
 
   # track the number of chips for which the XYnn.hdr keys failed
@@ -529,4 +563,48 @@
   histogram $1 $2 $hist:minVal $hist:maxVal $hist:delVal -range $3
   $2[0] = 0; $2[-1] = 0
+end
+
+macro get.camera.metadata.by.datagroup
+ if ($0 != 4)
+  echo "USAGE: get.camera.metadata.by.datagroup (camera) (expname) (data_group)"
+  echo "EX:    get.camera.metadata.by.datagroup gpc1 o9322g0253o MOPS.dailytestset.20190516ops40745"
+  echo "  sets camPath, chipID"
+  break
+ end
+
+ local dbname expname camlabel
+ $dbname   = $1
+ $expname  = $2
+ $camdgrp  = $3
+
+# need to generically handle the question of which version / label
+# this will be a problem for old exposures without a useful label (cleanup)
+# instead of label, we could specify the cam_id (which we might know)
+
+ $command = camtool -dbname $dbname -processedexp -exp_name $expname -data_group $camdgrp
+ 
+ queueload  myqueue -x "$command"
+ queue2book myqueue mybook
+ 
+ $camPath = NONE
+ book npages mybook -var npages
+ 
+ if ($npages < 1) 
+  echo "ERROR: missing exposure : $command"
+  book delete mybook
+  next
+ end
+ 
+ if ($npages > 1) 
+  echo "ERROR: too many exposures : $command"
+  book delete mybook
+  next
+ end
+ 
+ sprint pagename page.%03d 0
+ book getword mybook $pagename path_base -var camPath
+ book getword mybook $pagename chip_id   -var chipID
+ book getword mybook $pagename cam_id    -var camID
+ book delete mybook
 end
 
