aboutsummaryrefslogtreecommitdiff
path: root/scripts/mtz2hkl
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-03-03 17:03:28 +0100
committerThomas White <taw@physics.org>2014-03-03 17:03:28 +0100
commit29f05a21f0782201751e8ad5ff78b42836979f73 (patch)
tree4938eacad8ac99ae1cce51f85720da8fb9934bdd /scripts/mtz2hkl
parentbe6df1aaf9df81f836118e426aae5d0f699bd493 (diff)
Update scripts for new reflection list format
Diffstat (limited to 'scripts/mtz2hkl')
-rwxr-xr-xscripts/mtz2hkl33
1 files changed, 31 insertions, 2 deletions
diff --git a/scripts/mtz2hkl b/scripts/mtz2hkl
index 507f75c8..56a5fce1 100755
--- a/scripts/mtz2hkl
+++ b/scripts/mtz2hkl
@@ -1,8 +1,37 @@
#!/bin/sh
-mtz2various hklin $1 hklout $2 <<EOF
+mtz2various hklin $1 hklout $2.temp <<EOF
LABIN H=H K=K L=L I=IMEAN SIGI=SIGIMEAN
OUTPUT USER '(3I4,2F15.1)'
EOF
-echo "Now use hkl2hkl (without modification) to convert $2 to a CrystFEL file"
+perl < $2.temp > $2 << WIBBLE
+use strict;
+
+my \$line;
+open(FILE, "$2.temp");
+
+printf(" h k l I phase sigma(I) nmeas\n");
+
+while ( \$line = <FILE> ) {
+
+ if ( \$line =~ /^\s*([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\s+([\d\-\.]+)\s+([\d\-\.]+)/ ) {
+
+ my \$h = \$1;
+ my \$k = \$2;
+ my \$l = \$3;
+ my \$intensity = \$4;
+ my \$sigi = \$5;
+
+ printf("%4i %4i %4i %10.2f %s %10.2f %7i\n",
+ \$h, \$k, \$l, \$intensity, " -", \$sigi, 1);
+
+ } else {
+ printf(STDERR "Couldn't understand line '%s'\n", \$line);
+ }
+
+}
+close(FILE);
+printf("End of reflections\n");
+WIBBLE
+exit