Index: /trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
===================================================================
--- /trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 35432)
+++ /trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 35433)
@@ -434,4 +434,5 @@
         if ($use_releasetool) {
             $command = "$releasetool -dbname $imagedb -priority_order -listrelexp $release_args";
+            $skycell_id = $component;
             $choose_components = 1;
         } else {
@@ -444,5 +445,5 @@
                 }
             } else {
-                $command = " -listrun";
+                $command .= " -listrun";
                 $choose_components = 1;
             }
@@ -568,5 +569,5 @@
         # match the coords in the rows to the components in the runs
         # returns an actual list of images
-        if ($skycenter) {
+        if ($skycenter and $req_type ne 'byskycell') {
             $images = selectComponents($ipprc, $imagedb, $req_type, $stage, $rowList, $images, $verbose);
         } else {
@@ -644,4 +645,6 @@
                 $out->{data_state} = $out->{state} = $out->{stack_state};
             } else {
+                # XXX: Consider looking up skycal results even if we are
+                # not using releasetool
                 $out->{data_state} = $out->{state};
             }
@@ -655,5 +658,12 @@
             if ($selectedAstrom) {
                 $out->{astrom} = $selectedAstrom;
-                $out->{cam_path_base} = basename($selectedAstrom);
+                $out->{cam_path_base} = $selectedAstrom;
+                if ($selectedAstrom =~ /\.smf$/) {
+                    $out->{cam_path_base} =~ s/\.smf$//;
+                } elsif ($selectedAstrom =~ /\.cmf$/) {
+                    $out->{cam_path_base} =~ s/\.cmf$//;
+                } else {
+                    die ("ERROR: don't know how to extract cam_path_base from $selectedAstrom\n");
+                }
             } elsif (! defined $out->{astrom}) {
                 if (! find_astrometry($ipprc, $imagedb, $out, $verbose)) {
@@ -1525,5 +1535,6 @@
     }
     
-    if (($req_type eq "byid") or ($req_type eq "byexp")) {
+    # XXX: Why did I make this restriction? I added byskycell
+    if (($req_type eq "byid") or ($req_type eq "byexp") or ($req_type eq 'byskycell')) {
         my ($last_tess_id, $tess_dir_abs, $astrom_file) = ("", "", "");
         foreach my $run (@$runList) {
