From 800a1cbe01bfb370ee2707317e57082e4c8b484d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 8 Feb 2013 17:11:44 -0800 Subject: scripts/peak-intensity: Count saturation --- scripts/peak-intensity | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/peak-intensity b/scripts/peak-intensity index 46f5be9e..13bed699 100755 --- a/scripts/peak-intensity +++ b/scripts/peak-intensity @@ -8,6 +8,9 @@ my $line; my $total_i; my $n = 0; my $n_patt = 0; +my $num_peaks_tot = 0; +my $num_sat_peaks_tot = 0; +my $num_pats_with_sat = 0; while ( $line = ) { @@ -27,9 +30,21 @@ while ( $line = ) { } + if ( $line =~ /^num_saturated_peaks\s=\s(\d+)$/ ) { + $num_sat_peaks_tot += $1; + if ( $1 > 0 ) { + $num_pats_with_sat++; + } + } + } printf("%i patterns, %i peaks, %.2f total ADU\n", $n_patt, $n, $total_i); printf("Mean %i peaks per hit\n", $n / $n_patt); printf("Mean %.2f ADU per peak\n", $total_i / $n); printf("Mean %.2f ADU per hit\n", $total_i / $n_patt); +printf("%i out of %i patterns contained any saturation\n", $num_pats_with_sat, $n_patt); +if ( $num_pats_with_sat > 0 ) { + printf(" of those, there was an average of %.2f saturated peaks per pattern\n", + $num_sat_peaks_tot/$num_pats_with_sat); +} -- cgit v1.2.3