Changeset 27643
- Timestamp:
- Apr 8, 2010, 6:48:58 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/detectability_respond.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/detectability_respond.pl
r27642 r27643 81 81 run(command => $dqr_command, verbose => $verbose); 82 82 unless ($success) { 83 warn("Unable to perform $dqr_command error code: $error_code");83 my_die("Unable to perform $dqr_command error code: $error_code",-1,-1,-1,-1,-1,-1); 84 84 } 85 85 my %query = (); … … 125 125 $query{CONTENT}{RA1_DEG}[$i],$query{CONTENT}{DEC1_DEG}[$i], 126 126 $query{CONTENT}{ROWNUM}[$i],$verbose); 127 unless (%$image_set_tmp) { 128 my_die("No images were returned.",$query{HEADER}{QUERY_ID}[0],$query{HEADER}{FPA_ID}[0], 129 $query{HEADER}{MJD_OBS}[0],$query{HEADER}{FILTER}[0],$query{HEADER}{OBSCODE}[0], 130 $query{HEADER}{STAGE}[0]); 131 } 127 132 print "=== $image_set_tmp->{IMAGE}\n $image_set_tmp->{PSF}\n $image_set_tmp->{MASK}\n $image_set_tmp->{WEIGHT}\n $image_set_tmp->{SKY_COORDINATES}\n $image_set_tmp->{ROWNUM}\n"; 128 133 # This appends, assuming that if we get an image, we also get the identical psf/mask/weight/etc. … … 154 159 run(command => $command, verbose => $verbose); 155 160 unless ($success) { 156 warn("Unable to perform $command error code: $error_code"); 161 my_die("Unable to perform $command. Error_code: $error_code", 162 $query{HEADER}{QUERY_ID}[0],$query{HEADER}{FPA_ID}[0], 163 $query{HEADER}{MJD_OBS}[0],$query{HEADER}{FILTER}[0],$query{HEADER}{OBSCODE}[0], 164 $query{HEADER}{STAGE}[0],$error_code); 157 165 } 158 166 my @response = split /\n/, (join "", @$stdout_buf); … … 177 185 run(command => $psphot_cmd, verbose => $verbose); 178 186 unless ($success) { 179 warn ("Unable to perform $psphot_cmd error code: $error_code"); 187 my_die("Unable to perform $psphot_cmd. Error_code: $error_code", 188 $query{HEADER}{QUERY_ID}[0],$query{HEADER}{FPA_ID}[0], 189 $query{HEADER}{MJD_OBS}[0],$query{HEADER}{FILTER}[0],$query{HEADER}{OBSCODE}[0], 190 $query{HEADER}{STAGE}[0],$error_code); 180 191 } 181 192 } … … 253 264 # Diffs match if either exposure name is defined and matches the FPA_ID 254 265 unless ((defined(${ $j }{exp_name_1}) && (${ $j }{exp_name_1} eq $FPA_ID))|| 255 (defined(${ $j }{exp_name_2}) && (${ $j }{exp_name_2} eq $FPA_ID))) { 266 (defined(${ $j }{exp_name_2}) && (${ $j }{exp_name_2} eq $FPA_ID))|| 267 (${ $j }{exp_id_1} eq $FPA_ID)||(${ $j }{exp_id_2} eq $FPA_ID)) { 256 268 next; 257 269 } … … 268 280 # For all the other stages (warp and chip are the ones I've tested), we can simply 269 281 # directly match the exposure name to the FPA_ID 270 if (${ $j }{exp_name} ne $FPA_ID) {282 unless ((${ $j }{exp_name} eq $FPA_ID)||(${ $j }{exp_id} eq $FPA_ID)) { 271 283 next; 272 284 } 273 285 } 274 286 # Debug prints of all the components of this image 275 #foreach my $k (keys %{ $j }) {276 #print "$i $j $k ${ $j }{$k}\n";277 #}287 foreach my $k (keys %{ $j }) { 288 print "$i $j $k ${ $j }{$k}\n"; 289 } 278 290 279 291 # This image matches, so we want to save the information into our output structure … … 499 511 } 500 512 } 513 514 sub my_die { 515 my $message = shift; 516 my $QUERY_ID = shift; 517 my $FPA_ID = shift; 518 my $MJD_OBS = shift; 519 my $FILTER = shift; 520 my $OBSCODE = shift; 521 my $STAGE = shift; 522 523 my $exit_code = shift; # Exit code to add 524 525 $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code; 526 527 carp("$message : $QUERY_ID $FPA_ID $MJD_OBS $FILTER $OBSCODE $STAGE"); 528 exit($exit_code); 529 530 }
Note:
See TracChangeset
for help on using the changeset viewer.
