IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 12, 2013, 11:03:47 AM (13 years ago)
Author:
bills
Message:

If user specifies RELEASE_NAME or SURVEY use releasetool
to look up images.
When sources are selected extract them from the region of interest
using ppstamp. Use skycal cmf if available.

File:
1 edited

Legend:

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

    r35384 r35398  
    2727my $outdir;
    2828my $product;
    29 my $label;
     29my $label = "";
    3030my $save_temps;
    3131my $no_update;
     
    5757    die "outdir is required"  if !$outdir;
    5858    die "product is required"  if !$product;
     59} else {
     60    $req_id = 0;
     61    $outdir = "nowhere";
     62    $product = "dummy";
    5963}
    6064
     
    8387$pstamptool .= " -dbserver $dbserver" if $dbserver;
    8488
    85 # list_job is a deugging mode
    86 $no_update = 1 if $mode eq "list_job";
     89# If $mode is not queue_job we are using a debugging mode
     90# do not update the database
     91$no_update = 1 if $mode ne "queue_job";
    8792
    8893my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    8994
    9095#
    91 # get the data from the extension header
     96# Read the keywords from the extension header
    9297#
    9398my $fields_output;
     
    96101    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    97102        run(command => $command, verbose => $verbose);
    98     # fields doesn't return zero when it succeeds
    99     #unless ($success) {
    100     #    print STDERR @$stderr_buf;
    101     #}
     103
     104    # note fields doesn't return zero when it succeeds.
    102105    $fields_output = join "", @$stdout_buf;
    103106}
     
    105108
    106109# make sure the file contains what we are expecting
    107 # This program shouldn't have been run if the request file is bogus.
    108 my_die("$request_file_name is not a PS1_PS_REQEST", $PS_EXIT_PROG_ERROR) if $extname ne "PS1_PS_REQUEST";
    109 my_die("REQ_NAME not found in $request_file_name", $PS_EXIT_PROG_ERROR)  if (!$req_name);
    110 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1" and $extver ne "2");
     110# pstamp_parser_run.pl would not have run this program unless the request file was ok
     111my_die("$request_file_name does not contain EXTNAME\n", $PS_EXIT_PROG_ERROR) if !$extname;
     112my_die("$request_file_name is not a PS1_PS_REQUEST\n", $PS_EXIT_PROG_ERROR) if $extname ne "PS1_PS_REQUEST";
     113my_die("REQ_NAME not found in $request_file_name\n", $PS_EXIT_PROG_ERROR)  if (!$req_name);
     114my_die("wrong EXTVER $extver found in $request_file_name\n", $PS_EXIT_PROG_ERROR) if ($extver ne "1" and $extver ne "2");
    111115
    112116if ($extver >= 2) {
    113117    # We have a version 2 file. Require that the new keywords be supplied.
    114     my_die("action not supplied in version $extver request file $request_file_name", $PSTAMP_INVALID_REQUEST) unless defined $action;
    115 
    116     my_die("invalid action: $action supplied in version $extver request file $request_file_name", $PSTAMP_INVALID_REQUEST) unless (uc($action) eq 'PROCESS' or uc($action) eq 'PREVIEW');
    117 
    118     my_die("email not supplied in version $extver request file $request_file_name", $PSTAMP_INVALID_REQUEST) unless $email;
     118    my_die("action not supplied in version $extver request file $request_file_name\n", $PSTAMP_INVALID_REQUEST) unless defined $action;
     119
     120    my_die("invalid action: $action supplied in version $extver request file $request_file_name\n", $PSTAMP_INVALID_REQUEST) unless (uc($action) eq 'PROCESS' or uc($action) eq 'PREVIEW');
     121
     122    my_die("email not supplied in version $extver request file $request_file_name\n", $PSTAMP_INVALID_REQUEST) unless $email;
    119123    # XXX check for "valid" $email
    120124} else {
     
    437441    # Since user can get unmagicked data "by coordinate" requests can go back in time
    438442    # to dredge unusable data from the "dark days"...
    439     if ($req_type eq 'bycoord' and $row->{MJD_MIN} == 0) {
     443    if ($req_type eq 'bycoord' and $row->{IMG_TYPE} ne 'stack' and $row->{MJD_MIN} == 0) {
    440444        # ... so unless the user sets mjd_min clamp it to 2009-04-01
    441445        # XXX: This value should live in the pstampProject table not be hardcoded here
     
    454458    print "\nCalling new_locate_images for row: $rownum\n";
    455459
    456     $imageList = new_locate_images($ipprc, $image_db, $camera, $row, $verbose);
     460    $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose);
    457461
    458462    my $dtime_locate = gettimeofday() - $start_locate;
     
    736740
    737741    if ($mode eq "list_uri") {
     742        $num_jobs = $imageList ? scalar @$imageList : 0;
     743        print "List of $num_jobs Images selected for row: $firstRow->{ROWNUM}\n";
    738744        foreach my $image (@$imageList) {
    739745            print "$image->{image}\n";
     746            ++$firstRow->{job_num};
    740747        }
    741748    } elsif ($job_type eq "get_image") {
     
    11561163    my $fault = shift;
    11571164
    1158     carp $msg;
     1165    print STDERR $msg;
    11591166
    11601167    # we don't fault the request here pstamp_parser_run.pl handles that if necessary
Note: See TracChangeset for help on using the changeset viewer.