IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27991


Ignore:
Timestamp:
May 18, 2010, 10:39:36 AM (16 years ago)
Author:
bills
Message:

remove obsolete optimization

File:
1 edited

Legend:

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

    r27990 r27991  
    369369        $images = selectComponents($ipprc, $imagedb, $req_type, $stage, $rowList, $images, $verbose);
    370370    } else {
    371         # put each of the rows into all of the the images
     371        # put index for each of the rows into all of the the images
    372372        setRowRefs($rowList, $images);
    373373    }
     
    398398            $ipprc->define_camera($camera);
    399399        }
     400        # ok it's a keeper
    400401        my $out = $image;
    401402
    402403        # if uri is nil this will get overridded below
    403404        # (we do this here for raw stage)
    404         $out->{image}  = $image->{uri};
     405        $out->{image}  = $out->{uri};
    405406
    406407        if ($set_class_id) {
    407             $class_id = $image->{class_id};
     408            $class_id = $out->{class_id};
    408409            $out->{component} = $class_id;
    409410        } else {
    410             $out->{component} = $image->{skycell_id};
     411            $out->{component} = $out->{skycell_id};
    411412        }
    412413        my $stage_id;
    413414        if ($stage eq "raw") {
    414             $stage_id = $image->{exp_id};
     415            $stage_id = $out->{exp_id};
    415416        } elsif ($stage eq "chip") {
    416             $stage_id = $image->{chip_id};
     417            $stage_id = $out->{chip_id};
    417418        } elsif ($stage eq "warp") {
    418             $stage_id = $image->{warp_id};
     419            $stage_id = $out->{warp_id};
    419420        } elsif ($stage eq "diff") {
    420             $stage_id = $image->{diff_id};
    421             if ($inverse && $image->{bothways}) {
     421            $stage_id = $out->{diff_id};
     422            if ($inverse && $out->{bothways}) {
    422423                $image_name  = "PPSUB.INVERSE";
    423424                $mask_name   = "PPSUB.INVERSE.MASK";
     
    426427            }
    427428        } elsif ($stage eq "stack") {
    428             $stage_id = $image->{stack_id};
     429            $stage_id = $out->{stack_id};
    429430        }
    430431        $out->{stage_id} = $stage_id;
     
    450451            $out->{mask}   = $ipprc->filename($mask_name,   $mask_base, $class_id) if $mask_name;
    451452            $out->{weight} = $ipprc->filename($weight_name, $base, $class_id) if $weight_name;
    452             $out->{cmf}    = $ipprc->filename($cmf_name, $base, $class_id) if $cmf_name;
    453             $out->{psf}    = $ipprc->filename($psf_name, $base, $class_id) if $psf_name;
    454             $out->{backmdl}= $ipprc->filename($backmdl_name, $base, $class_id) if $backmdl_name;
     453            $out->{cmf}    = $ipprc->filename($cmf_name,    $base, $class_id) if $cmf_name;
     454            $out->{psf}    = $ipprc->filename($psf_name,    $base, $class_id) if $psf_name;
     455            $out->{backmdl}= $ipprc->filename($backmdl_name,$base, $class_id) if $backmdl_name;
    455456        }
    456457
     
    775776            chip_id   => $camRun->{chip_id},
    776777            cam_id    => $camRun->{cam_id},
    777             astrom    => $astrom_resolved,
     778            astrom    => $astrom_resolved,  # XXX: is astrom used?
    778779            class_id  => $class_id,
    779780            component => $class_id
     
    855856# cache of results of ppConfigDump
    856857my %astromSources;
    857 # my $last_exp_id = 0;
    858 my $lastCamRun;
    859858
    860859# find the astrometry file for a given exposure
    861860# return undef if no completed camRun exists
    862861# XXX Right now this probably only works cameras where the astrometry is done at the camera stage
     862# What other possibilities are there for ASTROM.SOURCE besides PSASTRO.OUTPUT?
     863
    863864sub find_astrometry {
    864865    my $ipprc = shift;
     
    870871
    871872    my $exp_id = $image->{exp_id};
    872     if (defined $lastCamRun) {
    873         if ($lastCamRun->{exp_id} == $exp_id) {
    874             # running camtool 60 times is really expensive when the answer is the same every time
    875             $image->{astrom} = $lastCamRun->{astrom};
    876             $image->{cam_path_base} = $lastCamRun->{path_base};
    877             return 1;
    878         }
    879     }
    880     # $last_exp_id = 0;
    881     # $lastAstromFile = undef;
    882     $lastCamRun = undef;
    883873
    884874    my $camRun = getCamRunByExpID($exp_id);
     
    945935    # XXX: Is this code correct if ASTROM.SOURCE ne "PSASTRO.OUTPUT"
    946936    my $astromFile = $ipprc->filename($astromSource, $camRoot);
    947     if ($astromFile) {
    948         $lastCamRun = $camRun;
    949         $lastCamRun->{astrom} = $astromFile;
    950 #        $last_exp_id = $exp_id;
    951     } else {
     937    if (!$astromFile) {
     938        print STDERR "failed to find astrometry file from $astromSource $camRoot\n";
    952939        return 0;
    953940    }
Note: See TracChangeset for help on using the changeset viewer.