IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24921 for trunk/PS-IPP-PStamp


Ignore:
Timestamp:
Jul 24, 2009, 2:45:59 PM (17 years ago)
Author:
bills
Message:

when parsing postage stamp request files run dvoImagesAtCoords to
narrow down the images that contain the center pixel. This prevents
queuing many many failing jobs

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

    r24831 r24921  
    2424use PS::IPP::Metadata::List qw( parse_md_list );
    2525use PS::IPP::Config qw( :standard );
     26use Carp;
    2627
    2728### my @images = locate_images($image_db, $req_type, $img_type, $id, $component,
     
    121122    my $command;
    122123    my $id_opt;     # option for the lookup
     124    my $image_name;
    123125    my $mask_name;
    124126    my $weight_name;
     
    130132
    131133    # special class_id value "null" means ignore
    132     if ($component eq "null") {
     134    if ($component and ($component eq "null")) {
    133135        $component = undef;
    134136    }
     
    146148        $command .= " -class_id $class_id" if $class_id;
    147149        $id_opt = "-chip_id";
     150        $image_name   = "PPIMAGE.CHIP";
    148151        $mask_name    = "PPIMAGE.CHIP.MASK";
    149152        $weight_name  = "PPIMAGE.CHIP.VARIANCE";
     
    156159        $command .= " -skycell_id $skycell_id" if $skycell_id;
    157160        $id_opt = "-warp_id";
     161        $image_name   = "PSWARP.OUTPUT";
    158162        $mask_name    = "PSWARP.OUTPUT.MASK";
    159163        $weight_name  = "PSWARP.OUTPUT.VARIANCE";
     
    164168        $command .= " -skycell_id $skycell_id" if $skycell_id;
    165169        $id_opt = "-diff_id";
     170        $image_name  = "PPSUB.OUTPUT";
    166171        $mask_name   = "PPSUB.OUTPUT.MASK";
    167172        $weight_name = "PPSUB.OUTPUT.VARIANCE";
     
    171176        $id_opt = "-stack_id";
    172177
     178        $image_name  = "PPSTACK.OUTPUT";
    173179        $mask_name   = "PPSTACK.OUTPUT.MASK";
    174180        $weight_name = "PPSTACK.OUTPUT.VARIANCE";
     
    225231            $ipprc->define_camera($camera);
    226232        }
    227         my $out = {};
    228         $out->{exp_id} = $image->{exp_id};
    229         $out->{exp_name} = $image->{exp_name};
     233        my $out = $image;
     234        # if uri is nil this will get overridded below
    230235        $out->{image}  = $image->{uri};
    231         $out->{state}  = $image->{state}; # state is undef for rawExp, but that's ok
    232         if ($set_class_id) {
    233             $class_id = $image->{class_id};
    234             $out->{class_id} = $class_id;
    235         }
     236#        $out->{exp_id} = $image->{exp_id};
     237#        $out->{exp_name} = $image->{exp_name};
     238#        $out->{state}  = $image->{state}; # state is undef for rawExp, but that's ok
     239#        if ($set_class_id) {
     240#            $class_id = $image->{class_id};
     241#            $out->{class_id} = $class_id;
     242#        }
    236243
    237244        # find the mask and weight images
    238245        if ($base) {
     246            $out->{image}  = $ipprc->filename($image_name,   $base, $class_id) if $image_name;
    239247            $out->{mask}   = $ipprc->filename($mask_name,   $base, $class_id) if $mask_name;
    240248            $out->{weight} = $ipprc->filename($weight_name, $base, $class_id) if $weight_name;
    241249        }
    242         $out->{camera} = $camera;
     250#        $out->{camera} = $camera;
    243251
    244252        $out->{astrom} = find_astrometry($ipprc, $image_db, $image, $verbose) if $want_astrom;
     
    539547# resolve_project()
    540548# get project specific information
     549my $last_project = "";
    541550sub resolve_project {
    542551    my $ipprc = shift;
    543552    my $project_name = shift;
     553
     554    if (!$project_name) {
     555        carp ("project is not defined");
     556        return undef;
     557    }
     558
     559    if ($project_name eq $last_project) {
     560        return $last_project;
     561    }
     562
    544563    my $dbname = shift;
    545564    my $dbserver = shift;
    546     die "project is not defined" if !$project_name;
    547565
    548566    my $verbose = 0;
     
    575593    my $proj_hash = parse_md_fast($mdcParser, $output);
    576594
    577     return $proj_hash->[0];
     595    $last_project = $proj_hash->[0];
     596
     597    return $last_project;
    578598}
    5795991;
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm

    r23266 r24921  
    2626
    2727
     28# these values need to match the ones in pstamp/src/pstamp.h
    2829our $PSTAMP_CENTER_IN_PIXELS = 1;
    2930our $PSTAMP_RANGE_IN_PIXELS  = 2;
Note: See TracChangeset for help on using the changeset viewer.