#!/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\-]+)\s+([\d\.\-]+)\s+([\d\.\-]+)\s+([\d\.\-]+)/ ) {

                my $h = $1;
                my $k = $2;
                my $l = $3;
                my $intensity = $4;
                my $phase = $5;
                my $sigi = $6;

                printf("%4i %4i %4i %10.2f %s %10.2f %7i\n",
                       $h, $k, $l, $intensity, "       -", $sigi,
                       1, 0.0, 0.0);

        }

}

printf("End of reflections\n");
