Changeset 29050 for trunk/pstamp/scripts/detectability_respond.pl
- Timestamp:
- Aug 25, 2010, 1:06:34 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/detectability_respond.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/detectability_respond.pl
r28902 r29050 98 98 my $key = shift(@key_values); 99 99 my $val = shift(@key_values); 100 # if we have wisdom, then we should have updated already. If not, we'll bomb out later in the code. 101 if ($key eq 'FAULT') { 102 $val = 0; 103 } 100 104 $query{$fpa_id}{$key}[$i] = $val; 101 105 } … … 148 152 # Determine the query style for this fpa_id 149 153 if ($fpa_id =~ /o.*g.*o/) { 150 $query_style = 'byexp';151 }154 $query_style = 'byexp'; 155 } 152 156 elsif ($fpa_id =~ /\d+/) { 153 $query_style = 'byid';154 }157 $query_style = 'byid'; 158 } 155 159 else { 156 exit_with_failure(21,"Parse error in request file");157 }160 exit_with_failure(21,"Parse error in request file"); 161 } 158 162 # Confirm that we only have one stage/filter/mjd 159 163 for (my $i = 0; $i <= $#{ $query{$fpa_id}{STAGE} }; $i++) { 160 $temp_hash{STAGE}{$query{$fpa_id}{STAGE}[$i]} = 1;161 $temp_hash{FILTER}{$query{$fpa_id}{FILTER}[$i]} = 1;162 $temp_hash{'MJD-OBS'}{$query{$fpa_id}{'MJD-OBS'}[$i]} = 1;163 }164 $temp_hash{STAGE}{$query{$fpa_id}{STAGE}[$i]} = 1; 165 $temp_hash{FILTER}{$query{$fpa_id}{FILTER}[$i]} = 1; 166 $temp_hash{'MJD-OBS'}{$query{$fpa_id}{'MJD-OBS'}[$i]} = 1; 167 } 164 168 if (scalar(keys(%{ $temp_hash{STAGE} })) == 1) { 165 169 $stage = (keys(%{ $temp_hash{STAGE} }))[0]; 166 170 } 167 171 else { 168 exit_with_failure(21,"Too many STAGEs specified");169 }172 exit_with_failure(21,"Too many STAGEs specified"); 173 } 170 174 if (scalar(keys(%{ $temp_hash{FILTER} })) == 1) { 171 $filter = (keys(%{ $temp_hash{FILTER} }))[0];172 }175 $filter = (keys(%{ $temp_hash{FILTER} }))[0]; 176 } 173 177 else { 174 exit_with_failure(21,"Too many FILTERs specified");175 }178 exit_with_failure(21,"Too many FILTERs specified"); 179 } 176 180 if (scalar(keys(%{ $temp_hash{'MJD-OBS'} })) == 1) { 177 $mjd = (keys(%{ $temp_hash{'MJD-OBS'} }))[0];178 }181 $mjd = (keys(%{ $temp_hash{'MJD-OBS'} }))[0]; 182 } 179 183 else { 180 exit_with_failure(21,"Too many MJD-OBS specified");181 }184 exit_with_failure(21,"Too many MJD-OBS specified"); 185 } 182 186 # Set common request components 183 187 my $option_mask |= 1; … … 231 235 } 232 236 else { 233 $query{$fpa_id}{CATALOG}[$valid_index] = $this_image_ref->{cmf};234 }237 $query{$fpa_id}{CATALOG}[$valid_index] = $this_image_ref->{cmf}; 238 } 235 239 if (exists($this_image_ref->{class_id})) { 236 240 $query{$fpa_id}{COMPONENT_ID}[$valid_index] = $this_image_ref->{class_id}; … … 304 308 ($query{$fpa_id}{STATE}[$i],$query{$fpa_id}{STAGE}[$i],$query{$fpa_id}{STAGE_ID}[$i], 305 309 $query{$fpa_id}{COMPONENT_ID}[$i],$query{$fpa_id}{NEED_MAGIC}[$i],$query{$fpa_id}{IMAGE_DB}[$i]); 306 push @{ $processing_request{$fpa_id}{$query{$fpa_id}{IMAGE}[$i]} }, $i;310 push @{ $processing_request{$fpa_id}{$query{$fpa_id}{IMAGE}[$i]} }, $i; 307 311 } 308 312 } … … 384 388 my ($r_ra,$r_dec,$trash,$r_x,$r_y,$r_chip) = split /\s+/, $line; 385 389 print $targetfile "$r_x $r_y\n"; 386 if (( $r_ra == $query{$fpa_id}{RA1_DEG}[$processing_request{$fpa_id}{$image}[$i]])&&387 ( $r_dec == $query{$fpa_id}{DEC1_DEG}[$processing_request{$fpa_id}{$image}[$i]])) {390 if ((abs($r_ra - $query{$fpa_id}{RA1_DEG}[$processing_request{$fpa_id}{$image}[$i]]) < 1e-8)&& 391 (abs($r_dec - $query{$fpa_id}{DEC1_DEG}[$processing_request{$fpa_id}{$image}[$i]]) < 1e-8)) { 388 392 $query{$fpa_id}{X_PXL}[$processing_request{$fpa_id}{$image}[$i]] = $r_x; 389 393 $query{$fpa_id}{Y_PXL}[$processing_request{$fpa_id}{$image}[$i]] = $r_y; … … 392 396 else { 393 397 $error_code = $PS_EXIT_PROG_ERROR; 394 my_die("Unable to match input RA/DEC with output RA/DEC: ($query{$fpa_id}{RA1_DEG}[$i],$query{$fpa_id}{DEC1_DEG}[$i]) -> ($r_ra,$r_dec) i.$error_code",398 my_die("Unable to match input RA/DEC with output RA/DEC: ($query{$fpa_id}{RA1_DEG}[$i],$query{$fpa_id}{DEC1_DEG}[$i]) -> ($r_ra,$r_dec) $error_code", 395 399 $query{$fpa_id}{QUERY_ID}[$index],$fpa_id,$query{$fpa_id}{'MJD-OBS'}[$index], 396 400 $query{$fpa_id}{FILTER}[$index],$query{$fpa_id}{OBSCODE}[$index],$query{$fpa_id}{STAGE}[$index],
Note:
See TracChangeset
for help on using the changeset viewer.
