IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 17, 2008, 9:42:10 AM (18 years ago)
Author:
bills
Message:

exit with error status if no matching images are found
add class_id to the filelist if image has one

File:
1 edited

Legend:

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

    r20166 r20221  
    192192            $x, $y, $mjd_min, $mjd_max, $filter);
    193193
     194    if (!$images) {
     195        print STDERR "no matching images found\n";
     196        exit $PS_EXIT_DATA_ERROR;
     197    }
    194198    if ($mode eq "list_uri") {
    195199        foreach my $image (@$images) {
     
    201205        my $listfile = "$out_dir/filelist";
    202206
     207
     208        # map our img_type to the Data Store file types.
     209        my %filelist_img_types = ( "raw" => "chip",
     210                                   "chip" => "chipproc",
     211                                   "warp" => "warp",
     212                                   "stack"=>"stack",
     213                                   "diff" => "diff");
     214
     215        my $filelist_img_type = $filelist_img_types{$img_type};
     216
    203217        open LISTFILE, ">$listfile"
    204218            or die "failed to open file list: $listfile while parsing get_image request $req_id";
    205219
    206220        foreach my $image (@$images) {
    207             print LISTFILE "$image->{image}|$img_type\n";
     221            my $class_id = $image->{class_id} ? $image->{class_id} : "";
     222            print LISTFILE "$image->{image}|$filelist_img_type|$class_id|\n";
    208223        }
    209224        close LISTFILE;
     
    234249            my $uri = $image->{image};
    235250            my $exp_id = $image->{exp_id};
     251           
    236252
    237253            $job_num++;
Note: See TracChangeset for help on using the changeset viewer.