source: trunk/dumpprof.tcl @ 689

Last change on this file since 689 was 689, checked in by toby, 11 years ago

# on 2003/05/13 16:21:28, toby did:
Routine to dump profiles from a .EXP file for instrument parm editing

  • Property rcs:author set to toby
  • Property rcs:date set to 2003/05/13 16:21:28
  • Property rcs:rev set to 1.1
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 2.4 KB
Line 
1if {[llength $argv] != 1} {
2    wm withdraw .
3    tk_dialog .err {Wrong Args} \
4            "$argv0: argument should be a .EXP file name" \
5            error 0 Continue
6    exit
7}
8
9set filename [lindex $argv 0]
10
11set expgui(font) 14
12set expgui(debug) 0
13
14pack [label .l -text "Reading $filename\nPlease wait"]
15update
16wm protocol . WM_DELETE_WINDOW {puts ""; exit}
17#=============================================================================
18#----------------------------------------------------------------
19# where are we?
20set expgui(script) [info script]
21# translate links -- go six levels deep
22foreach i {1 2 3 4 5 6} {
23    if {[file type $expgui(script)] == "link"} {
24        set link [file readlink $expgui(script)]
25        if { [file  pathtype  $link] == "absolute" } {
26            set expgui(script) $link
27        } {
28            set expgui(script) [file dirname $expgui(script)]/$link
29        }
30    } else {
31        break
32    }
33}
34# fixup relative paths
35if {[file pathtype $expgui(script)] == "relative"} {
36    set expgui(script) [file join [pwd] $expgui(script)]
37}
38set expgui(scriptdir) [file dirname $expgui(script) ]
39#----------------------------------------------------------------
40source [file join $expgui(scriptdir) opts.tcl]
41# fetch EXP file processing routines
42source [file join $expgui(scriptdir) readexp.tcl]
43# commands for running GSAS programs
44#source [file join $expgui(scriptdir) gsascmds.tcl]
45# override options with locally defined values
46if [file exists [file join $expgui(scriptdir) localconfig]] {
47    source [file join $expgui(scriptdir) localconfig]
48}
49if [file exists [file join ~ .gsas_config]] {
50    source [file join ~ .gsas_config]
51}
52SetTkDefaultOptions $expgui(font)
53
54if {![file exists $filename]} {
55    # read error
56    wm withdraw .
57    tk_dialog .err {Bad file} \
58            "$argv0: error\nfile $filename not found" \
59            error 0 Continue
60    exit
61}
62set fmt [expload $filename]
63if {$fmt < 0} {
64    # read error
65    wm withdraw .
66    tk_dialog .err {Bad file} \
67            "$argv0: error reading $filename\nThis is not a valid GSAS .EXP file" \
68            error 0 Continue
69    exit
70}
71mapexp
72set list1 {}
73foreach hist $expmap(powderlist) {
74    set list2 $hist
75    lappend list2 $expmap(htype_$hist)
76    foreach i $expmap(phaselist_$hist) {
77        set list [string trim [hapinfo $hist $i proftype]]
78        lappend list [hapinfo $hist $i pcut]
79        set nterms [hapinfo $hist $i profterms]
80        for { set num 1 } { $num <= $nterms } { incr num } {
81            lappend list [hapinfo $hist $i pterm$num]
82        }
83        lappend list2 $list
84    }
85    lappend list1 $list2
86}
87puts $list1
88exit
Note: See TracBrowser for help on using the repository browser.