IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2009, 12:42:13 PM (17 years ago)
Author:
watersc1
Message:

More merging

Location:
branches/czw_branch/cleanup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/cleanup

  • branches/czw_branch/cleanup/pstamp/scripts/pstampparse.pl

    r25143 r25158  
    1414use PS::IPP::PStamp::Job qw( :standard );
    1515use File::Temp qw(tempfile);
    16 use Carp;
    1716
    1817my $verbose;
     
    9796my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1");
    9897
    99 # check for duplicate request name
    100 if (!$no_update) {
     98{
    10199    my $command = "$pstamptool -listreq  -name $req_name";
    102100    $command .= " -dbname $dbname" if $dbname;
    103101    $command .= " -dbserver $dbserver" if $dbserver;
    104     # no verbose so that error message about request not found doesn't appear in parse_error.txt
    105102    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    106         run(command => $command, verbose => 0);
     103        run(command => $command, verbose => $verbose);
    107104    my $exitStatus = $error_code >> 8;
    108105    if ($success) {
     
    186183
    187184    my $option_mask= $row->{OPTION_MASK};
    188     my $inverse = ($option_mask & $PSTAMP_SELECT_INVERSE) ? 1 : 0;
    189     $row->{inverse} = $inverse;
    190185
    191186    my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS);
     
    252247        next;
    253248    } else {
    254         # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this
     249        # Call PS::IPP::PStamp::Job's locate_images subroutine to get the parameters for this
    255250        # request specification. An array reference is returned.
    256251        my ($x, $y);
    257 
    258252        $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $search_component,
    259                 $inverse, $skycenter, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
    260 
     253                $skycenter, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
    261254        if (!$imageList or !@$imageList) {
    262255            print STDERR "no matching images found for row $rownum\n" if $verbose;
     
    289282    my $have_skycells = shift;
    290283    my $need_magic = shift;
    291     my $num_jobs = 0;
    292284
    293285    my $rownum = $row->{ROWNUM};
    294286
    295287    my $components = $row->{components};
     288    my $numComponents = scalar keys %$components;
     289    if ( $numComponents == 0 ) {
     290        print STDERR "no jobs for row $rownum\n" if $verbose;
     291        insertFakeJobForRow($row, 1, $PSTAMP_NO_JOBS_QUEUED);
     292        return 1;
     293    }
    296294
    297295    my $roi_string;
     
    374372        my $fault = 0;
    375373
    376         if (($stage ne 'stack') and ($stage ne 'raw')) {
    377             if (($image->{state} eq 'goto_purged') or ($image->{data_state} eq 'purged')) {
    378                 $newState = 'stop';
    379                 $fault = $PSTAMP_GONE;
    380             } elsif (($image->{data_state} ne 'full') or ($image->{state} ne 'full' )) {
    381                 # XXX here is where we need to queue an update job
    382                 # for now just say that the image is not available
    383                 $newState = 'stop';
    384                 $fault = $PSTAMP_NOT_AVAILABLE;
    385             }
    386         }
     374if (0) {
     375        # XXX this doesn't work because not all ippTools outputs include data_state
     376        # fix chipTool also need to not make this test for raw stage
     377        if ((($stage ne 'stack') and ($image->{data_state} ne 'full')) or $image->{state} ne 'full' ){
     378            # XXX here is where we need to queue an update job
     379            # for now just say that the image is not available
     380            $newState = 'stop';
     381            $fault = 49;
     382        }
     383}
    387384
    388385        $num_jobs++;
     
    412409            print "skipping command: $command\n";
    413410        }
    414     }
    415     if ( $num_jobs == 0 ) {
    416         print STDERR "no jobs for row $rownum\n" if $verbose;
    417         insertFakeJobForRow($row, 1, $PSTAMP_NO_OVERLAP);
    418         $num_jobs = 1;
    419411    }
    420412    return $num_jobs;
     
    624616    return 0 if ($r1->{IMG_TYPE} ne $r2->{IMG_TYPE});
    625617    return 0 if ($r1->{ID} ne $r2->{ID});
    626     return 0 if ($r1->{inverse} ne $r2->{inverse});
    627618
    628619    if (defined($r1->{COMPONENT})) {
Note: See TracChangeset for help on using the changeset viewer.