From 0b262aa61f587b69fd46c95841342886580f4946 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 30 Jul 2012 20:32:55 -0700 Subject: Update *2hkl scripts, add cif2hkl --- Makefile.am | 4 ++-- scripts/cif2hkl | 28 ++++++++++++++++++++++++++++ scripts/hkl2hkl | 13 +++++++++---- scripts/mtz2hkl | 7 ++++--- 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100755 scripts/cif2hkl diff --git a/Makefile.am b/Makefile.am index c923a9c7..8ea4752a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,7 +132,7 @@ script_DATA = scripts/check-near-bragg scripts/random-image \ scripts/alternate-stream scripts/README scripts/cell-please \ scripts/check-hkl-completeness.gp scripts/check-hkl-quality.gp \ scripts/compare-hkl.gp scripts/check-peak-detection \ - scripts/indexed-filenames scripts/gen-sfs + scripts/indexed-filenames scripts/gen-sfs scripts/cif2hkl EXTRA_DIST += scripts/check-near-bragg scripts/random-image \ scripts/wibbletron scripts/create-mtz scripts/mtz2hkl \ @@ -140,7 +140,7 @@ EXTRA_DIST += scripts/check-near-bragg scripts/random-image \ scripts/alternate-stream scripts/README scripts/cell-please \ scripts/check-hkl-completeness.gp scripts/check-hkl-quality.gp \ scripts/compare-hkl.gp scripts/check-peak-detection \ - scripts/indexed-filenames scripts/gen-sfs + scripts/indexed-filenames scripts/gen-sfs scripts/cif2hkl DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc diff --git a/scripts/cif2hkl b/scripts/cif2hkl new file mode 100755 index 00000000..8d82726c --- /dev/null +++ b/scripts/cif2hkl @@ -0,0 +1,28 @@ +#!/usr/bin/perl -w + +use strict; + +my $line; + +printf(" h k l I phase sigma(I) counts" + ." fs/px ss/px\n"); + +while ( $line = ) { + + if ( $line =~ /([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\so\s+[\d\.\-]+\s+[\d\.\-]+\s+([\d\.\-]+)\s+([\d\.\-]+)\s+$/ ) { + + my $h = $1; + my $k = $2; + my $l = $3; + my $intensity = $4; + my $sigi = $5; + + printf("%3i %3i %3i %10.2f %s %10.2f %7i %6.1f %6.1f\n", + $h, $k, $l, $intensity, " -", $sigi, + 1, 0.0, 0.0); + + } + +} + +printf("End of reflections\n"); diff --git a/scripts/hkl2hkl b/scripts/hkl2hkl index 70757d50..a9dfab13 100755 --- a/scripts/hkl2hkl +++ b/scripts/hkl2hkl @@ -4,20 +4,25 @@ use strict; my $line; -printf(" h k l I phase sigma(I) 1/d(nm^-1) counts\n"); +printf(" h k l I phase sigma(I) counts" + ." fs/px ss/px\n"); while ( $line = ) { - if ( $line =~ /^\s*([\d\-]+)\s+([\d\-]+)\s+([\d\-]+)\s+([\d\.\-]+)\s+/ ) { + if ( $line =~ /([\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("%3i %3i %3i %10.2f %s %10.2f %10.2f %7i\n", - $h, $k, $l, $intensity, " -", 0.0, 0.0, 1); + printf("%3i %3i %3i %10.2f %s %10.2f %7i %6.1f %6.1f\n", + $h, $k, $l, $intensity, " -", $sigi, + 1, 0.0, 0.0); } } + +printf("End of reflections\n"); diff --git a/scripts/mtz2hkl b/scripts/mtz2hkl index e0ea1e3a..507f75c8 100755 --- a/scripts/mtz2hkl +++ b/scripts/mtz2hkl @@ -1,7 +1,8 @@ #!/bin/sh mtz2various hklin $1 hklout $2 <