IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2012, 11:38:57 AM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120627/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r33382 r34242  
    4848my ($regtool, $chiptool, $camtool, $warptool, $stacktool, $difftool);
    4949my ($pstamptool, $dvoImagesAtCoords, $whichimage, $ppConfigDump);
     50
     51my $default_data_groups = "";
    5052
    5153sub locate_images {
     
    7678           ($req_type ne "byskycell");
    7779
     80    $default_data_groups = load_data_groups($verbose);
    7881
    7982    my $dateobs_begin;
     
    342345        die "tess_id and component are required for byskycell" if !$tess_id or ! $skycell_id;
    343346        $command .= " -tess_id $tess_id -skycell_id $skycell_id";
     347        if ($stage ne 'stack') {
     348            $filter_runs = 1;
     349        }
    344350    } else {
    345351        # this should be caught by caller
     
    357363
    358364    $command .= " -filter $filter" if !isnull($filter);
    359     $command .= " -data_group $data_group" if !isnull($data_group);
     365
     366    if (!isnull($data_group)) {
     367        $command .= " -data_group $data_group";
     368    } elsif ($req_type eq 'byskycell') {
     369        $command .= $default_data_groups;
     370    }
    360371
    361372    my $images = runToolAndParse($command, $verbose);
     
    727738           # always the case. If this turns out to be a problem we can defer
    728739           # the data_group test to when we look up the chipProcessedImfiles
    729            $command .= " -data_group $data_group" if $data_group;
     740           if ($data_group) {
     741               $command .= " -data_group $data_group";
     742           } else {
     743               $command .= $default_data_groups;
     744           }
    730745           $command .= " -destreaked" if $need_magic;
    731746
     
    14091424}
    14101425
     1426sub load_data_groups {
     1427    my $verbose = shift;
     1428    my $command = "$ppConfigDump -dump-recipe PSTAMP -";
     1429
     1430    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1431        run(command => $command, verbose => $verbose);
     1432    unless ($success) {
     1433        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     1434        die("Unable to perform ppConfigDump: $error_code");
     1435    }
     1436    my $mdcParser = PS::IPP::Metadata::Config->new;
     1437    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1438        die ("Unable to parse metadata config doc");
     1439
     1440    my $data_group_string = "";
     1441    foreach my $item (@$metadata) {
     1442        my $tag = $item->{name};
     1443        next if $tag ne "DATA_GROUP";
     1444        my $dg = $item->{value};
     1445#        print "adding $dg to list of default data groups\n";
     1446        $data_group_string .= " -data_group $dg";
     1447    }
     1448    return $data_group_string;
     1449}
     1450
    14111451sub my_die
    14121452{
Note: See TracChangeset for help on using the changeset viewer.