IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 20, 2008, 3:53:03 PM (18 years ago)
Author:
bills
Message:

fill out stubbed part of results file when there is an error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstampparse.pl

    r18587 r18640  
    6969
    7070my $pstamptool  = can_run('pstamptool')  or (warn "Can't find pstamptool"  and $missing_tools = 1);
    71 my $lookup_images = can_run('pstampparse') or (warn "Can't find pstampparse" and $missing_tools = 1);
     71my $locateimages = can_run('locateimages') or (warn "Can't find locateimages" and $missing_tools = 1);
    7272my $pstampdump  = can_run('pstampdump') or (warn "Can't find pstampdump" and $missing_tools = 1);
    7373my $fields  = can_run('fields') or (warn "Can't find fields" and $missing_tools = 1);
     
    147147    my $stamp_name   = $row->{STAMP_NAME};
    148148    my $filter   = $row->{FILTER};
    149     my $date_min = $row->{DATE_MIN};
    150     my $date_max = $row->{DATE_MAX};
     149    my $mjd_min = $row->{MJD_MIN};
     150    my $mjd_max = $row->{MJD_MAX};
    151151    my $x = $row->{CENTER_X};
    152152    my $y = $row->{CENTER_Y};
     
    155155    my $coord_mask = $row->{COORD_MASK};
    156156    my $option_mask= $row->{OPTION_MASK};
     157
     158    $stamp_name = "" if $stamp_name eq "null";
     159   
    157160
    158161    # XXX: TODO: don't die in this loop. If we encounter an error add a job with the proper fault
     
    182185    }
    183186
    184     die "region of interest is required for request type bycoord"
    185         if (($req_type eq "bycoord") && !defined($roi_string));
    186 
    187187    die "region of interest is required to make postage stamps"
    188188        if (($job_type eq "stamp") && !defined($roi_string));
     
    190190    # find the uris for this request
    191191
    192     # XXX: replace the invokcation of the hacked pstampparse with a new ippTool that finds
     192    if ($req_type eq "bycoord") {
     193        die "region of interest is required for request type bycoord" if !defined($roi_string) ;
     194        die "center must be specified in sky coordintes for bycoord"
     195            if ($coord_mask & PSTAMP_CENTER_IN_PIXELS);
     196        # replace the id with center coordinates
     197        $id = "$x $y";
     198    }
     199
     200    # XXX: replace the invokcation of the hacked locateimages with a new ippTool that finds
    193201    # images/runs and prints out the uri and other metadata as a metadata config doc
    194202
    195     my $command = "$lookup_images -dbname $image_db -$req_type $img_type $id $lookup_class_id";
     203    my $command = "$locateimages -dbname $image_db -$req_type $img_type $id $lookup_class_id";
     204    $command .= " -mjd_min $mjd_min" if ($mjd_min);
     205    $command .= " -mjd_max $mjd_max" if ($mjd_max);
    196206
    197207    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    245255
    246256            $num++;
    247             my $output_base = "$out_dir/${rownum}_${num}_${stamp_name}";
     257            my $output_base = "$out_dir/${rownum}_${num}";
     258            $output_base .= "_${stamp_name}" if $stamp_name;
    248259
    249260            # XXX: TODO: here is where we need to check whether or not the source inputs still exist
Note: See TracChangeset for help on using the changeset viewer.