Use hmm start, length, and long name variables to write instrument specific histogram data.

Writing of motor units and long name has been parameterized so that we can fetch this values from a motor object.
Scan variable is now written directly instead of linking to another entry.

r1680 | ffr | 2007-03-20 11:40:26 +1100 (Tue, 20 Mar 2007) | 4 lines
This commit is contained in:
Ferdi Franceschini
2007-03-20 11:40:26 +11:00
committed by Douglas Clowes
parent 8251a6468b
commit d958acecd8

View File

@@ -67,7 +67,7 @@ proc det_height_arr {active_height_mm row_zero dim0} {
}
}
proc addnxscanentry {nxobj entryname scanVariable scanVarPos scanVarStep start_time} {
proc hmm_addnxscanentry {nxobj entryname scanVariable scanVarPos scanVarStep start_time} {
global dradius ndect angsep;
set dim0 [SplitReply [hmm configure dim0]]
set dim1 [SplitReply [hmm configure dim1]]
@@ -76,21 +76,26 @@ putcrystal $nxobj
putmonitor $nxobj
putsample $nxobj
set scanVar_value [string trim [lindex [split [$scanVariable] =] 1]]
$nxobj putfloat $scanVariable $scanVar_value
$nxobj updatedictvar scanvar_name $scanVariable
$nxobj updatedictvar scanvar_units [SplitReply [$scanVariable units]]
$nxobj updatedictvar scanvar_longname $scanVariable
$nxobj putfloat scanvar $scanVar_value
$nxobj putfloat scanstep $scanVarStep
$nxobj putfloat detangle_degrees [SplitReply [detector_angle_deg]]
$nxobj puttext estart $start_time
putpolar_angle $nxobj $dim0 $dim1
# putpolar_angle $nxobj $dim0 $dim1
put_det_height_arr $nxobj $dim0
$nxobj puttext dtype [SplitReply [detector_type]]
$nxobj puttext ddesc [SplitReply [detector_description]]
$nxobj putfloat dradius [SplitReply [detector_radius_mm]]
$nxobj puttext dlayout area
$nxobj puthm dcounts hmm
$nxobj puthm deff hmm
$nxobj puthm dcounts hmm [SplitReply [hmm_start]] [SplitReply [hmm_length]] [SplitReply [hmm_bank]]
#$nxobj puthm deff hmm
$nxobj makelink scandata dcounts
$nxobj makelink scanvertaxis dvaxis
$nxobj makelink scandata dtheta
$nxobj makelink scanvar $scanVariable
$nxobj putfloat scanstep $scanVarStep
# $nxobj makelink scandata dtheta
# $nxobj makelink scanvar $scanVariable
$nxobj puttext eend [sicstime];
}
@@ -121,6 +126,15 @@ proc putmonitor {nxobj} {
$nxobj putfloat mdistance [SplitReply [bmon_distance]]
}
proc put_det_height_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 $dim0
$nxobj putarray dvaxis det_height $dim0
}
proc putpolar_angle {nxobj dim0 dim1} {
global det_height
set det_radius_mm [SplitReply [detector_radius_mm]]
@@ -132,10 +146,6 @@ proc putpolar_angle {nxobj dim0 dim1} {
set col_zero [ SplitReply [detector_zero_col]]
set col_offset [ SplitReply [detector_ROI_col_offset]]
det_height_arr $det_active_ht_mm $row_zero $dim0
$nxobj updatedictvar padim0 $dim0
$nxobj updatedictvar padim1 $dim1
$nxobj putarray dvaxis det_height $dim0
set angsep [expr $det_angle_rad / ($dim1-1)]
$nxobj putpolararray dtheta $det_radius_mm $angsep $det_active_ht_mm $det_rot_rad $row_zero $row_offset $col_zero $col_offset $dim0 $dim1
}
@@ -166,19 +176,35 @@ proc putcommon {nxobj entryName scanVariable} {
}
proc putsamplemotors {nxobj} {
foreach motor { som schi sphi sx sy stth sth } {
$nxobj putfloat $motor [getVal [$motor] ];
foreach motor { som schi sphi sx sy stth } {
$nxobj updatedictvar mot_name $motor;
$nxobj updatedictvar mot_long_name $motor;
$nxobj updatedictvar mot_units [SplitReply [$motor units]];
$nxobj putfloat nxsample_mot [getVal [$motor] ];
}
# sth is a virtual motor
$nxobj putfloat sth [getVal [sth ]];
}
proc putmonomotors {nxobj} {
foreach motor { mom mchi mphi mx my mtth mth } {
$nxobj putfloat $motor [getVal [$motor] ];
foreach motor { mom mchi mphi mx my mtth } {
$nxobj updatedictvar mot_name $motor;
$nxobj updatedictvar mot_long_name $motor;
$nxobj updatedictvar mot_units [SplitReply [$motor units]];
$nxobj putfloat nxcrystal_mot [getVal [$motor] ];
}
# mth is a virtual motor
$nxobj putfloat mth [getVal [mth ]];
}
proc putslitmotors {nxobj} {
foreach motor {ss1u ss1d ss1l ss1r ss1vg ss1vo ss1hg ss1ho ss2u ss2d ss2l ss2r ss2vg ss2vo ss2hg ss2ho } {
foreach motor {ss1u ss1d ss1l ss1r ss2u ss2d ss2l ss2r } {
$nxobj updatedictvar mot_name $motor;
$nxobj updatedictvar mot_long_name $motor;
$nxobj updatedictvar mot_units [SplitReply [$motor units]];
$nxobj putfloat nxfilter_mot [getVal [$motor] ];
}
foreach motor {ss1vg ss1vo ss1hg ss1ho ss2vg ss2vo ss2hg ss2ho } {
$nxobj putfloat $motor [getVal [$motor] ];
}
}