aboutsummaryrefslogtreecommitdiff
path: root/scripts
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
parent7c662b10bc700b28f9c759cf5d445d118f34dcb3 (diff)
check_{peak_detection,near_bragg}: Warn if stream is older than image
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-near-bragg10
-rwxr-xr-xscripts/check-peak-detection10
2 files changed, 20 insertions, 0 deletions
diff --git a/scripts/check-near-bragg b/scripts/check-near-bragg
index a651d896..467ff943 100755
--- a/scripts/check-near-bragg
+++ b/scripts/check-near-bragg
@@ -2,6 +2,7 @@
use strict;
use File::Basename;
+use File::stat;
my $skip = 0;
@@ -17,6 +18,9 @@ if ( !($args eq "") ) {
open(FH, $ARGV[0]);
open(TMP, "> list.tmp");
+my $statbuf = stat($ARGV[0]);
+my $stream_mtime = $statbuf->mtime;
+
my $in_image = 0;
my $line;
my $filename;
@@ -67,6 +71,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);
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);