Changeset 1225 for trunk/readexp.tcl


Ignore:
Timestamp:
Nov 8, 2012 1:42:25 PM (8 years ago)
Author:
toby
Message:

update to latest, with Fourier & f'/f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/readexp.tcl

    r1219 r1225  
    47504750# read a Fourier map entry
    47514751# returns five values:
    4752 #   0: type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS)
     4752#   0: type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS)
    47534753#   1: section (X,Y or Z)
    47544754#   2: phase (1-9)
     
    47614761    }
    47624762    set vals {}
    4763     # 0: type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS)
     4763    # 0: type of map (DELF,FCLC,FOBS,[2-9]FDF,PTSN,DPTS)
    47644764    lappend vals [string trim [string range [readexp $key] 2 6]]
    47654765    # 1: section (X,Y or Z)
     
    47774777#   arguments:
    47784778#      phase: (1-9)
    4779 #      type: type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS) - default DELF
     4779#      type: type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS) - default DELF
    47804780#      section: (X,Y or Z) - default Z
    47814781#   returns the number of the map that is added
     
    48004800}
    48014801
     4802# delete all Fourier map computations
     4803proc delFourier {} {
     4804    foreach i {1 2 3 4 5 6 7 8 9} {
     4805        set key "  FOUR CDAT$i"
     4806        delexp $key
     4807    }
     4808}
     4809
    48024810# read/set a Fourier computation value
    48034811# use: Fourierinfo num parm
     
    48064814#  num is the Fourier entry
    48074815#  parm is one of the following
    4808 #     type    -- type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS)
     4816#     type    -- type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS)
    48094817#     section -- last running map direction (X,Y or Z)
    48104818#     phase   -- phase (1-9)
     
    48194827    switch -glob ${parm}-$action {
    48204828        type-get {
    4821             # type of map (DELF,FCLC,FOBS,NFDF,PTSN,DPTS)
     4829            # type of map (DELF,FCLC,FOBS,*FDF,PTSN,DPTS)
    48224830            return [string trim [string range [readexp $key] 2 6]]
    48234831        }
    48244832        type-set {
    48254833            set found 0
    4826             foreach val {DELF FCLC FOBS NFDF PTSN DPTS} {
     4834            foreach val {DELF FCLC FOBS 2FDF 3FDF 4FDF 5FDF 6FDF 7FDF 8FDF 9FDF PTSN DPTS} {
    48274835                if {$val == $value} {
    48284836                    set found 1
     
    49354943    }
    49364944    set steps {}
    4937     foreach v {x y z} {
    4938         set range_$v {}
    4939         lappend steps [expr {[set cell_$v] / [set step_$v]}]
    4940         lappend range_$v [expr {[set min_$v] * 1. / [set step_$v] }]
    4941         lappend range_$v [expr {[set max_$v] * 1. / [set step_$v] }]
    4942     }
    4943     return [list $steps $range_x $range_y $range_z]
     4945    if {[catch {
     4946        foreach v {x y z} {
     4947            set range_$v {}
     4948            lappend steps [expr {[set cell_$v] / [set step_$v]}]
     4949            lappend range_$v [expr {[set min_$v] * 1. / [set step_$v] }]
     4950            lappend range_$v [expr {[set max_$v] * 1. / [set step_$v] }]
     4951        }
     4952    }]} {
     4953        return [list {.2 .2 .2} {0 1} {0 1} {0 1}]
     4954    } else {
     4955        return [list $steps $range_x $range_y $range_z]
     4956    }
    49444957}
    49454958
Note: See TracChangeset for help on using the changeset viewer.