Changeset 27914
- Timestamp:
- May 11, 2010, 12:09:05 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r27899 r27914 224 224 my $rownum = $row->{ROWNUM}; 225 225 if (!validID($rownum)) { 226 print STDERR "$rownum is not a valid ROWNUM\n" if $verbose;226 print STDERR "$rownum is not a valid ROWNUM\n"; 227 227 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 228 228 return 0; … … 230 230 my $job_type = $row->{JOB_TYPE}; 231 231 if (($job_type ne "stamp") and ($job_type ne "get_image")) { 232 print STDERR "$job_type is not a valid JOB_TYPE\n" if $verbose;232 print STDERR "$job_type is not a valid JOB_TYPE\n"; 233 233 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 234 234 return 0; … … 238 238 if (($req_type ne "byid") and ($req_type ne "bycoord") and ($req_type ne "byexp") and 239 239 ($req_type ne "byskycell") and ($req_type ne "bydiff")) { 240 print STDERR "$req_type is not a valid REQ_TYPE\n" if $verbose;240 print STDERR "$req_type is not a valid REQ_TYPE\n"; 241 241 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 242 242 return 0; 243 243 } 244 if ($job_type eq 'get_image') { 245 unless ($req_type eq 'byid' or $req_type eq 'byexp') { 246 print STDERR "REQ_TYPE must be 'byid' or 'byexp' for JOB_TYPE 'get_image'\n"; 247 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 248 return 0; 249 } 250 } 244 251 245 252 246 253 my $component = $row->{COMPONENT}; 247 254 if (!defined $component or (lc($component) eq "null") or (lc($component) eq "all")) { 248 $row->{COMPONENT} = $component = ""; 255 if ($job_type eq 'get_image') { 256 $row->{COMPONENT} = 'all'; 257 } else { 258 $row->{COMPONENT} = $component = ""; 259 } 249 260 } 250 261 $row->{TESS_ID} = "" if !defined $row->{TESS_ID}; … … 259 270 my $mjd_min = $row->{MJD_MIN}; 260 271 if (defined($mjd_min) and !validNumber($mjd_min)) { 261 print STDERR "$mjd_min is not a valid MJD_MIN\n" if $verbose;272 print STDERR "$mjd_min is not a valid MJD_MIN\n"; 262 273 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 263 274 return 0; … … 265 276 my $mjd_max = $row->{MJD_MAX}; 266 277 if (defined($mjd_max) and !validNumber($mjd_max)) { 267 print STDERR "$mjd_max is not a valid MJD_MAX\n" if $verbose;278 print STDERR "$mjd_max is not a valid MJD_MAX\n"; 268 279 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 269 280 return 0; … … 289 300 290 301 if (!$skycenter and !$component) { 291 print STDERR "COMPONENT must be specified for pixel coordinate ROI center\n" if $verbose;302 print STDERR "COMPONENT must be specified for pixel coordinate ROI center\n"; 292 303 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 293 304 return 0; … … 296 307 my $stage = $row->{IMG_TYPE}; 297 308 if (!check_image_type($stage)) { 298 print STDERR "invalid IMG_TYPE for row $rownum\n" if $verbose;309 print STDERR "invalid IMG_TYPE for row $rownum\n"; 299 310 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 300 311 return 0; … … 302 313 303 314 if ((($job_type eq "stamp") or ($req_type eq "bycoord")) and ! validROI($row)) { 304 print STDERR "invalid ROI for row $rownum\n" if $verbose;315 print STDERR "invalid ROI for row $rownum\n"; 305 316 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 306 317 return 0; … … 308 319 309 320 if (($req_type eq "byexp") and ($stage eq "stack")) { 310 print STDERR "byexp not implemented for stack stage. row: $rownum\n" if $verbose;321 print STDERR "byexp not implemented for stack stage. row: $rownum\n"; 311 322 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED); 312 323 return 0; … … 320 331 if ($req_type eq "bycoord") { 321 332 if (!$skycenter) { 322 print STDERR "center must be specified in sky coordintes for bycoord" if $verbose;333 print STDERR "center must be specified in sky coordintes for bycoord"; 323 334 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 324 335 return 0; … … 328 339 if (($req_type eq "byid") or ($req_type eq "bydiff")) { 329 340 if (!validID($row->{ID})) { 330 print STDERR "ID must be a positive integer for req_type $req_type\n" if $verbose;341 print STDERR "ID must be a positive integer for req_type $req_type\n"; 331 342 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 332 343 return 0 … … 350 361 my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver); 351 362 if (!$proj_hash) { 352 print STDERR "project $project not found\n" if $verbose;363 print STDERR "project $project not found\n" ; 353 364 foreach $row (@$rowList) { 354 365 insertFakeJobForRow($row, 1, $PSTAMP_UNKNOWN_PRODUCT); … … 714 725 # cause the image to be re-made 715 726 # set up to queue an update run 716 queue_update_run(\$newState, \$fault, \$dep_id, $image->{image _db},727 queue_update_run(\$newState, \$fault, \$dep_id, $image->{imagedb}, 717 728 $run_state, $stage, $image->{stage_id}, $image->{component}, $need_magic); 718 729 }
Note:
See TracChangeset
for help on using the changeset viewer.
