Changeset 35398 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Apr 12, 2013, 11:03:47 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r35384 r35398 27 27 my $outdir; 28 28 my $product; 29 my $label ;29 my $label = ""; 30 30 my $save_temps; 31 31 my $no_update; … … 57 57 die "outdir is required" if !$outdir; 58 58 die "product is required" if !$product; 59 } else { 60 $req_id = 0; 61 $outdir = "nowhere"; 62 $product = "dummy"; 59 63 } 60 64 … … 83 87 $pstamptool .= " -dbserver $dbserver" if $dbserver; 84 88 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"; 87 92 88 93 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 89 94 90 95 # 91 # get the datafrom the extension header96 # Read the keywords from the extension header 92 97 # 93 98 my $fields_output; … … 96 101 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 97 102 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. 102 105 $fields_output = join "", @$stdout_buf; 103 106 } … … 105 108 106 109 # 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 111 my_die("$request_file_name does not contain EXTNAME\n", $PS_EXIT_PROG_ERROR) if !$extname; 112 my_die("$request_file_name is not a PS1_PS_REQUEST\n", $PS_EXIT_PROG_ERROR) if $extname ne "PS1_PS_REQUEST"; 113 my_die("REQ_NAME not found in $request_file_name\n", $PS_EXIT_PROG_ERROR) if (!$req_name); 114 my_die("wrong EXTVER $extver found in $request_file_name\n", $PS_EXIT_PROG_ERROR) if ($extver ne "1" and $extver ne "2"); 111 115 112 116 if ($extver >= 2) { 113 117 # 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; 119 123 # XXX check for "valid" $email 120 124 } else { … … 437 441 # Since user can get unmagicked data "by coordinate" requests can go back in time 438 442 # 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) { 440 444 # ... so unless the user sets mjd_min clamp it to 2009-04-01 441 445 # XXX: This value should live in the pstampProject table not be hardcoded here … … 454 458 print "\nCalling new_locate_images for row: $rownum\n"; 455 459 456 $imageList = new_locate_images($ipprc, $image_db, $camera, $row, $verbose);460 $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose); 457 461 458 462 my $dtime_locate = gettimeofday() - $start_locate; … … 736 740 737 741 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"; 738 744 foreach my $image (@$imageList) { 739 745 print "$image->{image}\n"; 746 ++$firstRow->{job_num}; 740 747 } 741 748 } elsif ($job_type eq "get_image") { … … 1156 1163 my $fault = shift; 1157 1164 1158 carp$msg;1165 print STDERR $msg; 1159 1166 1160 1167 # 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.
