IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34212


Ignore:
Timestamp:
Jul 26, 2012, 2:59:12 PM (14 years ago)
Author:
bills
Message:

In bycoord or byskycell postage stamp requests if the user does not specifiy a data group
select from a list of data_groups specified in the recipe. This will make it more likely
that users will get stamps from data that we intended to "release".

Also insure that byskycell requests are filtered so that only 1 run per exposure is returned.

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r33382 r34212  
    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        $filter_runs = 1;
    344348    } else {
    345349        # this should be caught by caller
     
    357361
    358362    $command .= " -filter $filter" if !isnull($filter);
    359     $command .= " -data_group $data_group" if !isnull($data_group);
     363
     364    if (!isnull($data_group)) {
     365        $command .= " -data_group $data_group";
     366    } elsif ($req_type eq 'byskycell') {
     367        $command .= $default_data_groups;
     368    }
    360369
    361370    my $images = runToolAndParse($command, $verbose);
     
    727736           # always the case. If this turns out to be a problem we can defer
    728737           # the data_group test to when we look up the chipProcessedImfiles
    729            $command .= " -data_group $data_group" if $data_group;
     738           if ($data_group) {
     739               $command .= " -data_group $data_group";
     740           } else {
     741               $command .= $default_data_groups;
     742           }
    730743           $command .= " -destreaked" if $need_magic;
    731744
     
    14091422}
    14101423
     1424sub load_data_groups {
     1425    my $verbose = shift;
     1426    my $command = "$ppConfigDump -dump-recipe PSTAMP -";
     1427
     1428    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1429        run(command => $command, verbose => $verbose);
     1430    unless ($success) {
     1431        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     1432        die("Unable to perform ppConfigDump: $error_code");
     1433    }
     1434    my $mdcParser = PS::IPP::Metadata::Config->new;
     1435    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     1436        die ("Unable to parse metadata config doc");
     1437
     1438    my $data_group_string = "";
     1439    foreach my $item (@$metadata) {
     1440        my $tag = $item->{name};
     1441        next if $tag ne "DATA_GROUP";
     1442        my $dg = $item->{value};
     1443#        print "adding $dg to list of default data groups\n";
     1444        $data_group_string .= " -data_group $dg";
     1445    }
     1446    return $data_group_string;
     1447}
     1448
    14111449sub my_die
    14121450{
  • trunk/ippconfig/recipes/Makefile.am

    r31717 r34212  
    3232        ppVizPSF.mdc \
    3333        nightly_science.config \
    34         ppBackground.mdc
     34        ppBackground.mdc \
     35        pstamp.config
    3536
    3637install_DATA = $(install_files)
  • trunk/ippconfig/system.config

    r33789 r34212  
    6363        PPBACKGROUND    STR             recipes/ppBackground.mdc       # Background restoration
    6464        PSVIDEOPHOT     STR             recipes/psvideophot.config # video cell photometry
     65        PSTAMP          STR             recipes/pstamp.config       # postage stamp server
    6566END
Note: See TracChangeset for help on using the changeset viewer.