diff options
author | Thomas White <taw@physics.org> | 2012-10-29 07:06:41 -0700 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-10-29 07:06:41 -0700 |
commit | 269badfbb6be0a144b9a1662daca3db9f379502e (patch) | |
tree | 05db4adfcbd137ab3cdc7ab0bc697cc9e1e2ef6f | |
parent | 4b98715b34e62f2d65fd66179703fc845d56fbea (diff) |
Add new script: scripts/peak-intensity
-rwxr-xr-x | scripts/peak-intensity | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/peak-intensity b/scripts/peak-intensity new file mode 100755 index 00000000..46f5be9e --- /dev/null +++ b/scripts/peak-intensity @@ -0,0 +1,35 @@ +#!/usr/bin/perl -w + +use strict; + +open(FH, $ARGV[0]); + +my $line; +my $total_i; +my $n = 0; +my $n_patt = 0; + +while ( $line = <FH> ) { + + if ( $line =~ /^-----\ Begin chunk\ -----$/ ) { + $n_patt++; + } + + if ( $line =~ /^\s*([\d\.]+)\s+([\d\.]+)\s+([\d\.]+)\s+([\d\.]+)$/ ) { + + my $fs = $1; + my $ss = $2; + my $one_over_d = $3; + my $i = $4; + + $total_i += $i; + $n++; + + } + +} + +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); |