aboutsummaryrefslogtreecommitdiff
path: root/scripts/check-near-bragg
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-09-08 17:02:25 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:57 +0100
commit9d4ba2898d27adf7e976e866dba7df76cc8e5d2e (patch)
treeba3d656e74ccbbc86ac189b0d63665a7f5f7cb4e /scripts/check-near-bragg
parent5c98edbec82f8f5a301bdced5d7531f09711766c (diff)
Add scripts/check-near-bragg
Diffstat (limited to 'scripts/check-near-bragg')
-rwxr-xr-xscripts/check-near-bragg38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/check-near-bragg b/scripts/check-near-bragg
new file mode 100755
index 00000000..9b72c0cb
--- /dev/null
+++ b/scripts/check-near-bragg
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+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 ( $line =~ /^\s*[0-9\-]+\s+[0-9\-]+\s+[0-9\-]+\s+[0-9\.\-]+/ ) {
+ printf(TMP "%s\n", $line);
+ $handled = 1;
+ }
+
+ if ( $line =~ /^Reflections\ from\ indexing\ in\ (.+)$/ ) {
+ $filename = $1;
+ $handled = 1;
+ }
+
+ if ( $line =~ /^Peak statistics/ ) {
+ close(TMP);
+ system("hdfsee ".$filename." --peak-overlay=list.tmp --binning=1 --int-boost=10");
+ unlink("list.tmp");
+ open(TMP, "> list.tmp");
+ $handled = 1;
+ }
+
+ if ( !$handled ) {
+ printf(STDERR "Unhandled: '%s'\n", $line);
+ }
+
+}