dim0 is vertical

dim1 is horizontal
It's the C order thing, rows columns.

r1773 | ffr | 2007-04-01 15:01:27 +1000 (Sun, 01 Apr 2007) | 4 lines
This commit is contained in:
Ferdi Franceschini
2007-04-01 15:01:27 +10:00
committed by Douglas Clowes
parent 374151be26
commit 935116cb9b

View File

@@ -4,10 +4,12 @@
# dictalias is a global hash which records the alias which the value of # dictalias is a global hash which records the alias which the value of
# a sics object (eg motors) is written to. The has is indexed by the # a sics object (eg motors) is written to. The has is indexed by the
# objects name. It is useful for making links to datasets. # objects name. It is useful for making links to datasets.
# dim0 = vertical axis on detector
# dim1 = horizontal axis on detector
set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}] set tmpstr [string map {"$" ""} {$Name: not supported by cvs2svn $}]
set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]] set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]]
set tmpstr [string map {"$" ""} {$Revision: 1.18 $}] set tmpstr [string map {"$" ""} {$Revision: 1.19 $}]
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]] set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
MakeNXScript MakeNXScript
@@ -82,6 +84,7 @@ proc det_height_arr {active_height_mm row_zero dim1} {
proc hmm_save {nxobj entryname point} { proc hmm_save {nxobj entryname point} {
global dradius ndect angsep dictalias; global dradius ndect angsep dictalias;
set dictalias(hmm) hmcounts set dictalias(hmm) hmcounts
# dim0 is vertical and dim1 is horizontal
set dim0 [SplitReply [hmm configure dim0]]; set dim0 [SplitReply [hmm configure dim0]];
set dim1 [SplitReply [hmm configure dim1]]; set dim1 [SplitReply [hmm configure dim1]];
putcommon $nxobj $entryname $point; putcommon $nxobj $entryname $point;
@@ -91,8 +94,8 @@ proc hmm_save {nxobj entryname point} {
$nxobj putfloat detangle_degrees [SplitReply [detector_angle_deg]] $nxobj putfloat detangle_degrees [SplitReply [detector_angle_deg]]
# put1Dpolar_angle $nxobj $dim0; # put1Dpolar_angle $nxobj $dim0;
put_det_haxis_arr $nxobj $dim0; put_det_haxis_arr $nxobj $dim1;
put_det_vaxis_arr $nxobj $dim1; put_det_vaxis_arr $nxobj $dim0;
$nxobj puttext dtype [SplitReply [detector_type]] $nxobj puttext dtype [SplitReply [detector_type]]
$nxobj puttext ddesc [SplitReply [detector_description]] $nxobj puttext ddesc [SplitReply [detector_description]]
$nxobj putfloat dradius [SplitReply [detector_radius_mm]] $nxobj putfloat dradius [SplitReply [detector_radius_mm]]
@@ -156,24 +159,24 @@ proc putmonitor {nxobj point} {
$nxobj putfloat mdistance [SplitReply [bmon_distance]] $nxobj putfloat mdistance [SplitReply [bmon_distance]]
} }
proc put_det_haxis_arr {nxobj dim0} { proc put_det_haxis_arr {nxobj dim1} {
set det_radius_mm [SplitReply [detector_radius_mm]] set det_radius_mm [SplitReply [detector_radius_mm]]
set det_angle_rad [SplitReply [detector_angle_rad]] set det_angle_rad [SplitReply [detector_angle_rad]]
set angsep [expr $det_angle_rad / ($dim0-1)] set angsep [expr $det_angle_rad / ($dim1-1)]
for {set i 0} {$i < $dim0} {incr i} { for {set i 0} {$i < $dim1} {incr i} {
set x_arr($i) [expr ($dim0 - 1 - $i)*$angsep*$det_radius_mm] set x_arr($i) [expr ($dim1 - 1 - $i)*$angsep*$det_radius_mm]
} }
$nxobj putarray dhaxis x_arr $dim0; $nxobj putarray dhaxis x_arr $dim1;
} }
proc put_det_vaxis_arr {nxobj dim1} { proc put_det_vaxis_arr {nxobj dim0} {
global det_height global det_height
set det_active_ht_mm [SplitReply [detector_active_height_mm]] set det_active_ht_mm [SplitReply [detector_active_height_mm]]
set row_zero [ SplitReply [detector_zero_row]] set row_zero [ SplitReply [detector_zero_row]]
det_height_arr $det_active_ht_mm $row_zero $dim1 det_height_arr $det_active_ht_mm $row_zero $dim0
$nxobj putarray dvaxis det_height $dim1 $nxobj putarray dvaxis det_height $dim0
$nxobj putattribute dvaxis axis 3; $nxobj putattribute dvaxis axis 3;
} }