IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31216


Ignore:
Timestamp:
Apr 6, 2011, 5:25:55 PM (15 years ago)
Author:
watersc1
Message:

previous edits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20110406/pstamp/scripts/detectability_respond.pl

    r29616 r31216  
    5555
    5656pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    57 pod2usage( -msg => "Required options: --input --output --dbname",
     57pod2usage( -msg => "Required options: --input --output --dbname --workdir",
    5858           -exitval => 3,
    5959    ) unless
     
    9191    print "Reading wisdom file $wisdom_file instead of parsing...\n";
    9292    open(WISDOM,"$wisdom_file") or my_die("failed to open wisdom file $wisdom_file");
     93    my $terminator = $/;
     94    undef $/;
     95    my $wisdom = <WISDOM>;
     96    $/ = $terminator;
     97   
     98    # @query_list = parse_md_list( parse($wisdom));
    9399    while(<WISDOM>) {
    94100        chomp;
     
    133139                @row_data{@column_names} = (split /\s+/, $entry);
    134140                for (my $i = 0; $i <= $#column_names; $i++) {
    135                 push @{ $query{$row_data{"FPA_ID"}}{$column_names[$i]} }, $row_data{$column_names[$i]};
    136                 $Nrows = scalar(keys(%query));
     141                    push @{ $query{$row_data{"FPA_ID"}}{$column_names[$i]} }, $row_data{$column_names[$i]};
     142                    $Nrows = scalar(keys(%query));
    137143#               print "$row_data{'FPA_ID'} $Nrows $i $column_names[$i] $row_data{$column_names[$i]}\n";
    138             }
     144                }
    139145            }
    140146        }
     
    233239        # Call the PStamp code to find the images that contain the target on the given MJD in the specified filter.
    234240        my $pstamp_images_ref = locate_images($ipprc,$imagedb,
    235                                           \@rowList,
    236                                           $query_style,$stage,
    237                                           $fpa_id,undef,undef,
    238                                           $option_mask,$need_magic,
    239                                           # $ra,$dec,
    240                                           $mjd_min,$mjd_max,$filter . ".00000",undef,$verbose); 
     241                                              \@rowList,
     242                                              $query_style,$stage,
     243                                              $fpa_id,undef,undef,
     244                                              $option_mask,$need_magic,
     245                                              # $ra,$dec,
     246                                              $mjd_min,$mjd_max,$filter . ".00000",undef,$verbose); 
    241247       
    242248        foreach my $this_image_ref (@{ $pstamp_images_ref }) {
     
    325331
    326332open(WISDOM,">$wisdom_file") or my_die("failed to open wisdom file $wisdom_file");
    327 foreach my $fpa_id (keys %query) {
     333print WISDOM "DETECTABILITY_WISDOM MULTI\n\n";
     334foreach my $fpa_id (sort {$query{$a}{ROWNUM} <=> $query{$a}{ROWNUM} } (keys %query)) {
    328335    for (my $i = 0; $i <= $#{ $query{$fpa_id}{ROWNUM} }; $i++) {
    329         print WISDOM "$fpa_id\t";
     336        print WISDOM "DETECTABILITY_WISDOM METADATA\n";
     337        printf(WISDOM "   %15s  %3s       %s\n","FPA_ID","STR",$fpa_id);
    330338        foreach my $key (keys %{ $query{$fpa_id} }) {
    331             print WISDOM "$key $query{$fpa_id}{$key}[$i]\t";
    332         }
    333         print WISDOM "\n";
     339        printf(WISDOM "   %15s  %3s       %s\n",$key,"STR",$query{$fpa_id}{$key}[$i]);
     340        }
     341        print WISDOM "END\n\n";
    334342        if ($query{$fpa_id}{BAD_COMPONENT}[$i] == 0) {
    335343            @{ $update_request{$query{$fpa_id}{IMAGE}[$i]}{$query{$fpa_id}{FAULT}[$i]} } =
Note: See TracChangeset for help on using the changeset viewer.