From 935116cb9bcb14184bd0f8cb099ecef21fccb204 Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Sun, 1 Apr 2007 15:01:27 +1000 Subject: [PATCH] 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 --- .../config/nexus/nxscripts_common_1.tcl | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl b/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl index d88a632e..faa24fe1 100644 --- a/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl +++ b/site_ansto/instrument/config/nexus/nxscripts_common_1.tcl @@ -4,10 +4,12 @@ # 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 # 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 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]] MakeNXScript @@ -82,6 +84,7 @@ proc det_height_arr {active_height_mm row_zero dim1} { proc hmm_save {nxobj entryname point} { global dradius ndect angsep dictalias; set dictalias(hmm) hmcounts + # dim0 is vertical and dim1 is horizontal set dim0 [SplitReply [hmm configure dim0]]; set dim1 [SplitReply [hmm configure dim1]]; putcommon $nxobj $entryname $point; @@ -91,8 +94,8 @@ proc hmm_save {nxobj entryname point} { $nxobj putfloat detangle_degrees [SplitReply [detector_angle_deg]] # put1Dpolar_angle $nxobj $dim0; - put_det_haxis_arr $nxobj $dim0; - put_det_vaxis_arr $nxobj $dim1; + put_det_haxis_arr $nxobj $dim1; + put_det_vaxis_arr $nxobj $dim0; $nxobj puttext dtype [SplitReply [detector_type]] $nxobj puttext ddesc [SplitReply [detector_description]] $nxobj putfloat dradius [SplitReply [detector_radius_mm]] @@ -156,24 +159,24 @@ proc putmonitor {nxobj point} { $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_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} { - set x_arr($i) [expr ($dim0 - 1 - $i)*$angsep*$det_radius_mm] + for {set i 0} {$i < $dim1} {incr i} { + 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 set det_active_ht_mm [SplitReply [detector_active_height_mm]] set row_zero [ SplitReply [detector_zero_row]] - det_height_arr $det_active_ht_mm $row_zero $dim1 - $nxobj putarray dvaxis det_height $dim1 + det_height_arr $det_active_ht_mm $row_zero $dim0 + $nxobj putarray dvaxis det_height $dim0 $nxobj putattribute dvaxis axis 3; }