Index: trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
===================================================================
--- trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 34090)
+++ trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 34212)
@@ -48,4 +48,6 @@
 my ($regtool, $chiptool, $camtool, $warptool, $stacktool, $difftool);
 my ($pstamptool, $dvoImagesAtCoords, $whichimage, $ppConfigDump);
+
+my $default_data_groups = "";
 
 sub locate_images {
@@ -76,4 +78,5 @@
            ($req_type ne "byskycell");
 
+    $default_data_groups = load_data_groups($verbose);
 
     my $dateobs_begin;
@@ -342,4 +345,5 @@
         die "tess_id and component are required for byskycell" if !$tess_id or ! $skycell_id;
         $command .= " -tess_id $tess_id -skycell_id $skycell_id";
+        $filter_runs = 1;
     } else {
         # this should be caught by caller
@@ -357,5 +361,10 @@
 
     $command .= " -filter $filter" if !isnull($filter);
-    $command .= " -data_group $data_group" if !isnull($data_group);
+
+    if (!isnull($data_group)) {
+        $command .= " -data_group $data_group";
+    } elsif ($req_type eq 'byskycell') {
+        $command .= $default_data_groups;
+    }
 
     my $images = runToolAndParse($command, $verbose);
@@ -727,5 +736,9 @@
            # always the case. If this turns out to be a problem we can defer
            # the data_group test to when we look up the chipProcessedImfiles
-           $command .= " -data_group $data_group" if $data_group;
+           if ($data_group) {
+               $command .= " -data_group $data_group";
+           } else {
+               $command .= $default_data_groups;
+           }
            $command .= " -destreaked" if $need_magic;
 
@@ -1409,4 +1422,29 @@
 }
 
+sub load_data_groups {
+    my $verbose = shift;
+    my $command = "$ppConfigDump -dump-recipe PSTAMP -";
+
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        die("Unable to perform ppConfigDump: $error_code");
+    }
+    my $mdcParser = PS::IPP::Metadata::Config->new;
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        die ("Unable to parse metadata config doc");
+
+    my $data_group_string = "";
+    foreach my $item (@$metadata) {
+        my $tag = $item->{name};
+        next if $tag ne "DATA_GROUP";
+        my $dg = $item->{value};
+#        print "adding $dg to list of default data groups\n";
+        $data_group_string .= " -data_group $dg";
+    }
+    return $data_group_string;
+}
+
 sub my_die
 {
