Added user group, detector angular coverage, vertical axis and polar angle (currently filled with zeros because I recently broke it)
r1573 | ffr | 2007-03-03 09:12:38 +1100 (Sat, 03 Mar 2007) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
b1724bb541
commit
28a32cb950
@@ -10,8 +10,10 @@ proc newFileName {} {
|
||||
set dataPath [SplitReply [sicsdatapath]];
|
||||
set prefix [SplitReply [sicsdataprefix]];
|
||||
set postfix [SplitReply [sicsdatapostfix]];
|
||||
set isodate [lindex [split [sicstime] " "] 0];
|
||||
return [format "%s/%s_%s_%s%s" $dataPath $prefix $isodate $idNum $postfix];
|
||||
set date_time_arr [split [sicstime] " "]
|
||||
set isodate [lindex $date_time_arr 0];
|
||||
set isotime [string map {: -} [lindex $date_time_arr 1]];
|
||||
return [format "%s/%s_%sT%s_%05d%s" $dataPath $prefix $isodate $isotime $idNum $postfix];
|
||||
}
|
||||
|
||||
proc nxcreatefile {{type nx.hdf}} {
|
||||
@@ -21,6 +23,8 @@ proc nxcreatefile {{type nx.hdf}} {
|
||||
array set nxmode [list nx.hdf create5 h5 create5 nx5 create5 xml createxml];
|
||||
set dataFileName [newFileName]
|
||||
nxscript $nxmode($type) $dataFileName $cfPath(nexus)/nexus.dic;
|
||||
nxscript updatedictvar entryName sics_release
|
||||
nxscript puttext sics_release [SplitReply [sics_release]]
|
||||
set nxFileOpen true
|
||||
}
|
||||
|
||||
@@ -49,7 +53,7 @@ set pi 3.1415926
|
||||
set angsep 1.25
|
||||
# stthmin = (180 - (1.25*127))/2
|
||||
proc polar_angle {dradius det_angle active_length zi zj det_rot y_offset dim0 dim1} {
|
||||
global tharr
|
||||
global tharr det_height
|
||||
|
||||
set angsep [expr $det_angle / ($dim1-1)]
|
||||
set ysep [expr $active_length/($dim0-1)]
|
||||
@@ -58,15 +62,17 @@ proc polar_angle {dradius det_angle active_length zi zj det_rot y_offset dim0 di
|
||||
|
||||
for {set i 0} {$i < $dim0} {incr i} {
|
||||
set height [expr $y_offset - ($i - $imid)*$ysep]
|
||||
set det_height($i) $height
|
||||
for {set j 0} {$j < $dim1} {incr j} {
|
||||
set alpha [expr $det_rot - ($j - $jmid)*$angsep]
|
||||
set pang [expr acos($dradius * cos($alpha)/sqrt($dradius*$dradius + $height*$height))]
|
||||
set tharr([expr $i*$dim1+$j]) $pang
|
||||
# set alpha [expr $det_rot - ($j - $jmid)*$angsep]
|
||||
# set pang [expr acos($dradius * cos($alpha)/sqrt($dradius*$dradius + $height*$height))]
|
||||
# set tharr([expr $i*$dim1+$j]) $pang
|
||||
set tharr([expr $i*$dim1+$j]) 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep} {
|
||||
proc addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep start_time} {
|
||||
global dradius ndect angsep;
|
||||
set dim0 [SplitReply [hmm configure dim0]]
|
||||
set dim1 [SplitReply [hmm configure dim1]]
|
||||
@@ -76,28 +82,24 @@ putmonitor $nxobj
|
||||
putsample $nxobj
|
||||
set scanVar_value [string trim [lindex [split [$scanVariable] =] 1]]
|
||||
$nxobj putfloat $scanVariable $scanVar_value
|
||||
# Add thetamin and stth to tharr(i)
|
||||
# set sampletwotheta [string trim [lindex [split [stth] =] 1]]
|
||||
# for {set i 0} {$i < $ndect} {incr i} {
|
||||
# set tharr($i) [expr ($i-63.5)*$angsep + $sampletwotheta]
|
||||
# }
|
||||
# $nxobj updatedictvar thetadim $ndect
|
||||
# $nxobj putarray dtheta tharr $ndect
|
||||
putpolar_angle $nxobj $dim0 $dim1
|
||||
$nxobj putfloat detangle_degrees [SplitReply [detector_angle_deg]]
|
||||
$nxobj puttext estart $start_time
|
||||
putpolar_angle $nxobj $dim0 $dim1
|
||||
$nxobj puttext dtype He-3 position sensitive detector, tube active length=335+/-5mm, tube diameter=25.4 +/- 0.8mm
|
||||
$nxobj puttext ddesc 128 He-3 proportional counter detector tubes (GE Energy Reuter Stokes Inc. item=RS-P4-0814-217)
|
||||
$nxobj putfloat dradius $dradius
|
||||
$nxobj putfloat dradius [SplitReply [detector_radius_mm]]
|
||||
$nxobj puttext dlayout area
|
||||
$nxobj puthm dcounts hmm
|
||||
$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 puttext eend [sicstime];
|
||||
}
|
||||
|
||||
proc bm_addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep} {
|
||||
proc bm_addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep start_time} {
|
||||
global dradius ndect angsep;
|
||||
putcommon $nxobj $entryname $scanVariable
|
||||
putcrystal $nxobj
|
||||
@@ -109,22 +111,23 @@ putsample $nxobj
|
||||
# $nxobj puttext dtype He-3 position sensitive detector, tube active length=335+/-5mm, tube diameter=25.4 +/- 0.8mm
|
||||
# $nxobj puttext ddesc 128 He-3 proportional counter detector tubes (GE Energy Reuter Stokes Inc. item=RS-P4-0814-217)
|
||||
# $nxobj putfloat dradius $dradius
|
||||
$nxobj puttext estart $start_time
|
||||
$nxobj puttext dlayout point
|
||||
$nxobj makelink scandata mdata
|
||||
$nxobj makelink scanvar $scanVariable
|
||||
$nxobj putfloat scanstep $scanVarStep
|
||||
|
||||
$nxobj puttext eend [sicstime];
|
||||
}
|
||||
|
||||
proc putmonitor {nxobj} {
|
||||
$nxobj puttext mmode [string trim [lindex [split [bm getmode] =] 1]]
|
||||
$nxobj putfloat mpreset [string trim [lindex [split [bm getpreset] =] 1]]
|
||||
$nxobj putint mdata [string trim [lindex [split [bm getcounts] =] 1]]
|
||||
$nxobj putfloat mdistance [getVal [sics_bm_distance]]
|
||||
$nxobj putfloat mdistance [SplitReply [bmon_distance]]
|
||||
}
|
||||
|
||||
proc putpolar_angle {nxobj dim0 dim1} {
|
||||
global tharr
|
||||
global tharr det_height
|
||||
set det_radius_mm [SplitReply [detector_radius_mm]]
|
||||
set det_angle_rad [SplitReply [detector_angle_rad]]
|
||||
set det_active_ht_mm [SplitReply [detector_active_height_mm]]
|
||||
@@ -135,6 +138,7 @@ proc putpolar_angle {nxobj dim0 dim1} {
|
||||
polar_angle $det_radius_mm $det_angle_rad $det_active_ht_mm $det_zxp $det_zyp $det_rot_rad 0 $dim0 $dim1
|
||||
$nxobj updatedictvar padim0 $dim0
|
||||
$nxobj updatedictvar padim1 $dim1
|
||||
$nxobj putarray dvaxis det_height $dim0
|
||||
$nxobj putgenarray dtheta tharr [expr $dim0 * $dim1]
|
||||
}
|
||||
|
||||
@@ -142,13 +146,17 @@ proc putsample {nxobj} {
|
||||
$nxobj puttext saname [getVal [Sample]]
|
||||
}
|
||||
proc putcrystal {nxobj} {
|
||||
$nxobj puttext ctype [sics_mono_crystal]
|
||||
$nxobj puttext ctype [SplitReply [crystal_type]]
|
||||
$nxobj putfloat clambda [SplitReply [crystal_wavelength_A]]
|
||||
}
|
||||
proc putcommon {nxobj entryName scanVariable} {
|
||||
$nxobj updatedictvar entryName $entryName
|
||||
$nxobj updatedictvar entryName $entryName
|
||||
$nxobj updatedictvar scan_variable $scanVariable
|
||||
$nxobj puttext etitle [getVal [Title]]
|
||||
$nxobj puttext iname [getVal [Instrument]]
|
||||
$nxobj puttext username [SplitReply [user]]
|
||||
$nxobj puttext useremail [SplitReply [email]]
|
||||
$nxobj puttext userphone [SplitReply [phone]]
|
||||
|
||||
# NXsource
|
||||
$nxobj puttext sname OPAL
|
||||
|
||||
Reference in New Issue
Block a user