Changeset 1017 for branches


Ignore:
Timestamp:
Oct 5, 2010 11:01:34 AM (13 years ago)
Author:
toby
Message:

read default radii from AFAC records

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/readexp.tcl

    r1016 r1017  
    27222722    }
    27232723}
    2724 
     2724# read default information about atom types (records copied to the .EXP file
     2725# from the gsas/data/atomdata.dat file as AFAC ...
     2726#     distrad returns a list of atom types (one or two letters) and
     2727#                the corresponding distance
     2728# note that these values are read only (no set option)
     2729proc DefAtmTypInfo {parm} {
     2730    set keys [array names ::exparray " AFAC *_SIZ"]
     2731    set elmlist {}
     2732    if {[llength $keys] <= 0} {return ""}
     2733    foreach key $keys {
     2734        lappend elmlist [string trim [string range $key 6 7]]
     2735    }
     2736    switch -glob ${parm} {
     2737        distrad {
     2738            set out {}
     2739            foreach key $keys elm $elmlist {
     2740                set val [string range $::exparray($key) 0 9]
     2741                lappend out "$elm [string trim $val]"
     2742            }
     2743            return $out
     2744        }
     2745        angrad {
     2746            set out {}
     2747            foreach key $keys elm $elmlist {
     2748                set val [string range $::exparray($key) 10 19]
     2749                lappend out "$elm [string trim $val]"
     2750            }
     2751            return $out
     2752        }
     2753        default {
     2754            set msg "Unsupported DefAtmTypInfo access: parm=$parm"
     2755            tk_dialog .badexp "Error in readexp" $msg error 0 Exit
     2756        }
     2757    }
     2758}
    27252759# write the .EXP file
    27262760proc expwrite {expfile} {
Note: See TracChangeset for help on using the changeset viewer.