Changeset 781


Ignore:
Timestamp:
Dec 4, 2009 5:11:55 PM (11 years ago)
Author:
toby
Message:

# on 2004/04/27 14:09:07, toby did:
remove unused proc
flag origin 2 space groups when in space group table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export_xml.tcl

    • Property rcs:date changed from 2003/04/10 22:12:41 to 2004/04/27 14:09:07
    • Property rcs:lines changed from +2 -1 to +25 -41
    • Property rcs:rev changed from 1.2 to 1.3
    r672 r781  
    33set label "FOX .xml format"
    44set action exp2xml
    5 # write coordinates in an MSI .xtl file
     5# write coordinates in an XML for FOX
    66proc exp2xml {} {
    77    global expmap expgui
     
    2828            # remove spaces from space group
    2929            regsub -all " " $spacegroup "" spacegroup
     30            # scan through the Origin 1/2 spacegroups for a match
     31            set origin2 0
     32            set sp [string toupper $spacegroup]
     33            # treat bar 3 as the same as 3 (Fd3m <==> Fd-3m)
     34            regsub -- "-3" $sp "3" sp
     35            set fp1 [open [file join $expgui(scriptdir) spacegrp.ref] r]
     36            # skip over the first section of file
     37            set line 0
     38            while {[lindex $line 1] != 230} {
     39                if {[gets $fp1 line] < 0} return
     40            }
     41            while {[gets $fp1 line] >= 0} {
     42                set testsg [string toupper [lindex $line 8]]
     43                regsub -all " " $testsg "" testsg
     44                regsub -- "-3" $testsg "3" testsg
     45                if {$sp == $testsg} {
     46                    set origin2 1
     47                    break
     48                }
     49            }
     50            close $fp1
     51            # GSAS always uses origin2 when there is a choice
     52            if {$origin2} {set spacegroup ${spacegroup}:2}
    3053            puts $fp "  <Crystal Name=\"${name}\" SpaceGroup=\"${spacegroup}\">"
    3154            set min 1
     
    89112}
    90113
    91 # process the spacegroup whenever the phase is changed
    92 proc MSI_SP_convert {args} {
    93     global expgui
    94     set phase 0
    95     catch {set phase $expgui(export_phase)}
    96     if {$phase == 0} return
    97     set spacegroup [phaseinfo $phase spacegroup]
    98     set expgui(export_rhomb) 0
    99     # remove final R from rhombohedral space groups
    100     if {[string toupper [string range $spacegroup end end]] == "R"} {
    101         set expgui(export_rhomb) 1
    102         set spacegroup [string range $spacegroup 0 \
    103                 [expr [string length $spacegroup]-2]]
    104     }
    105     # remove spaces from space group
    106     regsub -all " " $spacegroup "" spacegroup
    107     set expgui(export_sg) $spacegroup
    108     set expgui(export_orig) 0
    109     # scan through the Origin 1/2 spacegroups for a match
    110     set spacegroup [string toupper $spacegroup]
    111     # treat bar 3 as the same as 3 (Fd3m <==> Fd-3m)
    112     regsub -- "-3" $spacegroup "3" spacegroup
    113     set fp [open [file join $expgui(scriptdir) spacegrp.ref] r]
    114     # skip over the first section of file
    115     set line 0
    116     while {[lindex $line 1] != 230} {
    117         if {[gets $fp line] < 0} return
    118     }
    119     while {[gets $fp line] >= 0} {
    120         set testsg [string toupper [lindex $line 8]]
    121         regsub -all " " $testsg "" testsg
    122         regsub -- "-3" $testsg "3" testsg
    123         if {$spacegroup == $testsg} {
    124             set expgui(export_orig) 1
    125             break
    126         }
    127     }
    128     close $fp
    129 }
Note: See TracChangeset for help on using the changeset viewer.