Index: trunk/ippToPsps/scripts/ippToPsps_run.pl
===================================================================
--- trunk/ippToPsps/scripts/ippToPsps_run.pl	(revision 28260)
+++ trunk/ippToPsps/scripts/ippToPsps_run.pl	(revision 28529)
@@ -10,4 +10,5 @@
 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock';
 use File::Temp qw(tempfile);
+use XML::LibXML;
 
 # globals
@@ -73,5 +74,5 @@
 
 # make a temporary file for saving results
-my ($resultsFile, $resultsFileName) = tempfile( "/tmp/ippToPsps_results.XXXX", UNLINK => !$save_temps);
+my ($resultsFile, $resultsFilePath) = tempfile( "/tmp/ippToPsps_results.XXXX", UNLINK => !$save_temps);
 
 process();
@@ -118,5 +119,4 @@
 }
 
-
 #######################################################################################
 # 
@@ -160,4 +160,5 @@
             AND chipRun.exp_id = rawExp.exp_id 
             AND camRun.dist_group = '$survey'   
+            AND rawExp.dateobs >= '2010-02-20'
             GROUP BY  rawExp.exp_id 
             ORDER BY rawExp.exp_id ASC;
@@ -457,22 +458,9 @@
 
     # read results
-    open (MYFILE, $resultsFileName);
-    my $i = 0;
-
-    # detection results
-    my $minObjId;
-    my $maxObjId;
-    my $filename;
-    if($batchType eq 'det') {
-
-        while (<MYFILE>) {
-            chomp;
-            if ($i == 0) { $filename = $_; }
-            if ($i == 1) { $minObjId = $_; }
-            if ($i == 2) { $maxObjId = $_; }
-            $i++;
-        }
-    }
-    close (MYFILE);
+    my $parser = XML::LibXML->new;
+    my $doc = $parser->parse_file($resultsFilePath);
+    my $filename = $doc->findvalue('//filename');
+    my $minObjId = $doc->findvalue('//minObjID');
+    my $maxObjId = $doc->findvalue('//maxObjID');
 
     # create XML file
@@ -794,5 +782,5 @@
     $command .= " -survey $surveyType";
     $command .= " -batch $batchType";
-    $command .= " -results $resultsFileName";
+    $command .= " -results $resultsFilePath";
 
     # run command
