aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-12-13 22:10:30 -0800
committerThomas White <taw@physics.org>2014-12-13 22:12:12 -0800
commit4f80ff8f01695276cc0d4cb628034f1b50d8e2d4 (patch)
tree048379daaf534acdd4da4cc752811741d0511e60 /scripts
parent3e8509622ee6ed0c54264a34b6c52116736013b1 (diff)
Update check-near-bragg and cheak-peak-detection for multi-event files
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-near-bragg16
-rwxr-xr-xscripts/check-peak-detection19
2 files changed, 30 insertions, 5 deletions
diff --git a/scripts/check-near-bragg b/scripts/check-near-bragg
index 27a1d61c..c92803fa 100755
--- a/scripts/check-near-bragg
+++ b/scripts/check-near-bragg
@@ -18,6 +18,7 @@ open(TMP, "> list.tmp");
my $in_image = 0;
my $line;
my $filename;
+my $event = "";
while ( $line = <FH> ) {
chomp $line;
@@ -45,14 +46,23 @@ while ( $line = <FH> ) {
# 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 ".$args);
+ my $ev;
+ my $evr;
+ if ( $event eq "" ) {
+ $ev = "";
+ $evr = "";
+ } else {
+ $ev = " --event=".$event;
+ $evr = ", event ".$event;
+ }
+ printf(STDERR "Viewing %s%s\n", $filename, $evr);
+ system("hdfsee ".$filename.$ev.
if ( $? != 0 ) { exit; }
unlink("list.tmp");
open(TMP, "> list.tmp");
$handled = 1;
$in_image = 0;
+ $event = "";
}
diff --git a/scripts/check-peak-detection b/scripts/check-peak-detection
index 002aaeca..537e1698 100755
--- a/scripts/check-peak-detection
+++ b/scripts/check-peak-detection
@@ -36,6 +36,7 @@ open(TMP, "> list.tmp");
my $in_image = 0;
my $line;
my $filename;
+my $event;
my $indexed;
while ( $line = <FH> ) {
@@ -53,6 +54,10 @@ while ( $line = <FH> ) {
$filename = $1;
}
+ if ( $line =~ /^Event:\ (.+)$/ ) {
+ $event = $1;
+ }
+
if ( $line =~ /^indexed_by\ =\ (.*)$/ ) {
if ( $1 eq "none" ) {
$indexed = 0;
@@ -94,13 +99,23 @@ while ( $line = <FH> ) {
# Example of how to do "basename" and "prefix":
# $filename = "images-old/".basename($filename);
- printf(STDERR "Viewing %s\n", $filename);
- system("hdfsee ".$filename.
+ my $ev;
+ my $evr;
+ if ( $event eq "" ) {
+ $ev = "";
+ $evr = "";
+ } else {
+ $ev = " --event=".$event;
+ $evr = ", event ".$event;
+ }
+ printf(STDERR "Viewing %s%s\n", $filename, $evr);
+ system("hdfsee ".$filename.$ev.
" --peak-overlay=list.tmp ".$args);
if ( $? != 0 ) { exit; }
unlink("list.tmp");
open(TMP, "> list.tmp");
$in_image = 0;
+ $event = "";
}