Changeset 1232 for trunk/import_cif.tcl


Ignore:
Timestamp:
Feb 28, 2013 3:28:14 PM (8 years ago)
Author:
toby
Message:

trunk: clean up spacegroup checking [1230]; cleanup chem. restr & CIF Biso to Uiso conv [1231]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/import_cif.tcl

    r1229 r1232  
    9595    catch {
    9696        set spg [ValueFromCIF block${i} _symmetry_space_group_name_h-m]
    97         set sgtmp [string toupper $spg]
    98         # remove spaces from space group
    99         regsub -all " " $sgtmp "" sgtmp
    100         # check for final H
    101         if {[string range $sgtmp end end] == "H"} {
    102             set sgtmp [string range $sgtmp 0 end-1]
    103         }
    104         # make a copy where we treat bar 3 as the same as 3
    105         regsub -- "-3" $sgtmp "3" sgtmp3
    106         # see if this space group exists in the table
    107         set fp1 [open [file join \
    108                 $expgui(scriptdir) spacegrp.ref] r]
    109         while {[gets $fp1 line] >= 0} {
    110             set testsg [string toupper [lindex $line 8]]
    111             regsub -all " " $testsg "" testsg
    112             if {$testsg == $sgtmp} {
    113                 set spg [lindex $line 8]
    114                 set sgnum [lindex $line 1]
    115                 break
    116             } elseif {[lindex $line 1] >= 200} {
    117                 regsub -- "-3" $testsg "3" testsg3
    118                 if {$testsg3 == $sgtmp3} {
    119                     set spg [lindex $line 8]
    120                     set sgnum [lindex $line 1]
    121                     break
    122                 }
    123             } elseif {[lindex $line 1] <= 18} {
    124                 # monoclinic: change operators of form "1 xxx 1" to "xxx"
    125                 regsub -- " 1 (.*) 1" [string toupper [lindex $line 8]] "\\1" testsg
    126                 # remove spaces from space group
    127                 regsub -all " " $testsg "" testsg
    128                 if {$testsg == $sgtmp} {
    129                     set spg [lindex $line 8]
    130                     set sgnum [lindex $line 1]
    131                     break
    132                 }
    133             }
    134         }
    135         close $fp1
    136         if {$spg == ""} {
    137             set msg "Warning: a Space Group must be specified"
    138         } elseif {$sgnum == ""} {
    139             set msg "Warning: the Space Group ($spg) is non-standard. Please confirm that this is what you intend!"
    140         }
    14197    }
    14298    set cell {}
     
    208164        # convert Biso to Uiso (if needed)
    209165        if {$Uconv != 1} {
    210             catch {set $uiso [expr $Uconv*$uiso]}
     166            catch {set uiso [expr {$Uconv*$uiso}]} err
    211167        }
    212168        lappend atomlist [list $lbl $x $y $z $type $occ $uiso]
Note: See TracChangeset for help on using the changeset viewer.