Changeset 31216
- Timestamp:
- Apr 6, 2011, 5:25:55 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20110406/pstamp/scripts/detectability_respond.pl
r29616 r31216 55 55 56 56 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 57 pod2usage( -msg => "Required options: --input --output --dbname ",57 pod2usage( -msg => "Required options: --input --output --dbname --workdir", 58 58 -exitval => 3, 59 59 ) unless … … 91 91 print "Reading wisdom file $wisdom_file instead of parsing...\n"; 92 92 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)); 93 99 while(<WISDOM>) { 94 100 chomp; … … 133 139 @row_data{@column_names} = (split /\s+/, $entry); 134 140 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)); 137 143 # print "$row_data{'FPA_ID'} $Nrows $i $column_names[$i] $row_data{$column_names[$i]}\n"; 138 }144 } 139 145 } 140 146 } … … 233 239 # Call the PStamp code to find the images that contain the target on the given MJD in the specified filter. 234 240 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); 241 247 242 248 foreach my $this_image_ref (@{ $pstamp_images_ref }) { … … 325 331 326 332 open(WISDOM,">$wisdom_file") or my_die("failed to open wisdom file $wisdom_file"); 327 foreach my $fpa_id (keys %query) { 333 print WISDOM "DETECTABILITY_WISDOM MULTI\n\n"; 334 foreach my $fpa_id (sort {$query{$a}{ROWNUM} <=> $query{$a}{ROWNUM} } (keys %query)) { 328 335 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); 330 338 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"; 334 342 if ($query{$fpa_id}{BAD_COMPONENT}[$i] == 0) { 335 343 @{ $update_request{$query{$fpa_id}{IMAGE}[$i]}{$query{$fpa_id}{FAULT}[$i]} } =
Note:
See TracChangeset
for help on using the changeset viewer.
