aboutsummaryrefslogtreecommitdiff
path: root/scripts/check-peak-detection
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-15 10:41:35 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:20 +0100
commitbe49b97c792edc33d908965823f73f33b830d557 (patch)
tree50a3a1eea924b6347e92ec46c6d67f2ba1c22787 /scripts/check-peak-detection
parent0f1a16a196ffed32eab9ede885de6d73928c718f (diff)
More work on new stream format
Diffstat (limited to 'scripts/check-peak-detection')
-rwxr-xr-xscripts/check-peak-detection54
1 files changed, 54 insertions, 0 deletions
diff --git a/scripts/check-peak-detection b/scripts/check-peak-detection
new file mode 100755
index 00000000..16fe53d3
--- /dev/null
+++ b/scripts/check-peak-detection
@@ -0,0 +1,54 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Basename;
+
+open(FH, $ARGV[0]);
+open(TMP, "> list.tmp");
+
+my $in_image = 0;
+my $line;
+my $filename;
+while ( $line = <FH> ) {
+
+ chomp $line;
+ my $handled = 0;
+
+ if ( $in_image ) {
+ printf(TMP "%s\n", $line);
+ $handled = 1;
+ }
+
+ if ( $line =~ /^Peaks\ from\ peak\ search$/ ) {
+ $in_image = 1;
+ $handled = 1;
+ }
+
+ if ( $line =~ /^Image\ filename:\ (.+)$/ ) {
+ $filename = $1;
+ $handled = 1;
+ }
+
+ if ( $line =~ /^End\ of\ peak\ list$/ ) {
+
+ close(TMP);
+
+ # Example of how to do "basename" and "prefix":
+ # $filename = "images-old/".basename($filename);
+
+ printf(STDERR "Viewing %s\n", $filename);
+ system("hdfsee ".$filename.
+ " --peak-overlay=list.tmp --binning=2 --int-boost=10");
+ if ( $? != 0 ) { exit; }
+ unlink("list.tmp");
+ open(TMP, "> list.tmp");
+ $handled = 1;
+ $in_image = 0;
+
+ }
+
+ if ( !$handled ) {
+ printf(STDERR "Unhandled: '%s'\n", $line);
+ }
+
+}