aboutsummaryrefslogtreecommitdiff
path: root/scripts/check-peak-detection
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-05-31 15:11:45 +0200
committerThomas White <taw@physics.org>2018-05-31 15:11:45 +0200
commit837809edc9461e01e12c980080cb2c4869997ccd (patch)
tree70eb7606e2e863ee9fec73257e4fc699302aa002 /scripts/check-peak-detection
parent7c662b10bc700b28f9c759cf5d445d118f34dcb3 (diff)
check_{peak_detection,near_bragg}: Warn if stream is older than image
Diffstat (limited to 'scripts/check-peak-detection')
-rwxr-xr-xscripts/check-peak-detection10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/check-peak-detection b/scripts/check-peak-detection
index c66424f2..8f2e1378 100755
--- a/scripts/check-peak-detection
+++ b/scripts/check-peak-detection
@@ -2,6 +2,7 @@
use strict;
use File::Basename;
+use File::stat;
my $skip = 0;
@@ -35,6 +36,9 @@ if ( !($args eq "") ) {
open(FH, $file);
open(TMP, "> list.tmp");
+my $statbuf = stat($ARGV[0]);
+my $stream_mtime = $statbuf->mtime;
+
my $in_image = 0;
my $line;
my $filename;
@@ -116,6 +120,12 @@ while ( $line = <FH> ) {
$n_seen++;
if ( $n_seen > $skip ) {
+ my $statbuf = stat($filename);
+ my $image_mtime = $statbuf->mtime;
+ if ( $image_mtime > $stream_mtime ) {
+ printf(STDERR "WARNING: Image file is newer than stream\n");
+ }
+
printf(STDERR "Viewing %s%s\n", $filename, $evr);
system("hdfsee ".$filename.$ev.
" --peak-overlay=list.tmp ".$args);