Index: trunk/ippToPsps/perl/checkOdmStatus.pl
===================================================================
--- trunk/ippToPsps/perl/checkOdmStatus.pl	(revision 29195)
+++ trunk/ippToPsps/perl/checkOdmStatus.pl	(revision 29196)
@@ -105,5 +105,12 @@
         if (!$onDatastore) {next;}
 
-        my $batch = ippToPsps::Batch->existing($batchId, $ippToPspsDb, $filePath, $verbose, $save_temps);
+        my $batch = ippToPsps::Batch->existing(
+                undef,
+                undef,
+                $batchId, 
+                $ippToPspsDb, 
+                $filePath, 
+                $verbose, 
+                $save_temps);
 
         if (!$processed) {
Index: trunk/ippToPsps/perl/getSmfForThisBatch.pl
===================================================================
--- trunk/ippToPsps/perl/getSmfForThisBatch.pl	(revision 29195)
+++ trunk/ippToPsps/perl/getSmfForThisBatch.pl	(revision 29196)
@@ -7,5 +7,5 @@
 use ippToPsps::Gpc1Db;
 use ippToPsps::IppToPspsDb;
-use PS::IPP::Config 1.01 qw( :standard );
+use ippToPsps::DetectionBatch;
 
 my $camera = undef;
@@ -32,5 +32,5 @@
     print "* REQUIRED: need to provide a batch   -b <batch>\n";
 }
-if (!defined $verbose) {
+if (!defined $camera) {
     $camera = "GPC1";
     print "* OPTIONAL: select a camera                 -c                   (default = $camera)\n";
@@ -51,32 +51,15 @@
 my $gpc1Db = new ippToPsps::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser", $verbose, $save_temps);
 my $ippToPspsDb = new ippToPsps::IppToPspsDb("ippToPsps", "ippdb01", "ipp", "ipp", $verbose, $save_temps);
-my $ipprc = PS::IPP::Config->new($camera) or (warn "Can't get camera configuration" and exit($PS_EXIT_CONFIG_ERROR));
+
+my $detectionBatch = ippToPsps::DetectionBatch->existing(
+        $camera,
+        $gpc1Db,
+        $singleBatch, 
+        $ippToPspsDb, 
+        "./",
+        $verbose, 
+        $save_temps);
 
 
-my $batches;
-my $numOfBatches;
+print $detectionBatch->getSmfFile() . "\n";
 
-if (defined $singleBatch ) { $numOfBatches = $ippToPspsDb->getBatch($singleBatch, \$batches);}
-if ($numOfBatches < 1) {return 0;}
-
-
-# loop round batches
-my $batch;
-my $numChecked = 0;
-foreach $batch ( @{$batches} ) {
-    my ($timestamp, $expId, $batchId, $surveyType, $deleted, $dvoDb, $processed, $onDatastore, $loadedToOdm, $mergeWorthy, $merged) =  @{$batch};
-
-    print "* found $timestamp, $expId, $batchId, $surveyType, $deleted $dvoDb\n";
-
-    my $nebPath = $gpc1Db->getCameraStageSmfForThisDvoDb($dvoDb, $expId);
-    if (!$nebPath) { print "* Could not determind neb path for SMF\n"; exit; }
-
-    # get real filename from neb 'key'
-    my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",$nebPath) or return 0;
-    my $realFile = $ipprc->file_resolve($fpaObjects) or return 0;
-
-    print "$realFile\n";
-
-}
-
-
