Changeset 266 for trunk/import_cell.tcl
- Timestamp:
- Dec 4, 2009 5:03:11 PM (14 years ago)
- 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 13 13 set atomlist {} 14 14 set spg {} 15 set shift {} 15 16 set sgnum {} 16 17 set setting {} … … 33 34 global expgui 34 35 set fp [open [file join $expgui(scriptdir) spacegrp.ref] r] 35 set spg_alt {}36 36 while {[gets $fp line] >= 0} { 37 37 if {$sgnum == [lindex $line 1] && \ 38 38 $setting == [lindex $line 2]} { 39 set spg [lrange $line 8 end] 39 set spg [lindex $line 8] 40 set shift [lindex $line 9] 40 41 close $fp 41 42 break 42 } elseif {$sgnum == [lindex $line 1]} {43 set spg_alt [lrange $line 8 end]44 43 } 45 44 } … … 60 59 regsub {[1-9]*\+} $type {} type 61 60 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] 63 64 } 64 65 } 65 66 } 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 } 66 80 # exact spacegroup was not found 67 if {$spg == "" && $spg_alt == ""} {81 if {$spg == ""} { 68 82 # how did this happen 69 83 MyMessageBox -parent . -type ok -icon error \ 70 -message "Error: The space group number ($sgnum) in file $filename is invalid somehow."71 } elseif {$s pg == ""} {84 -message "Error: The space group number ($sgnum) and setting ($setting) in file $filename is invalid!" 85 } elseif {$shift != ""} { 72 86 # don't have the correct setting 73 87 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)" 79 89 } 80 90 return "[list $spg] [list $cell] [list $atomlist]"
Note: See TracChangeset
for help on using the changeset viewer.