Changeset 453


Ignore:
Timestamp:
Dec 4, 2009 5:06:25 PM (14 years ago)
Author:
toby
Message:

# on 2001/09/25 23:35:54, toby did:
Add "D" to all dummy histogram type, save number of histograms
document histinfo x file
support changing dummy ranges, eventually
support histogram flag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/readexp.tcl

    • Property rcs:date changed from 2001/09/04 22:57:16 to 2001/09/25 23:35:54
    • Property rcs:lines changed from +11 -0 to +61 -7
    • Property rcs:rev changed from 1.29 to 1.30
    r429 r453  
    8181#                           =1 nuclear; 2 mag+nuc; 3 mag; 4 macro
    8282#     expmap(atomlist_$p)   gives a list of defined atoms in phase $p
    83 #     expmap(htype_$n)      gives the GSAS histogram type for histogram
    84 #     expmap(powderlist)    gives a list of powder histograms
     83#     expmap(htype_$n)      gives the GSAS histogram type for histogram (all)
     84#     expmap(powderlist)    gives a list of powder histograms in use
    8585#     expmap(phaselist_$n)  gives a list of phases used in histogram $n
     86#     expmap(nhst)          the number of GSAS histograms
    8687#
    8788proc mapexp {} {
     
    127128    }
    128129    # now get the histogram types
    129     set nhist [string trim [readexp { EXPR  NHST }]]
     130    set expmap(nhst) [string trim [readexp { EXPR  NHST }]]
    130131    set n 0
    131132    set expmap(powderlist) {}
    132     for {set i 0} {$i < $nhist} {incr i} {
     133    for {set i 0} {$i < $expmap(nhst)} {incr i} {
    133134        set ihist [expr {$i + 1}]
    134135        if {[expr {$i % 12}] == 0} {
     
    143144            incr j
    144145        }
    145         set expmap(htype_$ihist) [lindex $line $j]
     146        set expmap(htype_$ihist) [string range $line [expr 2+5*$j] [expr 5*($j+1)]]
     147        # is this a dummy histogram?
     148        if {$ihist <=9} {
     149            set key "HST  $ihist DUMMY"
     150        } else {
     151            set key "HST $ihist DUMMY"
     152        }
    146153        # at least for now, ignore non-powder histograms
    147154        if {[string range $expmap(htype_$ihist) 0 0] == "P" && \
    148155                [string range $expmap(htype_$ihist) 3 3] != "*"} {
     156            if {[existsexp $key]} {
     157                set expmap(htype_$ihist) \
     158                        [string replace $expmap(htype_$ihist) 3 3 D]
     159            }
    149160            lappend expmap(powderlist) $ihist
    150161        }
     
    967978# parm:
    968979#     title
     980#     file  -- file name of raw data for histogram (*)
    969981#     scale (*)
    970982#     sref/sdamp -- refinement flag/damping value for the scale factor (*)
     
    9931005#     excl -- excluded regions (*)
    9941006#     dmin -- minimum d-space for reflection generation (*)
     1007#     use  -- use flag; 1 = use; 0 = do not use (*)
     1008#     dstart -- dummy histogram starting tmin/emin/2theta (*)
     1009#     dstep -- dummy histogram step size tmin/emin/2theta (*)
     1010#     dpoints -- dummy histogram number of points (*)
    9951011proc histinfo {histlist parm "action get" "value {}"} {
    9961012    global expgui
     
    13641380                if ![validreal value 10 4] {return 0}
    13651381                setexp "${key} NREF" $value 6 10
     1382            }
     1383            use-get {
     1384                set k [expr {($hist+11)/12}]
     1385                set line [readexp " EXPR  HTYP$k"]
     1386                set j [expr {((($hist-1) % 12)+1)*5}]
     1387                if {[string range $line $j $j] == "*"} {return 0}
     1388                return 1
     1389            }
     1390            use-set {
     1391                set k [expr {($hist+11)/12}]
     1392                set line [readexp " EXPR  HTYP$k"]
     1393                set j [expr {((($hist-1) % 12)+1)*5+1}]
     1394                if {$value} {
     1395                    setexp " EXPR  HTYP$k" " " $j 1
     1396                } else {
     1397                    setexp " EXPR  HTYP$k" "*" $j 1
     1398                }
     1399            }
     1400            dstart-get {
     1401                return [string trim [string range [readexp "${key} DUMMY"] 20 29]]
     1402            }
     1403            dstart-set {
     1404                if ![validreal value 10 3] {return 0}
     1405                setexp "${key} DUMMY" $value 21 10
     1406            }
     1407            dstep-get {
     1408                return [string trim [string range [readexp "${key} DUMMY"] 30 39]]
     1409            }
     1410            dstep-set {
     1411                if ![validreal value 10 3] {return 0}
     1412                setexp "${key} DUMMY" $value 31 10
     1413            }
     1414            dpoints-get {
     1415                return [string trim [string range [readexp "${key} DUMMY"] 0 9]]
     1416            }
     1417            dpoints-set {
     1418                if ![validint value 10] {return 0}
     1419                setexp "${key} DUMMY" $value 1 10
    13661420            }
    13671421            default {
Note: See TracChangeset for help on using the changeset viewer.