Index: trunk/pstamp/scripts/pstampparse.pl
===================================================================
--- trunk/pstamp/scripts/pstampparse.pl	(revision 25194)
+++ trunk/pstamp/scripts/pstampparse.pl	(revision 25285)
@@ -220,5 +220,6 @@
 
     # Temporary hack so that MOPS can get at non-magicked data
-    if ($product eq "mops-pstamp-results") {
+    if (($product eq "mops-pstamp-results") or ($product eq "pstampresults") 
+        or ($product eq "bills-results")) {
         $need_magic = 0;
     }
@@ -470,21 +471,36 @@
         my $thisRun;
 
-        my ($pointsList, $pointsListName) = tempfile ("/tmp/pointsList.XXXX", UNLINK => !$save_temps);
         my $npoints = 0;
-        foreach my $row (@$rowList) {
-            $row->{components} = {};
-            if ($row->{skycenter}) {
-                print $pointsList "$row->{ROWNUM} $row->{CENTER_X} $row->{CENTER_Y}\n";
-                $npoints++;
-            } else {
-                # this row's center is in pixel coordinates add all images to the component list for this row
-                foreach my $i (@$imageList) {
-                    my $component = $have_skycells ? $i->{skycell_id} : $i->{class_id};
-                    my_die( "image found with no value for component", $PS_EXIT_UNKNOWN_ERROR) if !$component;
-                    $row->{components}->{$component} = 1;
+        my ($pointsList, $pointsListName);
+        if (scalar @$imageList > 1) {
+            ($pointsList, $pointsListName) = tempfile ("/tmp/pointsList.XXXX", UNLINK => !$save_temps);
+            foreach my $row (@$rowList) {
+                $row->{components} = {};
+                if ($row->{skycenter}) {
+                    print $pointsList "$row->{ROWNUM} $row->{CENTER_X} $row->{CENTER_Y}\n";
+                    $npoints++;
+                } else {
+                    # this row's center is in pixel coordinates add all images to the component list for this row
+                    foreach my $i (@$imageList) {
+                        my $component = $have_skycells ? $i->{skycell_id} : $i->{class_id};
+                        my_die( "image found with no value for component", $PS_EXIT_UNKNOWN_ERROR)
+                                if !$component;
+                        $row->{components}->{$component} = 1;
+                    }
                 }
             }
-        }
-        close $pointsList;
+            close $pointsList;
+        } else {
+            # only one image. Avoid the expense of dvoImagesAtCoords. 
+            # queue the job and let ppstamp figure out if the center is valid for the image
+            # the resulting result code will be the same.
+            foreach my $row (@$rowList) {
+                $row->{components} = {};
+                my $i = $imageList->[0];
+                my $component = $have_skycells ? $i->{skycell_id} : $i->{class_id};
+                my_die( "image found with no value for component", $PS_EXIT_UNKNOWN_ERROR) if !$component;
+                $row->{components}->{$component} = 1;
+            }
+        }
 
         my $tess_dir_abs;
@@ -492,6 +508,7 @@
         while ($thisRun = getOneRun($stage, $imageList)) {
             if ($npoints) {
-                # we collected a set of sky coordintates above filter the images so that only
-                # those that contain the centers are processed
+                my_die( "pointsListName is not defined", $PS_EXIT_PROG_ERROR) if !$pointsListName;
+                # we collected a set of sky coordinates above.
+                # filter the images so that only those that contain the centers of the ROIs are processed
                 my $command = "$dvoImagesAtCoords $pointsListName";
                 if ($have_skycells) {
@@ -636,5 +653,6 @@
         # if first row has no component all of the images will be retrieved, so
         # the fact that this row has a component is ok. Fall through to return 1
-        # XXX Nope that doesn't work (yet)
+        # XXX Nope this doesn't work. It is consistent with the other logic in some way
+        # that i haven't fully thought through
         return 0;
     }
