diff options
author | Thomas White <taw@physics.org> | 2015-04-01 09:24:44 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-04-01 09:29:46 +0200 |
commit | b3936c6862df85d0e3a7909d9370c5c9f7b81701 (patch) | |
tree | 51ee0a17675643f9e50ed1ca97d77d3ceea3d7ad /scripts/check-near-bragg | |
parent | b2c5b05c7e8da5a20610c7a7b098a76c9ad9c4e0 (diff) |
check-{peak-detection,near-bragg}: add ability to skip events
Diffstat (limited to 'scripts/check-near-bragg')
-rwxr-xr-x | scripts/check-near-bragg | 20 |
1 files changed, 16 insertions, 4 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; |