IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 5, 2010, 1:47:06 PM (16 years ago)
Author:
bills
Message:

add support for making stamps from unconvolved stacks and if
REQFILT is a single charcter append a '%' character

File:
1 edited

Legend:

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

    r27140 r27211  
    3838    my $tess_id  = shift;
    3939    my $component= shift;   # class_id or skycell_id
    40     my $inverse  = shift;
     40    my $option_mask  = shift;
    4141    my $need_magic = shift;
    4242    my $x        = shift;
     
    4848    my $verbose  = shift;
    4949
    50 
    5150    # we die in response to bad data in request files
    5251    # The wrapper script is responsible for updating the database
     
    5857           ($req_type ne "byskycell");
    5958
     59
    6060    my $dateobs_begin;
    6161    my $dateobs_end;
     
    7777
    7878    if ($req_type eq "bycoord") {
    79         my $results = lookup_bycoord($ipprc, $image_db, $img_type, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     79        my $results = lookup_bycoord($ipprc, $image_db, $img_type, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    8080        return $results;
    8181    }
     
    8686        # in one place
    8787        $req_type = "bydiff";
    88         my $results = lookup_diff($ipprc, $image_db, $id, $component, 1, $inverse, $img_type, $verbose);
     88        my $results = lookup_diff($ipprc, $image_db, $id, $component, 1, $option_mask, $img_type, $verbose);
    8989        return $results;
    9090    }
    9191
    9292    if ($req_type eq "bydiff") {
    93         my $results = lookup_diff($ipprc, $image_db, $id, $component, 0, $inverse, $img_type, $verbose);
     93        my $results = lookup_diff($ipprc, $image_db, $id, $component, 0, $option_mask, $img_type, $verbose);
    9494        if (!$results) {
    9595            return undef;
     
    139139
    140140    my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic,
    141         $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     141        $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    142142
    143143    return $results;
     
    158158    my $filter = shift;
    159159    my $data_group = shift;
     160    my $option_mask = shift;
    160161    my $verbose  = shift;
     162
     163    my $inverse = $option_mask & $PSTAMP_SELECT_INVERSE;
     164    my $unconvolved = $option_mask & $PSTAMP_SELECT_UNCONV;
    161165
    162166    my $missing_tools;
     
    244248        $component_args = " -skycell_id $skycell_id" if $skycell_id;
    245249
    246         $image_name  = "PPSTACK.OUTPUT";
    247         $mask_name   = "PPSTACK.OUTPUT.MASK";
    248         $weight_name = "PPSTACK.OUTPUT.VARIANCE";
     250        if (!$unconvolved) {
     251            $image_name  = "PPSTACK.OUTPUT";
     252            $mask_name   = "PPSTACK.OUTPUT.MASK";
     253            $weight_name = "PPSTACK.OUTPUT.VARIANCE";
     254        } else {
     255            $image_name  = "PPSTACK.UNCONV";
     256            $mask_name   = "PPSTACK.UNCONV.MASK";
     257            $weight_name = "PPSTACK.UNCONV.VARIANCE";
     258        }
    249259        # this is wrong but gets the right answer. Need to figure out how to find the
    250260        # rule properly
     
    351361        } elsif ($img_type eq "diff") {
    352362            $stage_id = $image->{diff_id};
     363            if ($inverse && $image->{bothways}) {
     364                $image_name  = "PPSUB.INVERSE";
     365                $mask_name   = "PPSUB.INVERSE.MASK";
     366                $weight_name = "PPSUB.INVERSE.VARIANCE";
     367                $cmf_name    = "PPSUB.INVERSE.SOURCES";
     368            }
    353369        } elsif ($img_type eq "stack") {
    354370            $stage_id = $image->{stack_id};
     
    379395    my $skycell_id = shift;
    380396    my $byid     = shift;
    381     my $inverse  = shift;
     397    my $option_mask  = shift;
    382398    my $img_type = shift;
    383399    my $verbose = shift;
     400
     401    my $inverse = $option_mask & $PSTAMP_SELECT_INVERSE;
    384402
    385403    my $missing_tools;
     
    503521                $image->{mask}   = $ipprc->filename($filerule_base . ".MASK", $image->{path_base});
    504522                $image->{weight} = $ipprc->filename($filerule_base . ".VARIANCE", $image->{path_base});
     523                $image->{cmf}    = $ipprc->filename($filerule_base . ".SOURCES", $image->{path_base});
     524                $image->{psf}    = $ipprc->filename("PSPHOT.PSF.SKY.SAVE", $image->{path_base});
     525                $image->{stage_id} = $image->{diff_id};
     526                $image->{stage}    = "diff";
     527                $image->{image_db} = $image_db;
     528                $image->{component} = $image->{skycell_id};
    505529            } else {
    506530                # XXX this will only happen if the minuend is not a warp. See hack above
     
    527551    my $filter     = shift;
    528552    my $data_group = shift;
     553    my $option_mask = shift;
    529554    my $verbose    = shift;
    530555
     
    549574            my $these_results = lookup($ipprc, $image_db, "byid", $img_type, $run->{id},
    550575                $tess_id, $run->{component}, $need_magic,
    551                 $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     576                $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    552577
    553578            next if !$these_results;
     
    565590            my $these_results = lookup($ipprc, $image_db, "byskycell", $img_type, undef,
    566591                $skycell->{tess_id}, $skycell->{component}, $need_magic,
    567                 $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     592                $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    568593
    569594            next if !$these_results;
Note: See TracChangeset for help on using the changeset viewer.