aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-22 16:08:33 +0200
committerThomas White <taw@physics.org>2020-09-22 16:08:33 +0200
commit552e2cd29a802d288d74da5be286095d7f548665 (patch)
tree3357fc08415b78d7dbf0f6e8f44c4cc86d1b7fbe
parent188a08b4a11a78b399f34fe71073b5d69f043c8c (diff)
Remove old scripts
-rwxr-xr-xscripts/check-near-bragg107
-rwxr-xr-xscripts/check-peak-detection153
-rwxr-xr-xscripts/random-image14
-rwxr-xr-xscripts/sequence-image8
4 files changed, 0 insertions, 282 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 = "";
-
- }
-
-}
diff --git a/scripts/check-peak-detection b/scripts/check-peak-detection
deleted file mode 100755
index 91d21f63..00000000
--- a/scripts/check-peak-detection
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use File::Basename;
-use File::stat;
-
-my $skip = 0;
-
-my $only;
-my $file;
-my $start;
-
-# Horrible option processing
-if ( $ARGV[0] eq "--indexed" ) {
- $only = "indexed";
- $file = $ARGV[1];
- $start = 2;
-} elsif ( $ARGV[0] eq "--not-indexed" ) {
- $only = "notindexed";
- $file = $ARGV[1];
- $start = 2;
-} else {
- $only = "";
- $file = $ARGV[0];
- $start = 1;
-}
-my $args = join(" ", splice(@ARGV, $start, 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);
-}
-
-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 $indexed;
-my $n_seen = 0;
-
-while ( $line = <FH> ) {
-
- chomp $line;
-
- if ( $in_image ) {
- printf(TMP "%s\n", $line);
- }
-
- if ( $line =~ /^Peaks\ from\ peak\ search$/ ) {
- $in_image = 1;
- }
-
- if ( $line =~ /^Image\ filename:\ (.+)$/ ) {
- $filename = $1;
- }
-
- if ( $line =~ /^Event:\ (.+)$/ ) {
- $event = $1;
- }
-
- if ( $line =~ /^indexed_by\ =\ (.*)$/ ) {
- if ( $1 eq "none" ) {
- $indexed = 0;
- } else {
- $indexed = 1;
- }
- }
-
- if ( $line =~ /^End\ of\ peak\ list$/ ) {
-
- close(TMP);
-
- my $show;
-
- if ( $only eq "indexed" ) {
- if ( $indexed ) {
- $show = 1;
- } else {
- $show = 0;
- }
- } elsif ( $only eq "notindexed" ) {
- if ( $indexed ) {
- $show = 0;
- } else {
- $show = 1;
- }
- } else {
- $show = 1;
- }
-
- if ( !$show ) {
- printf(STDERR "Not showing %s\n", $filename);
- unlink("list.tmp");
- open(TMP, "> list.tmp");
- $in_image = 0;
- next;
- }
-
- # 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");
- $in_image = 0;
- $event = "";
-
- }
-
-}
diff --git a/scripts/random-image b/scripts/random-image
deleted file mode 100755
index cabd1e73..00000000
--- a/scripts/random-image
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-FILE=$1
-TEMPFILE=`mktemp $1.XXXXXX`
-
-trap "rm -f $TEMPFILE" EXIT
-sort -R $FILE > $TEMPFILE
-
-for FILENAME in `cat $TEMPFILE`; do
-
- echo $FILENAME
- hdfsee --int-boost=10 ${2}${FILENAME}
-
-done
diff --git a/scripts/sequence-image b/scripts/sequence-image
deleted file mode 100755
index 196cdc7e..00000000
--- a/scripts/sequence-image
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-for FILENAME in `cat $1`; do
-
- ~/crystfel/src/hdfsee $2$FILENAME --binning=4 \
- --int-boost=20 --filter-noise
-
-done