Changeset 27211
- Timestamp:
- Mar 5, 2010, 1:47:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (14 diffs)
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm (modified) (4 diffs)
-
pstamp/scripts/pstamp_insert_request.pl (modified) (1 diff)
-
pstamp/scripts/pstamp_server_status (modified) (3 diffs)
-
pstamp/scripts/pstampparse.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r27140 r27211 38 38 my $tess_id = shift; 39 39 my $component= shift; # class_id or skycell_id 40 my $ inverse= shift;40 my $option_mask = shift; 41 41 my $need_magic = shift; 42 42 my $x = shift; … … 48 48 my $verbose = shift; 49 49 50 51 50 # we die in response to bad data in request files 52 51 # The wrapper script is responsible for updating the database … … 58 57 ($req_type ne "byskycell"); 59 58 59 60 60 my $dateobs_begin; 61 61 my $dateobs_end; … … 77 77 78 78 if ($req_type eq "bycoord") { 79 my $results = lookup_bycoord($ipprc, $image_db, $img_type, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $data_group, $ verbose);79 my $results = lookup_bycoord($ipprc, $image_db, $img_type, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose); 80 80 return $results; 81 81 } … … 86 86 # in one place 87 87 $req_type = "bydiff"; 88 my $results = lookup_diff($ipprc, $image_db, $id, $component, 1, $ inverse, $img_type, $verbose);88 my $results = lookup_diff($ipprc, $image_db, $id, $component, 1, $option_mask, $img_type, $verbose); 89 89 return $results; 90 90 } 91 91 92 92 if ($req_type eq "bydiff") { 93 my $results = lookup_diff($ipprc, $image_db, $id, $component, 0, $ inverse, $img_type, $verbose);93 my $results = lookup_diff($ipprc, $image_db, $id, $component, 0, $option_mask, $img_type, $verbose); 94 94 if (!$results) { 95 95 return undef; … … 139 139 140 140 my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic, 141 $dateobs_begin, $dateobs_end, $filter, $data_group, $ verbose);141 $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose); 142 142 143 143 return $results; … … 158 158 my $filter = shift; 159 159 my $data_group = shift; 160 my $option_mask = shift; 160 161 my $verbose = shift; 162 163 my $inverse = $option_mask & $PSTAMP_SELECT_INVERSE; 164 my $unconvolved = $option_mask & $PSTAMP_SELECT_UNCONV; 161 165 162 166 my $missing_tools; … … 244 248 $component_args = " -skycell_id $skycell_id" if $skycell_id; 245 249 246 $image_name = "PPSTACK.OUTPUT"; 247 $mask_name = "PPSTACK.OUTPUT.MASK"; 248 $weight_name = "PPSTACK.OUTPUT.VARIANCE"; 250 if (!$unconvolved) { 251 $image_name = "PPSTACK.OUTPUT"; 252 $mask_name = "PPSTACK.OUTPUT.MASK"; 253 $weight_name = "PPSTACK.OUTPUT.VARIANCE"; 254 } else { 255 $image_name = "PPSTACK.UNCONV"; 256 $mask_name = "PPSTACK.UNCONV.MASK"; 257 $weight_name = "PPSTACK.UNCONV.VARIANCE"; 258 } 249 259 # this is wrong but gets the right answer. Need to figure out how to find the 250 260 # rule properly … … 351 361 } elsif ($img_type eq "diff") { 352 362 $stage_id = $image->{diff_id}; 363 if ($inverse && $image->{bothways}) { 364 $image_name = "PPSUB.INVERSE"; 365 $mask_name = "PPSUB.INVERSE.MASK"; 366 $weight_name = "PPSUB.INVERSE.VARIANCE"; 367 $cmf_name = "PPSUB.INVERSE.SOURCES"; 368 } 353 369 } elsif ($img_type eq "stack") { 354 370 $stage_id = $image->{stack_id}; … … 379 395 my $skycell_id = shift; 380 396 my $byid = shift; 381 my $ inverse= shift;397 my $option_mask = shift; 382 398 my $img_type = shift; 383 399 my $verbose = shift; 400 401 my $inverse = $option_mask & $PSTAMP_SELECT_INVERSE; 384 402 385 403 my $missing_tools; … … 503 521 $image->{mask} = $ipprc->filename($filerule_base . ".MASK", $image->{path_base}); 504 522 $image->{weight} = $ipprc->filename($filerule_base . ".VARIANCE", $image->{path_base}); 523 $image->{cmf} = $ipprc->filename($filerule_base . ".SOURCES", $image->{path_base}); 524 $image->{psf} = $ipprc->filename("PSPHOT.PSF.SKY.SAVE", $image->{path_base}); 525 $image->{stage_id} = $image->{diff_id}; 526 $image->{stage} = "diff"; 527 $image->{image_db} = $image_db; 528 $image->{component} = $image->{skycell_id}; 505 529 } else { 506 530 # XXX this will only happen if the minuend is not a warp. See hack above … … 527 551 my $filter = shift; 528 552 my $data_group = shift; 553 my $option_mask = shift; 529 554 my $verbose = shift; 530 555 … … 549 574 my $these_results = lookup($ipprc, $image_db, "byid", $img_type, $run->{id}, 550 575 $tess_id, $run->{component}, $need_magic, 551 $dateobs_begin, $dateobs_end, $filter, $data_group, $ verbose);576 $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose); 552 577 553 578 next if !$these_results; … … 565 590 my $these_results = lookup($ipprc, $image_db, "byskycell", $img_type, undef, 566 591 $skycell->{tess_id}, $skycell->{component}, $need_magic, 567 $dateobs_begin, $dateobs_end, $filter, $data_group, $ verbose);592 $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose); 568 593 569 594 next if !$these_results; -
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
r26242 r27211 21 21 $PSTAMP_SELECT_IMAGE 22 22 $PSTAMP_SELECT_MASK 23 $PSTAMP_SELECT_VARIANCE 23 24 $PSTAMP_SELECT_WEIGHT 24 25 $PSTAMP_SELECT_CMF … … 26 27 $PSTAMP_SELECT_BACKMDL 27 28 $PSTAMP_SELECT_INVERSE 29 $PSTAMP_SELECT_UNCONV 28 30 $PSTAMP_WAIT_FOR_UPDATE 29 31 $PSTAMP_SUCCESS … … 50 52 our $PSTAMP_SELECT_IMAGE = 1; 51 53 our $PSTAMP_SELECT_MASK = 2; 54 our $PSTAMP_SELECT_VARIANCE = 4; 52 55 our $PSTAMP_SELECT_WEIGHT = 4; 53 56 our $PSTAMP_SELECT_CMF = 8; … … 55 58 our $PSTAMP_SELECT_BACKMDL = 32; 56 59 our $PSTAMP_SELECT_INVERSE = 1024; 60 our $PSTAMP_SELECT_UNCONV = 2048; 57 61 58 our $PSTAMP_WAIT_FOR_UPDATE = 2048;62 our $PSTAMP_WAIT_FOR_UPDATE = 32768; 59 63 60 64 # job and result codes -
trunk/pstamp/scripts/pstamp_insert_request.pl
r25318 r27211 95 95 $command .= " -dbname $dbname" if $dbname; 96 96 $command .= " -dbserver $dbserver" if $dbserver; 97 $command .= " -label WEB.UP"; 97 98 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 98 99 run(command => $command, verbose => $verbose); -
trunk/pstamp/scripts/pstamp_server_status
r27170 r27211 88 88 my ($task_state, $task, $nrun, $njobs, $ngood, $nfail, $ntime, $cmd) = split " ", $line; 89 89 # print "$task $task_state\n"; 90 my %this_task = ( name => $task, n jobs => $njobs, ngood => $ngood, nfail => $nfail, ntime => $ntime, cmd => $cmd );90 my %this_task = ( name => $task, nrun=> $nrun, njobs => $njobs, ngood => $ngood, nfail => $nfail, ntime => $ntime, cmd => $cmd ); 91 91 92 92 # change '.' in task name to '_' so we have a valid hash key … … 116 116 117 117 if ($request_run) { 118 print " $request_run->{ngood} of $request_run->{njobs} Requests parsed successfully.";118 print "<b>Parser Status:</b> $request_run->{nrun} running. $request_run->{ngood} parsed successfully. $request_run->{nfail} failed to parse."; 119 119 if ($request_fin) { 120 120 print " $request_fin->{ngood} Requests finished."; … … 125 125 print "\n"; 126 126 if ($job_run) { 127 print " $job_run->{ngood} of $job_run->{njobs} Jobs run successfully.";127 print "<b>Job Status:</b> $job_run->{nrun} running. $job_run->{ngood} completed successfully. $job_run->{nfail} failed"; 128 128 print "\n"; 129 129 } else { -
trunk/pstamp/scripts/pstampparse.pl
r27140 r27211 191 191 192 192 my $filter = $row->{REQFILT}; 193 if ($filter) { 194 if (length($filter) == 1) { 195 # allow single character filter cuts to work 196 $filter .= '%'; 197 } 198 } 193 199 my $mjd_min = $row->{MJD_MIN}; 194 200 my $mjd_max = $row->{MJD_MAX}; … … 198 204 $data_group = $row->{LABEL}; 199 205 $data_group = "null" if !defined $data_group; 206 $row->{DATA_GROUP} = $data_group; 200 207 } 201 208 … … 206 213 my $inverse = ($option_mask & $PSTAMP_SELECT_INVERSE) ? 1 : 0; 207 214 $row->{inverse} = $inverse; 215 my $unconvolved = ($option_mask & $PSTAMP_SELECT_UNCONV) ? 1 : 0; 216 $row->{unconvolved} = $unconvolved; 208 217 209 218 my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS); … … 228 237 } 229 238 239 if (($req_type eq "byexp") and ($stage eq "stack")) { 240 print STDERR "byexp not implemented for stack stage. row: $rownum\n" if $verbose; 241 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED); 242 $num_jobs++; 243 next; 244 } 245 230 246 231 247 # $mode list_uri is a debugging mode (it may used by the http interface) … … 273 289 # request specification. An array reference is returned. 274 290 $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component, 275 $ inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $data_group, $verbose);291 $option_mask, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $data_group, $verbose); 276 292 277 293 if (!$imageList or !@$imageList) { … … 385 401 } 386 402 387 my $base = basename($image->{path_base}); 403 my $base = basename($image->{image}); 404 if (! $base =~ /.fits$/ ) { 405 my_die("unexpected image file name found $image->{image}", $PS_EXIT_PROG_ERROR); 406 } 407 $base =~ s/.fits$//; 408 388 409 # XXX: TODO use filerule for this. I don't have a camera defined here 389 410 if (($stage eq 'chip') and ($image->{camera} eq 'GPC1')) { … … 815 836 return 0 if ($r1->{MJD_MAX} ne $r2->{MJD_MAX}); 816 837 return 0 if ($r1->{inverse} ne $r2->{inverse}); 838 return 0 if ($r1->{unconvolved} ne $r2->{unconvolved}); 817 839 818 840 if (defined($r1->{COMPONENT})) {
Note:
See TracChangeset
for help on using the changeset viewer.
