File: duplicate_space_groups

package info (click to toggle)
cod-tools 3.11.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 159,136 kB
  • sloc: perl: 58,707; sh: 41,323; ansic: 7,268; xml: 1,982; yacc: 1,117; makefile: 731; python: 166
file content (42 lines) | stat: -rwxr-xr-x 1,476 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#!perl -w # --*- Perl -*--
eval 'exec perl -x $0 ${1+"$@"}'
    if 0;
#------------------------------------------------------------------------------
#$Author: antanas $
#$Date: 2021-07-30 20:10:23 +0300 (Fri, 30 Jul 2021) $
#$Revision: 8841 $
#$URL: svn+ssh://www.crystallography.net/home/coder/svn-repositories/cod-tools/tags/v3.11.0/tools/duplicate_space_groups $
#------------------------------------------------------------------------------
#*
# Find and print out duplicated space group definitions in COD::Spacegroups::Lookup::COD.
#**

use strict;
use warnings;
use COD::Spacegroups::Lookup::COD;
use COD::Spacegroups::Lookup qw( make_symop_hash make_symop_key );

# Identify the spacegroup from the symmetry operators:

my %symop_lookup_table = make_symop_hash( [
    \@COD::Spacegroups::Lookup::COD::table,
    \@COD::Spacegroups::Lookup::COD::extra_settings
] );

for my $sg ( @COD::Spacegroups::Lookup::COD::table,
             @COD::Spacegroups::Lookup::COD::extra_settings ) {
    my @symops = @{$sg->{symops}};
    my $key = make_symop_key( \@symops );

    if( exists $symop_lookup_table{$key} ) {
        my $estimated_sg = $symop_lookup_table{$key};
        if( $sg->{universal_h_m} ne $estimated_sg->{universal_h_m} ) {
            printf "%-20s\t%s\n",
                $sg->{universal_h_m},
                $estimated_sg->{universal_h_m};
        }
    } else {
        print STDERR "$0:: WARNING, space group could not be identified\n"
    }
}