aboutsummaryrefslogtreecommitdiff
path: root/scripts/stream-split
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-04-19 10:46:37 +0200
committerThomas White <taw@physics.org>2010-04-19 10:46:37 +0200
commit319dbad7371d833061002ed44d1be5fc81a4df95 (patch)
tree5f3a9c1dc1fe2ac28bee520fc6b1e725b857ba62 /scripts/stream-split
parentca7215bc0355d78d6a5f3ff4fcb629c614f5b201 (diff)
Add scripts/stream-split for separating peaks from indexing
Diffstat (limited to 'scripts/stream-split')
-rwxr-xr-xscripts/stream-split30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/stream-split b/scripts/stream-split
new file mode 100755
index 00000000..739b341b
--- /dev/null
+++ b/scripts/stream-split
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+open(FH, $ARGV[0]);
+open(OFH_IND, "> ".$ARGV[1]);
+open(OFH_PEAKS, "> ".$ARGV[2]);
+
+my $line;
+my $mode = 0;
+
+while ( $line = <FH> ) {
+
+ if ( $line =~ /^Reflections\ from\ indexing/ ) {
+ $mode = 1;
+ }
+
+ if ( $line =~ /^Peaks\ from\ peak\ search/ ) {
+ $mode = 2;
+ }
+
+ if ( $mode == 1 ) {
+ printf(OFH_IND $line);
+ } elsif ( $mode == 2 ) {
+ printf(OFH_PEAKS $line);
+ } else {
+ printf($line);
+ }
+
+}