aboutsummaryrefslogtreecommitdiff
path: root/scripts/check-near-bragg
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/check-near-bragg')
-rwxr-xr-xscripts/check-near-bragg107
1 files changed, 0 insertions, 107 deletions
diff --git a/scripts/check-near-bragg b/scripts/check-near-bragg
deleted file mode 100755
index 2130378b..00000000
--- a/scripts/check-near-bragg
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use File::Basename;
-use File::stat;
-
-my $skip = 0;
-
-my $args = join(" ", splice(@ARGV, 1, scalar(@ARGV)-1));
-if ( !($args eq "") ) {
- printf("Extra arguments for hdfsee: %s\n", $args);
-} else {
- # Default arguments - feel free to override!
- $args = "--binning=2 --int-boost=10";
- printf("Using default arguments for hdfsee: %s\n", $args);
-}
-
-my $file = $ARGV[0];
-
-open(FH, $file);
-open(TMP, "> list.tmp");
-
-my $statbuf = stat($file);
-if ( not $statbuf ) {
- printf("Couldn't stat stream. Check the filename.\n");
- exit;
-}
-my $stream_mtime = $statbuf->mtime;
-
-my $in_image = 0;
-my $line;
-my $filename;
-my $event = "";
-my $n_seen = 0;
-
-while ( $line = <FH> ) {
-
- chomp $line;
- my $handled = 0;
-
- if ( $in_image ) {
- printf(TMP "%s\n", $line);
- $handled = 1;
- }
-
- if ( $line =~ /^Reflections\ measured\ after\ indexing$/ ) {
- $in_image = 1;
- $handled = 1;
- }
-
- if ( $line =~ /^Image\ filename:\ (.+)$/ ) {
- $filename = $1;
- $handled = 1;
- }
-
- if ( $line =~ /^Event:\ (.+)$/ ) {
- $event = $1;
- }
-
- if ( $line =~ /^End\ of\ reflections$/ ) {
-
- close(TMP);
-
- # Example of how to do "basename" and "prefix":
- # $filename = "images-old/".basename($filename);
-
- my $ev;
- my $evr;
- if ( $event eq "" ) {
- $ev = "";
- $evr = "";
- } else {
- $ev = " --event=".$event;
- $evr = ", event ".$event;
- }
-
- $n_seen++;
- if ( $n_seen > $skip ) {
-
- my $statbuf = stat($filename);
- if ( not $statbuf ) {
- printf("Couldn't stat image file '%s' - does it exist?\n",
- $filename);
- exit;
- }
- 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);
- if ( $? != 0 ) { exit; }
- } else {
- printf(STDERR "Skipping %s%s\n", $filename, $evr);
- }
-
- unlink("list.tmp");
- open(TMP, "> list.tmp");
- $handled = 1;
- $in_image = 0;
- $event = "";
-
- }
-
-}