IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36018 for trunk/PS-IPP-PStamp


Ignore:
Timestamp:
Aug 23, 2013, 1:31:54 PM (13 years ago)
Author:
bills
Message:

Further progress on stack_summary postage stamp jobs.
Implementation ignores the ROI. The entire images are returned.
If a requested data product is not found (mask, variance, exp, or num images
from older processings) this is ignored

Location:
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp
Files:
2 edited

Legend:

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

    r36010 r36018  
    774774        }
    775775
     776
    776777        if ($skycells) {
     778            # We have a list of skycells. Find matching projection cells.
     779
     780            #list of projection_cells that we've included
     781            my %projection_cells_found;
    777782            foreach my $skycell (@$skycells) {
    778783                my $tess_id = $skycell->{tess_id};
     
    781786                my $projection_cell = skycell_id_to_projection_cell($skycell_id);
    782787
    783                 print "$tess_id $skycell_id $projection_cell\n";
    784                 my $command = "$stacktool -dbname $imagedb -summary -tess_id $tess_id -projection_cell $projection_cell";
     788                # only need to include a projection cell once
     789                next if $projection_cells_found{$projection_cell};
     790
     791                $projection_cells_found{$projection_cell} = 1;
     792
     793                # print "$tess_id $skycell_id $projection_cell\n";
     794
     795                my $command = "$stacktool -dbname $imagedb -summary -tess_id $tess_id";
     796                $command .= " -projection_cell $projection_cell";
    785797
    786798                $command .= " -filter $filter" if $filter;
     
    791803            }
    792804        }
    793         # XXX: Lookup stackSummaries that match
    794     }
     805    }
     806
    795807    if ($results) {
    796808        foreach my $summary (@$results) {
     
    799811
    800812            # we need to flesh out the hashes returned with values that the parser expects
     813            $summary->{stage} = 'stack_summary';
    801814            $summary->{component} = $projection_cell;
    802815            $summary->{stage_id} = $summary->{sass_id};
    803             # $summary->{image} = "$path_base.$projection_cell.image.b1.fits";
    804             $summary->{image} = "$path_base.$projection_cell";
     816            $summary->{path_base} = "$path_base.$projection_cell";
     817
     818            # The stack_summary stage doesn't follow the usual ipp conventions for file rules
     819            # and path_base. We leave it up to the program that runs the job to handle this.
     820            # However, the parser uses the image parameter to set the job's outputBase (by removing the .fits)
     821            # so we need to set it. Just use the new path_base.
     822            $summary->{image} = $summary->{path_base};
    805823            $summary->{state} = 'full';
    806824            $summary->{data_state} = 'full';
     
    809827            $summary->{row_index} = [];
    810828            push @{$summary->{row_index}}, 0;
    811             # XXX: is there anything else?
     829
     830            # XXX: Are there any other required parameters?
    812831            # TODO: create a function to validate the components returned
    813             # and make sure that any required elements are there
     832            # and make sure that any required elements are there.
    814833        }
    815834    }
     
    19701989}
    19711990
    1972 # not particularly elegant
     1991# Convert from skycell_id to projection_cell
     1992# This code is not particularly elegant but I think that it matches the SQL used
     1993# to create stackAssocations does.
     1994
    19731995sub skycell_id_to_projection_cell {
    19741996    my $skycell_id = shift;
     1997
     1998    # split skycell_id into '.' separated components
    19751999    my @strs = split '\.', $skycell_id;
    19762000
    19772001    my $num = scalar @strs;
     2002
     2003    # projection_cell is 'skycell_id' plus all .num values except the last one
    19782004    my $projection_cell = $strs[0];
    19792005    for (my $i=1; $i < $num - 1; $i++) {
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm

    r35466 r36018  
    2929                    $PSTAMP_SELECT_BACKMDL
    3030                    $PSTAMP_SELECT_JPEG
     31                    $PSTAMP_SELECT_EXP
     32                    $PSTAMP_SELECT_NUM
    3133                    $PSTAMP_SELECT_UNCOMPRESSED
    3234                    $PSTAMP_SELECT_INVERSE
     
    7173our $PSTAMP_SELECT_BACKMDL   = 32;
    7274our $PSTAMP_SELECT_JPEG      = 64;
    73 # unused 128
    74 # unused 256
     75our $PSTAMP_SELECT_EXP       = 128;
     76our $PSTAMP_SELECT_NUM       = 256;
    7577our $PSTAMP_SELECT_UNCOMPRESSED = 512;
    7678our $PSTAMP_SELECT_INVERSE      = 1024;
Note: See TracChangeset for help on using the changeset viewer.