Changeset 9524 for trunk/ippScripts/scripts/phase3.pl
- Timestamp:
- Oct 12, 2006, 2:00:09 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/phase3.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/phase3.pl
r9446 r9524 59 59 { 60 60 my @backgrounds; # Array of backgrounds in each component 61 my @ stdevs; # Array of standard deviations ineach component61 my @variances; # Array of variances for each component 62 62 # my @ra; # Array of ra errors 63 63 # my @dec; # Array of dec errors … … 72 72 # die "Unable to find zp for class_id=$class_id\n" unless defined $file->{zp}; 73 73 push @backgrounds, $file->{bg}; 74 push @ stdevs, $file->{bg_mean_stdev};74 push @variances, $file->{bg_stdev}**2; 75 75 } 76 76 … … 79 79 $stats->add_data(@backgrounds); 80 80 $bg = $stats->mean(); 81 if (scalar @backgrounds == 1) { 82 $bg_stdev = 0.0; 83 } else { 84 $bg_stdev = $stats->standard_deviation(); 85 } 81 $bg_mean_stdev = $stats->standard_deviation() || 0.0; 86 82 } 87 83 { 88 84 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 89 $stats->add_data(@ stdevs);90 $bg_ mean_stdev = $stats->mean();85 $stats->add_data(@variances); 86 $bg_stdev = sqrt( $stats->mean() ); 91 87 } 92 88 }
Note:
See TracChangeset
for help on using the changeset viewer.
