IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29051


Ignore:
Timestamp:
Aug 25, 2010, 1:07:08 PM (16 years ago)
Author:
watersc1
Message:

backport of update bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20100823/pstamp/scripts/detectability_respond.pl

    r28902 r29051  
    9898            my $key = shift(@key_values);
    9999            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            }
    100104            $query{$fpa_id}{$key}[$i] = $val;
    101105        }
     
    148152        # Determine the query style for this fpa_id
    149153        if ($fpa_id =~ /o.*g.*o/) {
    150         $query_style = 'byexp';
    151     }
     154            $query_style = 'byexp';
     155        }
    152156        elsif ($fpa_id =~ /\d+/) {
    153         $query_style = 'byid';
    154     }
     157            $query_style = 'byid';
     158        }
    155159        else {
    156         exit_with_failure(21,"Parse error in request file");
    157     }
     160            exit_with_failure(21,"Parse error in request file");
     161        }
    158162        # Confirm that we only have one stage/filter/mjd
    159163        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        }
    164168        if (scalar(keys(%{ $temp_hash{STAGE} })) == 1) {
    165169            $stage = (keys(%{ $temp_hash{STAGE} }))[0];
    166170        }
    167171        else {
    168         exit_with_failure(21,"Too many STAGEs specified");
    169     }
     172            exit_with_failure(21,"Too many STAGEs specified");
     173        }
    170174        if (scalar(keys(%{ $temp_hash{FILTER} })) == 1) {
    171         $filter = (keys(%{ $temp_hash{FILTER} }))[0];
    172     }
     175            $filter = (keys(%{ $temp_hash{FILTER} }))[0];
     176        }
    173177        else {
    174         exit_with_failure(21,"Too many FILTERs specified");
    175     }
     178            exit_with_failure(21,"Too many FILTERs specified");
     179        }
    176180        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        }
    179183        else {
    180         exit_with_failure(21,"Too many MJD-OBS specified");
    181     }
     184            exit_with_failure(21,"Too many MJD-OBS specified");
     185        }
    182186        # Set common request components
    183187        my $option_mask |= 1;
     
    231235                    }
    232236                    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                    }
    235239                    if (exists($this_image_ref->{class_id})) {
    236240                        $query{$fpa_id}{COMPONENT_ID}[$valid_index] = $this_image_ref->{class_id};
     
    304308            ($query{$fpa_id}{STATE}[$i],$query{$fpa_id}{STAGE}[$i],$query{$fpa_id}{STAGE_ID}[$i],
    305309             $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;
    307311    }
    308312}
     
    384388            my ($r_ra,$r_dec,$trash,$r_x,$r_y,$r_chip) = split /\s+/, $line;
    385389            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)) {
    388392                $query{$fpa_id}{X_PXL}[$processing_request{$fpa_id}{$image}[$i]] = $r_x;
    389393                $query{$fpa_id}{Y_PXL}[$processing_request{$fpa_id}{$image}[$i]] = $r_y;
     
    392396            else {
    393397                $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",
    395399                   $query{$fpa_id}{QUERY_ID}[$index],$fpa_id,$query{$fpa_id}{'MJD-OBS'}[$index],
    396400                   $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.