aboutsummaryrefslogtreecommitdiff
path: root/scripts/cif2hkl
blob: 04bfabe51d71aa85ade3b7b3f743c8f8b5066759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl -w

use strict;

my $line;

printf("CrystFEL reflection list version 2.0\n");
printf("Symmetry: 1\n");
printf("   h    k    l          I    phase   sigma(I)   nmeas\n");

while ( $line = <STDIN> ) {

        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("%4i %4i %4i %10.2f %s %10.2f %7i\n",
                       $h, $k, $l, $intensity, "       -", $sigi, 1);

        }

}

printf("End of reflections\n");