Index: trunk/ippToPsps/scripts/ippToPsps_run.pl
===================================================================
--- trunk/ippToPsps/scripts/ippToPsps_run.pl	(revision 27688)
+++ trunk/ippToPsps/scripts/ippToPsps_run.pl	(revision 27699)
@@ -12,5 +12,5 @@
 
 # globals
-my ($verbose, $save_temps, $no_op, $no_update, $camera, $product, $output, $dvodb, $label, $no_publish);
+my ($verbose, $save_temps, $no_op, $no_update, $camera, $product, $output, $dvodb, $label, $singleExpId, $no_publish);
 
 # TODO temporary until we use database to store current jobid
@@ -25,13 +25,15 @@
 $camera = 'GPC1';
 $output = undef;
+$singleExpId = undef;
 
 # get user args
 GetOptions(
-        'output=s' => \$output,
-        'product=s' => \$product,
-        'dvodb=s' => \$dvodb,
-        'label=s' => \$label,
+        'output|o=s' => \$output,
+        'product|p=s' => \$product,
+        'dvodb|d=s' => \$dvodb,
+        'label|l=s' => \$label,
+        'expid|e=s' => \$singleExpId,
         'no_publish' => \$no_publish,
-        'verbose' => \$verbose,
+        'verbose|v' => \$verbose,
         'save_temps' => \$save_temps,
         'no-op' => \$no_op,
@@ -46,5 +48,5 @@
         "--product <init|det|diff|stack>\n".
         "--output <path>\n".
-        "--label <label>\n" .
+        "--label <label> | --expid <expid>\n" .
         "--dvodb <path>\n\n",
         -exitval => 3
@@ -53,5 +55,5 @@
 defined $output and
 defined $dvodb and
-defined $label;
+( defined $label or defined $singleExpId );
 
 # check we can run programs and get camera config
@@ -85,14 +87,22 @@
             ) or die "Unable to connect to database $DBI::errstr\n";
 
-    # query to retrieve all exposures with the provided label
-    my $query =
-        "SELECT DISTINCT rawExp.exp_id ".
-        "FROM camRun, chipRun, rawExp ".
-        "WHERE camRun.chip_id = chipRun.chip_id ".
-        "AND chipRun.exp_id = rawExp.exp_id ".
-        "AND camRun.label like '%$label%' ".
-    #    "AND rawExp.decl >= '-0.157079633' AND rawExp.decl <= '0.157079633' ". # TODO Jim's decl range
-        "ORDER BY rawExp.exp_id ASC";
-
+    my $query;
+    if (!$singleExpId) {
+
+        # query to retrieve all exposures with the provided label
+        $query =
+            "SELECT DISTINCT rawExp.exp_id ".
+            "FROM camRun, chipRun, rawExp ".
+            "WHERE camRun.chip_id = chipRun.chip_id ".
+            "AND chipRun.exp_id = rawExp.exp_id ".
+            "AND camRun.label like '%$label%' ".
+            #    "AND rawExp.decl >= '-0.157079633' AND rawExp.decl <= '0.157079633' ". # TODO Jim's decl range
+            "ORDER BY rawExp.exp_id ASC";
+    }
+    else {
+
+        $query = "SELECT DISTINCT exp_id FROM rawExp WHERE rawExp.exp_id = $singleExpId"
+
+    }
 
     if ($verbose) { print"$query\n";}
