Merged 2.4 branch
r2828 | ffr | 2009-11-25 09:56:49 +1100 (Wed, 25 Nov 2009) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
c58ee9fbcb
commit
2ec6505ef8
File diff suppressed because it is too large
Load Diff
@@ -1,49 +1,35 @@
|
||||
sicsdatafactory new ::histogram_memory::two_theta_array
|
||||
sicsdatafactory new ::histogram_memory::x_pixel_angular_offset_array
|
||||
namespace eval histogram_memory {
|
||||
::utility::mkVar detector_radius_mm Float user radius true detector true true
|
||||
sicslist setatt detector_radius_mm units mm
|
||||
|
||||
##
|
||||
# @brief Calculate two_theta array from X bin boundaries
|
||||
# @brief Calculate x_pixel_angular_offset array from X bin boundaries
|
||||
#
|
||||
# requires detector_active_width_mm det_radius_mm deg_per_rad
|
||||
proc two_theta {args} {
|
||||
proc x_pixel_angular_offset {args} {
|
||||
variable state
|
||||
if [ catch {
|
||||
set opt [lindex $args 0]
|
||||
set arglist [lrange $args 1 end]
|
||||
set proc_name [namespace origin [lindex [info level 0] 0]]
|
||||
set deg_per_radian [SplitReply [deg_per_rad]]
|
||||
switch -- $opt {
|
||||
"-centres" - "-boundaries" - "-graph_type" {
|
||||
return [::histogram_memory::calc_axis $proc_name @none @none @none $opt $args]
|
||||
}
|
||||
"-arrayname" {
|
||||
set max_chan [OAT_TABLE X -getdata MAX_CHAN]
|
||||
set max_chan [OAT_TABLE X -getdata MAX_CHAN]
|
||||
set bb_zero_offset [expr -1*($max_chan-1)]
|
||||
set det_width_mm [SplitReply [detector_active_width_mm]]
|
||||
set det_radius_mm [SplitReply [detector_radius_mm]]
|
||||
set scale_factor [expr {$deg_per_radian*($det_width_mm/$det_radius_mm) / $max_chan}]
|
||||
set offset [::histogram_memory::detector_posn_degrees]
|
||||
return [::histogram_memory::calc_axis $proc_name $scale_factor $offset [OAT_TABLE X -getdata BOUNDARIES] $opt $arglist]
|
||||
}
|
||||
"-units" {
|
||||
return "degrees"
|
||||
}
|
||||
default {
|
||||
set max_chan [OAT_TABLE X -getdata MAX_CHAN]
|
||||
set det_width_mm [SplitReply [detector_active_width_mm]]
|
||||
set det_radius_mm [SplitReply [detector_radius_mm]]
|
||||
set scale_factor [expr {$deg_per_radian*($det_width_mm/$det_radius_mm) / $max_chan}]
|
||||
set offset [::histogram_memory::detector_posn_degrees]
|
||||
return [::histogram_memory::calc_axis $proc_name $scale_factor $offset [OAT_TABLE X -getdata BOUNDARIES] $args]
|
||||
}
|
||||
set scale_factor [expr {-1.0*$deg_per_radian*($det_width_mm/$det_radius_mm) / $max_chan}]
|
||||
# set offset [::histogram_memory::detector_posn_degrees]
|
||||
set offset 0
|
||||
::histogram_memory::calc_axis "x_pixel_angular_offset" $scale_factor $offset [OAT_TABLE X -getdata BOUNDARIES] $bb_zero_offset
|
||||
if {$args == "-get_data_ref"} {
|
||||
return "::histogram_memory::x_pixel_angular_offset_array"
|
||||
} else {
|
||||
return [::histogram_memory::x_pixel_angular_offset_array used]
|
||||
}
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
set script_name ::histogram_memory::two_theta
|
||||
set script_name ::histogram_memory::x_pixel_angular_offset
|
||||
publish $script_name user
|
||||
sicslist setatt $script_name privilege user
|
||||
sicslist setatt $script_name kind script
|
||||
@@ -54,9 +40,9 @@ namespace eval histogram_memory {
|
||||
sicslist setatt $script_name control false
|
||||
sicslist setatt $script_name data true
|
||||
sicslist setatt $script_name nxsave true
|
||||
sicslist setatt $script_name mutable true
|
||||
sicslist setatt $script_name long_name two_theta
|
||||
sicslist setatt $script_name units [::histogram_memory::two_theta -units]
|
||||
sicslist setatt $script_name mutable false
|
||||
sicslist setatt $script_name long_name x_pixel_angular_offset
|
||||
sicslist setatt $script_name units "degrees"
|
||||
unset script_name
|
||||
::histogram_memory::two_theta -boundaries
|
||||
::histogram_memory::set_graphtype "x_pixel_angular_offset" "boundaries"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user