Changeset 18983
- Timestamp:
- Aug 8, 2008, 3:45:45 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_finish.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_finish.pl
r18640 r18983 18 18 use PS::IPP::Metadata::List qw( parse_md_list ); 19 19 20 use PS::IPP::Config qw($PS_EXIT_SUCCESS 21 $PS_EXIT_UNKNOWN_ERROR 22 $PS_EXIT_SYS_ERROR 23 $PS_EXIT_CONFIG_ERROR 24 $PS_EXIT_PROG_ERROR 25 $PS_EXIT_DATA_ERROR 26 $PS_EXIT_TIMEOUT_ERROR 27 metadataLookupStr 28 metadataLookupBool 29 caturi 30 ); 31 32 33 my ( $req_id, $req_name, $product, $dbname, $verbose, $save_temps ); 20 use PS::IPP::Config qw( :standard ); 21 use PStamp::RequestFile qw( :standard ); 22 23 my ( $req_id, $req_name, $req_file, $product, $dbname, $verbose, $save_temps ); 34 24 35 25 # the char to the right of the bar may be used as a single - alias for the longer name … … 38 28 'req_id=s' => \$req_id, 39 29 'req_name=s' => \$req_name, 30 'req_file=s' => \$req_file, 40 31 'product=s' => \$product, 41 32 'dbname=s' => \$dbname, … … 45 36 46 37 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 38 39 die "usage: --req_id id --req_name name --req_file file --product product [--dbname dbname --verbose]\n" 40 if !$req_id or !$req_name or !$req_file or !$product; 47 41 48 42 my $missing_tools; … … 88 82 } 89 83 84 85 # this function is PStamp::RequestFile::read_request_file 86 my ($header, $rows) = read_request_file($req_file); 87 88 die "failed to read request_file $req_file" if !$header or !$rows; 90 89 91 90 # at this point we need to find out what kind of request type it is and … … 145 144 my $rownum = $job->{rownum}; 146 145 my $fault = $job->{fault}; 146 147 my $row_info = get_request_info($rows, $rownum); 147 148 # rownum fault img_name job_id 148 149 if (($job_type eq "stamp") || ($job_type eq "get_image")) { … … 157 158 my ($img_name, undef) = split '\|', $line; 158 159 160 # XXX TODO: need to get these from somewhere. Maybe the stamp. 161 # 162 # ra_deg and dec_deg are the coordinates of center of the stamp 163 # the rest of the metadata come from the original FPA. 164 # we could get these out of the rawExp table in the database.... 165 # 166 # Much of those data do not apply to stamps from Stack images. 167 my ($ra_deg, $dec_deg, $mjd_obs, $ra_obs, $dec_obs, $filter, $exp_time, $fpa_id) = 168 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); 169 159 170 # add line to the table definition file 160 171 print $tdf "$rownum|$fault|$img_name|$job_id|"; 161 # XXX TODO: need to lookup the rest of this stuff 162 print $tdf "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|\n"; 172 print $tdf "$ra_deg|$dec_deg|$mjd_obs|$ra_obs|$dec_obs|$filter|$exp_time|$fpa_id|"; 173 print $tdf "$row_info"; 174 print $tdf "\n"; 163 175 } 164 176 close JRL; … … 166 178 print STDERR "no reglist file for job $job_id\n" if $verbose; 167 179 print $tdf "$rownum|$fault|0|$job_id|"; 168 print $tdf "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0| 0|\n";180 print $tdf "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|\n"; 169 181 } 170 182 } else { 183 # XXX do list jobs 171 184 print STDERR "Unknown jobType: $job_type"; 172 185 next; … … 227 240 } 228 241 } 242 243 sub get_request_info { 244 my $rows = shift; 245 my $rownum = shift; 246 247 my $row = $rows->{$rownum}; 248 249 # This is ugly, error prone and hard to change. 250 # Create a results file module and provide a list of the names (we have the data in the columns) 251 my $rowinfo = "$row->{PROJECT}|$row->{JOB_TYPE}|$row->{REQ_TYPE}|$row->{IMG_TYPE}|"; 252 $rowinfo .= "$row->{ID}|$row->{CLASS_ID}|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|"; 253 $rowinfo .= "$row->{REQFILT}|$row->{COORD_MASK}|$row->{CENTER_X}|$row->{CENTER_Y}|"; 254 $rowinfo .= "$row->{WIDTH}|$row->{HEIGHT}|"; 255 256 return $rowinfo; 257 }
Note:
See TracChangeset
for help on using the changeset viewer.
