Changeset 35398 for trunk/pstamp/scripts
- Timestamp:
- Apr 12, 2013, 11:03:47 AM (13 years ago)
- Location:
- trunk/pstamp/scripts
- Files:
-
- 2 edited
-
pstamp_job_run.pl (modified) (4 diffs)
-
pstampparse.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_job_run.pl
r33512 r35398 113 113 114 114 if ($stage eq "raw") { 115 # zap options that don't apply to raw stage 115 116 $options &= ~($PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE); 116 117 } … … 136 137 $argString .= " -astrom $params->{astrom}"; 137 138 push @file_list, $params->{astrom}; 139 } 140 141 if ($options & $PSTAMP_SELECT_SOURCES) { 142 # Extract sources from astrometry file if provided. This will be the smf for chip stage 143 # or the skycal cmf for stacks 144 if ($params->{astrom}) { 145 $argString .= " -write_cmf"; 146 if ($stage eq 'stack') { 147 # Set psphot recipe to STACKPHOT so that the extended source paramters will 148 # be copied from the cmf file. 149 $argString .= " -recipe PSPHOT STACKPHOT" 150 } 151 } elsif ($params->{cmf}) { 152 $argString .= " -write_cmf"; 153 push @file_list, $params->{cmf}; 154 } else { 155 print "Could not find suitable sources file will not write cmf\n"; 156 } 138 157 } 139 158 … … 254 273 $PSTAMP_SELECT_MASK => "mk.fits", 255 274 $PSTAMP_SELECT_VARIANCE => "wt.fits", 275 $PSTAMP_SELECT_SOURCES => "cmf", 256 276 $PSTAMP_SELECT_JPEG => "jpg"); 257 277 258 my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE | $PSTAMP_SELECT_JPEG );278 my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE | $PSTAMP_SELECT_JPEG | $PSTAMP_SELECT_SOURCES); 259 279 260 280 foreach my $key (keys (%extensions)) { … … 400 420 my $pattern_file = $params->{pattern} if ($options & $PSTAMP_SELECT_BACKMDL); 401 421 my $cmf_file; 402 if ($stage ne 'chip') {403 # we don't ship chip stage cmf files because they may not be censored404 $cmf_file = $params->{cmf} if ($options & $PSTAMP_SELECT_CMF);405 }422 # if ($stage ne 'chip') { 423 # # we don't ship chip stage cmf files because they may not be censored 424 # $cmf_file = $params->{cmf} if ($options & $PSTAMP_SELECT_CMF); 425 # } 406 426 407 427 my $outdir = dirname($output_base); -
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.
