aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-04-01 09:24:44 +0200
committerThomas White <taw@physics.org>2015-04-01 09:29:46 +0200
commitb3936c6862df85d0e3a7909d9370c5c9f7b81701 (patch)
tree51ee0a17675643f9e50ed1ca97d77d3ceea3d7ad /scripts
parentb2c5b05c7e8da5a20610c7a7b098a76c9ad9c4e0 (diff)
check-{peak-detection,near-bragg}: add ability to skip events
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-near-bragg20
-rwxr-xr-xscripts/check-peak-detection20
2 files changed, 32 insertions, 8 deletions
diff --git a/scripts/check-near-bragg b/scripts/check-near-bragg
index 4077c6e2..a651d896 100755
--- a/scripts/check-near-bragg
+++ b/scripts/check-near-bragg
@@ -3,6 +3,8 @@
use strict;
use File::Basename;
+my $skip = 0;
+
my $args = join(" ", splice(@ARGV, 1, scalar(@ARGV)-1));
if ( !($args eq "") ) {
printf("Extra arguments for hdfsee: %s\n", $args);
@@ -19,6 +21,8 @@ my $in_image = 0;
my $line;
my $filename;
my $event = "";
+my $n_seen = 0;
+
while ( $line = <FH> ) {
chomp $line;
@@ -59,10 +63,18 @@ while ( $line = <FH> ) {
$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; }
+
+ $n_seen++;
+ if ( $n_seen > $skip ) {
+
+ printf(STDERR "Viewing %s%s\n", $filename, $evr);
+ system("hdfsee ".$filename.$ev.
+ " --peak-overlay=list.tmp ".$args);
+ if ( $? != 0 ) { exit; }
+ } else {
+ printf(STDERR "Skipping %s%s\n", $filename, $evr);
+ }
+
unlink("list.tmp");
open(TMP, "> list.tmp");
$handled = 1;
diff --git a/scripts/check-peak-detection b/scripts/check-peak-detection
index 537e1698..9b3e3d6f 100755
--- a/scripts/check-peak-detection
+++ b/scripts/check-peak-detection
@@ -3,6 +3,8 @@
use strict;
use File::Basename;
+my $skip = 0;
+
my $only;
my $file;
my $start;
@@ -38,6 +40,8 @@ my $line;
my $filename;
my $event;
my $indexed;
+my $n_seen = 0;
+
while ( $line = <FH> ) {
chomp $line;
@@ -108,10 +112,18 @@ while ( $line = <FH> ) {
$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; }
+
+ $n_seen++;
+ if ( $n_seen > $skip ) {
+
+ printf(STDERR "Viewing %s%s\n", $filename, $evr);
+ system("hdfsee ".$filename.$ev.
+ " --peak-overlay=list.tmp ".$args);
+ if ( $? != 0 ) { exit; }
+ } else {
+ printf(STDERR "Skipping %s%s\n", $filename, $evr);
+ }
+
unlink("list.tmp");
open(TMP, "> list.tmp");
$in_image = 0;