Changeset 266


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

# on 2000/08/17 23:46:23, toby did:
perform origin shifts for Origin 1 settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/import_cell.tcl

    • Property rcs:date changed from 2000/08/14 21:09:21 to 2000/08/17 23:46:23
    • Property rcs:rev changed from 1.1 to 1.2
    • Property rcs:lines set to +24 -14
    r263 r266  
    1313    set atomlist {}
    1414    set spg {}
     15    set shift {}
    1516    set sgnum {}
    1617    set setting {}
     
    3334                global expgui
    3435                set fp [open [file join $expgui(scriptdir) spacegrp.ref] r]
    35                 set spg_alt {}
    3636                while {[gets $fp line] >= 0} {
    3737                    if {$sgnum == [lindex $line 1] && \
    3838                            $setting == [lindex $line 2]} {
    39                     set spg [lrange $line 8 end]
     39                        set spg [lindex $line 8]
     40                        set shift [lindex $line 9]
    4041                        close $fp
    4142                        break
    42                     } elseif {$sgnum == [lindex $line 1]} {
    43                         set spg_alt [lrange $line 8 end]
    4443                    }
    4544                }
     
    6059                regsub {[1-9]*\+} $type {} type   
    6160                regsub {[1-9]*-} $type {} type   
    62                 lappend atomlist "$lbl [lrange $line 2 4] $type"
     61                lappend typelist $type
     62                lappend lbllist $lbl
     63                lappend xyzlist [lrange $line 2 4]
    6364            }
    6465        }
    6566    }
     67    # create the atomlist
     68    foreach type $typelist lbl $lbllist xyz $xyzlist {
     69        if {$shift == ""} {
     70            set l "$lbl $xyz $type"
     71        } else {
     72            set l $lbl
     73            foreach x $xyz offset $shift {
     74                lappend l [expr $x + $offset]
     75            }
     76            lappend l $type
     77        }
     78        lappend atomlist $l
     79    }
    6680    # exact spacegroup was not found
    67     if {$spg == "" && $spg_alt == ""} {
     81    if {$spg == ""} {
    6882        # how did this happen
    6983        MyMessageBox -parent . -type ok -icon error \
    70                 -message "Error: The space group number ($sgnum) in file $filename is invalid somehow."
    71     } elseif {$spg == ""} {
     84                -message "Error: The space group number ($sgnum) and setting ($setting) in file $filename is invalid!"
     85    } elseif {$shift != ""} {
    7286        # don't have the correct setting
    7387        MyMessageBox -parent . -type ok -icon warning \
    74                 -message "Wrong setting: The space group setting ($sgnum #$setting) used in $filename does not match that in GSAS.\n\nYou must apply an origin shift to put the setting into Origin 2!"
    75         set spg $spg_alt
    76     } elseif {[lsearch $warnlist $sgnum] != -1} {
    77         MyMessageBox -parent . -type ok -icon warning \
    78                 -message "Be warned!\nThe space group setting ($sgnum #$setting) used in $filename may not match that in GSAS.\nCheck that the coordinates and symmetry match."
     88                -message "Note: an origin shift ($shift) has been added to the coordinates to convert them to the Origin Choice 2 setting (-1 at 000)"
    7989    }
    8090    return "[list $spg] [list $cell] [list $atomlist]"
Note: See TracChangeset for help on using the changeset viewer.