Changeset 33324
- Timestamp:
- Feb 21, 2012, 4:11:24 PM (14 years ago)
- Location:
- trunk/pstamp/scripts
- Files:
-
- 4 edited
-
Makefile.am (modified) (1 diff)
-
dquery_finish.pl (modified) (1 diff)
-
dqueryparse.pl (modified) (8 diffs)
-
pstamp_job_run.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/Makefile.am
r30469 r33324 29 29 detect_query_create \ 30 30 detect_response_create \ 31 dquery_job_run.pl \ 31 32 dquery_finish.pl \ 32 33 dqueryparse.pl \ -
trunk/pstamp/scripts/dquery_finish.pl
r33286 r33324 143 143 144 144 if (-s $reg_list) { 145 my $command = " echo Skipping$dsreg --add $req_name --product $product --list $reg_list";145 my $command = "$dsreg --add $req_name --product $product --list $reg_list"; 146 146 $command .= " --copy --datapath $outdir"; 147 147 $command .= " --type MOPS_DETECTABILITY_RESPONSE"; -
trunk/pstamp/scripts/dqueryparse.pl
r33299 r33324 100 100 101 101 102 # 103 # query is a hash which uses $fpa_id as the key 104 # The values are hash references which have the various parameter name as the key 105 # The values of the parameter hashes are arrays which contain the values for individual rows 106 # in the detectabilty query request 102 107 my %query = (); 103 my %image_list_hash = ();104 108 105 109 { 106 110 # 107 111 # Parse input request file using detect_query_read 112 # result is a simple text file 108 113 # 109 114 my $dqr_command = "$detect_query_read --dbname $imagedb --input $request_file"; … … 139 144 } 140 145 # 141 # Identify target images. This should properly collate targets on a single imfile.146 # Identify target components. This should properly collate targets on a single imfile. 142 147 # 143 148 my $query_id; … … 223 228 $option_mask |= $PSTAMP_SELECT_VARIANCE; 224 229 $option_mask |= $PSTAMP_SELECT_PSF; 225 my $need_magic = 1; 230 231 # magic is dead 232 my $need_magic = 0; 226 233 if ($stage eq 'stack') { 227 234 $need_magic = 0; … … 245 252 foreach my $this_image_ref (@{ $pstamp_images_ref }) { 246 253 247 if (0) { 248 foreach my $key (sort (keys %{ $this_image_ref } )) { 249 my $value = ${ $this_image_ref }{$key}; 250 if ($key eq 'row_index') { 251 $value = join ' ', @{ $this_image_ref->{$key} }; 252 } 253 print "$this_image_ref $key $value\n"; 254 } 255 } 256 257 254 # loop over the rows that this component matched 258 255 foreach my $valid_index (@{ $this_image_ref->{row_index} }) { 259 256 $query{$fpa_id}{IMAGE}[$valid_index] = $this_image_ref->{image}; … … 336 333 foreach my $fpa_id (keys %query) { 337 334 for (my $i = 0; $i <= $#{ $query{$fpa_id}{ROWNUM} }; $i++) { 338 # print WISDOM "$fpa_id\t";339 # foreach my $key (keys %{ $query{$fpa_id} }) {340 # print WISDOM "$key $query{$fpa_id}{$key}[$i]\t";341 # }342 # print WISDOM "\n";343 # my $data_state = $query{$fpa_id}{DATA_STATE}[$i];344 # if ($query{$fpa_id}{BAD_COMPONENT}[$i] == 0) {345 # if ($data_state ne 'full') {346 347 # @{ $update_request{$query{$fpa_id}{IMAGE}[$i]}{$query{$fpa_id}{FAULT}[$i]} } =348 # ($query{$fpa_id}{STATE}[$i],$query{$fpa_id}{STAGE}[$i],$query{$fpa_id}{STAGE_ID}[$i],349 # $query{$fpa_id}{COMPONENT_ID}[$i],$query{$fpa_id}{NEED_MAGIC}[$i],$query{$fpa_id}{IMAGE_DB}[$i]);350 # }351 # }352 335 if ($query{$fpa_id}{BAD_COMPONENT}[$i] == 0) { 353 336 push @{ $rows_for_component{$fpa_id}{$query{$fpa_id}{IMAGE}[$i]} }, $i; … … 358 341 } 359 342 360 my $job_num = 0; 343 # 344 # Finally build the parameter lists and queue jobs for each component 345 # 346 347 my $job_num = 1; 361 348 foreach my $fpa_id (keys %rows_for_component) { 362 349 foreach my $component (keys % {$rows_for_component{$fpa_id} } ) { … … 368 355 my $stage = $query{$fpa_id}{STAGE}[$i]; 369 356 my $stage_id = $query{$fpa_id}{STAGE_ID}[$i]; 370 my $component = $query{$fpa_id}{ STAGE_ID}[$i];357 my $component = $query{$fpa_id}{COMPONENT_ID}[$i]; 371 358 print "Need to UPDATE $stage $stage_id $component from $data_state\n"; 359 #### my ($req_id, $outdir, $label, $state, $stage, $stage_id, $component, $need_magic, $imagedb) = @_; 372 360 $dep_id = queue_update_run($req_id, $outdir, $label, $data_state, $stage, $stage_id, $component, 0, $imagedb); 373 361 } 374 362 375 363 my $outputBase = "$outdir/$job_num" . "_"; 364 365 # params_file is an mdc description containing the parameters for the job 376 366 my $params_file = $outputBase . "params.mdc"; 377 367 378 368 open PARAMS, ">$params_file" or my_die("failed to create $params_file", $PS_EXIT_UNKNOWN_ERROR); 369 370 # first the job params 379 371 print PARAMS "dqueryJobParams METADATA\n"; 380 372 foreach my $key (keys %{ $query{$fpa_id} } ) { … … 383 375 } 384 376 print PARAMS "END\n\n"; 377 378 # then one structure with the coordinates for each row 385 379 print PARAMS "dqueryCoord MULTI\n"; 386 380 381 my @coordkeys = qw(ROWNUM RA1_DEG DEC1_DEG RA2_DEG DEC2_DEG MAG); 387 382 foreach my $row ( @{ $rows_for_component{$fpa_id}{$component} }) { 388 my @coordkeys = qw(ROWNUM RA1_DEG DEC1_DEG RA2_DEG DEC2_DEG MAG);389 383 print PARAMS "\ndqueryCoord METADATA\n"; 390 384 foreach my $key (@coordkeys) { -
trunk/pstamp/scripts/pstamp_job_run.pl
r33141 r33324 79 79 my $ppstamp = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1); 80 80 my $pstamp_get_image_job = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1); 81 my $dquery parse = can_run('dqueryparse.pl') or (warn "Can't find dqueryparse.pl" and $missing_tools = 1);81 my $dquery_job_run = can_run('dquery_job_run.pl') or (warn "Can't find dquery_job_run.pl" and $missing_tools = 1); 82 82 my $streaksreplace = can_run('streaksreplace') or (warn "Can't find streaksreplace" and $missing_tools = 1); 83 83 my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1); … … 303 303 } 304 304 } elsif ($jobType eq "detect_query") { 305 # detect_query jobs are basically holders to note that we need a file updated before we can continue. 306 # Load the argument list that dqueryparse should have created the first time it ran, so we know how to 307 # run it again the same way. 308 my $outdir = dirname($outputBase); 309 my $argslist = "$outdir/parse.args"; 310 open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR); 311 my $argString = <ARGSLIST>; 312 close ARGSLIST; 313 chomp $argString; 305 # my $outdir = dirname($outputBase); 306 # my $argslist = "$outdir/parse.args"; 307 # open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR); 308 # my $argString = <ARGSLIST>; 309 # close ARGSLIST; 310 # chomp $argString; 314 311 315 312 # XXX: should we do any other sanity checking? 316 my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;317 318 my $command = "$dquery parse --job_id $job_id $argString";313 # my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString; 314 315 my $command = "$dquery_job_run --job_id $job_id --output_base $outputBase"; 319 316 $command .= " --dbname $dbname" if $dbname; 320 317 $command .= " --dbserver $dbserver" if $dbserver; … … 329 326 } else { 330 327 $jobStatus = $error_code >> 8; 331 my_die("dquery parse.pl failed with error code: $jobStatus", $job_id, $jobStatus);328 my_die("dquery_job_run.pl failed with error code: $jobStatus", $job_id, $jobStatus); 332 329 } 333 330 } elsif ($jobType eq "child") {
Note:
See TracChangeset
for help on using the changeset viewer.
