Use new dir structure.
r1515 | ffr | 2007-02-20 08:03:21 +1100 (Tue, 20 Feb 2007) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
a24d966eea
commit
14a244d014
148
site_ansto/instrument/hipd/config/nexus/nxscripts.tcl
Normal file
148
site_ansto/instrument/hipd/config/nexus/nxscripts.tcl
Normal file
@@ -0,0 +1,148 @@
|
||||
MakeNXScript
|
||||
#nxscript createxml junk4.xml echidna.dic
|
||||
proc getVal {msg} {
|
||||
return [string trim [lindex [split $msg =] 1 ] ]
|
||||
}
|
||||
|
||||
proc newFileName {} {
|
||||
sicsdatanumber incr;
|
||||
set idNum [SplitReply [sicsdatanumber]];
|
||||
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];
|
||||
}
|
||||
|
||||
proc nxcreatefile {{type nx.hdf}} {
|
||||
global dataFileName nxFileOpen cfPath;
|
||||
SicsDataPostFix .$type;
|
||||
|
||||
array set nxmode [list nx.hdf create5 h5 create5 nx5 create5 xml createxml];
|
||||
set dataFileName [newFileName]
|
||||
nxscript $nxmode($type) $dataFileName $cfPath(nexus)/echidna.dic;
|
||||
set nxFileOpen true
|
||||
}
|
||||
|
||||
|
||||
proc nxreopenfile {} {
|
||||
global dataFileName nxFileOpen cfPath;
|
||||
nxscript reopen $dataFileName $cfPath(nexus)/echidna.dic;
|
||||
set nxFileOpen true;
|
||||
}
|
||||
|
||||
proc nxclosefile {} {
|
||||
global dataFileName nxFileOpen;
|
||||
if {$nxFileOpen == true} {
|
||||
nxscript close;
|
||||
set nxFileOpen false;
|
||||
set flist [split $dataFileName "/"];
|
||||
set fname [lindex $flist [expr [llength $flist] - 1] ];
|
||||
clientput "$fname updated" "event";
|
||||
}
|
||||
}
|
||||
|
||||
set dradius 1.25
|
||||
set ndect 128
|
||||
set tubedia 0.0254
|
||||
set pi 3.1415926
|
||||
#set angsep [expr $tubedia/$dradius *(180/$pi)]
|
||||
set angsep 1.25
|
||||
# stthmin = (180 - (1.25*127))/2
|
||||
proc addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep} {
|
||||
global dradius ndect angsep;
|
||||
putcommon $nxobj $entryname $scanVariable
|
||||
putcrystal $nxobj
|
||||
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
|
||||
$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 dlayout area
|
||||
$nxobj puthm dcounts hmm
|
||||
$nxobj puthm deff hmm
|
||||
$nxobj makelink scandata dcounts
|
||||
$nxobj makelink scandata dtheta
|
||||
$nxobj makelink scanvar $scanVariable
|
||||
$nxobj putfloat scanstep $scanVarStep
|
||||
|
||||
}
|
||||
|
||||
proc bm_addnxentry {nxobj entryname scanVariable scanVarPos scanVarStep} {
|
||||
global dradius ndect angsep;
|
||||
putcommon $nxobj $entryname $scanVariable
|
||||
putcrystal $nxobj
|
||||
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)
|
||||
# $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 dlayout point
|
||||
$nxobj makelink scandata mdata
|
||||
$nxobj makelink scanvar $scanVariable
|
||||
$nxobj putfloat scanstep $scanVarStep
|
||||
|
||||
}
|
||||
|
||||
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]]
|
||||
}
|
||||
|
||||
proc putsample {nxobj} {
|
||||
$nxobj puttext saname [getVal [Sample]]
|
||||
}
|
||||
proc putcrystal {nxobj} {
|
||||
$nxobj puttext ctype [sics_mono_crystal]
|
||||
}
|
||||
proc putcommon {nxobj entryName scanVariable} {
|
||||
$nxobj updatedictvar entryName $entryName
|
||||
$nxobj updatedictvar scan_variable $scanVariable
|
||||
$nxobj puttext etitle [getVal [Title]]
|
||||
$nxobj puttext iname [getVal [Instrument]]
|
||||
|
||||
# NXsource
|
||||
$nxobj puttext sname OPAL
|
||||
$nxobj puttext stype Reactor Neutron Source
|
||||
$nxobj puttext sprobe Neutron
|
||||
putsamplemotors $nxobj
|
||||
putslitmotors $nxobj
|
||||
putmonomotors $nxobj
|
||||
}
|
||||
|
||||
proc putsamplemotors {nxobj} {
|
||||
foreach motor { som schi sphi sx sy stth sth } {
|
||||
$nxobj putfloat $motor [getVal [$motor] ];
|
||||
}
|
||||
}
|
||||
|
||||
proc putmonomotors {nxobj} {
|
||||
foreach motor { mom mchi mphi mx my mtth mth } {
|
||||
$nxobj putfloat $motor [getVal [$motor] ];
|
||||
}
|
||||
}
|
||||
|
||||
proc putslitmotors {nxobj} {
|
||||
foreach motor {ss1u ss1d ss1l ss1r ss1vg ss1vo ss1hg ss1ho ss2u ss2d ss2l ss2r ss2vg ss2vo ss2hg ss2ho } {
|
||||
$nxobj putfloat $motor [getVal [$motor] ];
|
||||
}
|
||||
}
|
||||
|
||||
publish nxcreatefile user
|
||||
publish addnxentry user
|
||||
publish bm_addnxentry user
|
||||
|
||||
99
site_ansto/instrument/hipd/config/nexus/wombat.dic
Normal file
99
site_ansto/instrument/hipd/config/nexus/wombat.dic
Normal file
@@ -0,0 +1,99 @@
|
||||
##NXDICT-1.0
|
||||
#----------------------------------------------------------------------------
|
||||
#
|
||||
# DO NOT EDIT WHEN YOU DO NOT KNOW WHAT YOU ARE DOING!
|
||||
# This file determines the placement of data items in the Powder NeXus
|
||||
# data file. Your data may not be readable if this file is messed up.
|
||||
#
|
||||
# Mark Koennecke, May 2004
|
||||
#----------------------------------------------------------------------------
|
||||
entryName=entry1
|
||||
dataName=histogram
|
||||
inst=instrument
|
||||
detector=detector
|
||||
monochromator=monochromator
|
||||
thetadim=128
|
||||
scan_variable=scanvar
|
||||
samplemotor=samplemotor
|
||||
#---------- NXentry level
|
||||
etitle=/$(entryName),NXentry/SDS title -type NX_CHAR
|
||||
estart=/$(entryName),NXentry/SDS start_time -type NX_CHAR
|
||||
eend=/$(entryName),NXentry/SDS end_time -type NX_CHAR
|
||||
#----------------- NXinstrument
|
||||
iname=/$(entryName),NXentry/$(inst),NXinstrument/SDS name -type NX_CHAR \
|
||||
-rank 1 -dim {132}
|
||||
|
||||
|
||||
#----------------- NXmonitor
|
||||
mmode=/$(entryName),NXentry/monitor,NXmonitor/SDS mode -type NX_CHAR
|
||||
mpreset=/$(entryName),NXentry/monitor,NXmonitor/SDS preset -type NX_FLOAT32
|
||||
mdata=/$(entryName),NXentry/monitor,NXmonitor/SDS data -type NX_INT32
|
||||
mdistance=/$(entryName),NXentry/monitor,NXmonitor/SDS distance -type NX_FLOAT32 -attr {units,metre}
|
||||
|
||||
#----------------- NXsource
|
||||
sname=/$(entryName),NXentry/$(inst),NXinstrument/source,NXsource/SDS name \
|
||||
-type NX_CHAR -rank 1
|
||||
stype=/$(entryName),NXentry/$(inst),NXinstrument/source,NXsource/SDS type -type NX_CHAR -rank 1
|
||||
sprobe=/$(entryName),NXentry/$(inst),NXinstrument/source,NXsource/SDS probe -type NX_CHAR -rank 1
|
||||
#----------------- NXcrystal
|
||||
clambda=/$(entryName),NXentry/$(inst),NXinstrument/monochromator_crystal,NXcrystal/SDS wavelength -type NX_FLOAT32 -attr {units,Angstrom}
|
||||
ctype=/$(entryName),NXentry/$(inst),NXinstrument/monochromator_crystal,NXcrystal/SDS type -type NX_CHAR
|
||||
#------------- counter
|
||||
#-------------- Detector
|
||||
# histogram data
|
||||
dradius=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS distance -type NX_FLOAT32
|
||||
dtheta=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS polar_angle -type NX_FLOAT32 -LZW -rank 1 -dim {$(thetadim)} -attr {units,degree}
|
||||
|
||||
dcounts=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS \
|
||||
data -type NX_INT32 -LZW -rank 2 -dim {$(dim0),$(dim1)} \
|
||||
-attr {signal,1}
|
||||
|
||||
deff=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/calibration,NXdata/SDS efficiency -type NX_INT32 -LZW -rank 2 -dim {$(dim0),$(dim1)}
|
||||
|
||||
ddesc=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS description -type NX_CHAR
|
||||
|
||||
dtype=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS type -type NX_CHAR
|
||||
|
||||
dlayout=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS layout -type NX_CHAR
|
||||
#--------------- NXmonochromator
|
||||
mom=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mom,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mom}
|
||||
mchi=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mchi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mchi}
|
||||
mphi=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mphi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mphi}
|
||||
mx=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mx,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mx}
|
||||
my=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/my,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,my}
|
||||
mtth=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mtth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mtth}
|
||||
mth=/$(entryName),NXentry/$(inst),NXinstrument/$(monochromator),NXmonochromator/mth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,mth}
|
||||
#--------------- NXsample
|
||||
saname=/$(entryName),NXentry/sample,NXsample/SDS name -type NX_CHAR
|
||||
sarot=/$(entryName),NXentry/sample,NXsample/SDS rotation_angle -type NX_FLOAT32 -attr {units,degree}
|
||||
som=/$(entryName),NXentry/sample,NXsample/som,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,som}
|
||||
schi=/$(entryName),NXentry/sample,NXsample/schi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,schi}
|
||||
sphi=/$(entryName),NXentry/sample,NXsample/sphi,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sphi}
|
||||
sx=/$(entryName),NXentry/sample,NXsample/sx,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sx}
|
||||
sy=/$(entryName),NXentry/sample,NXsample/sy,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sy}
|
||||
stth=/$(entryName),NXentry/sample,NXsample/stth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,stth}
|
||||
sth=/$(entryName),NXentry/sample,NXsample/sth,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,sth}
|
||||
# Slit motors
|
||||
ss1u=/$(entryName),NXentry/sample,NXsample/ss1u,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1u}
|
||||
ss1d=/$(entryName),NXentry/sample,NXsample/ss1d,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1d}
|
||||
ss1l=/$(entryName),NXentry/sample,NXsample/ss1l,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1l}
|
||||
ss1r=/$(entryName),NXentry/sample,NXsample/ss1r,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1r}
|
||||
ss1vg=/$(entryName),NXentry/sample,NXsample/ss1vg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1vg}
|
||||
ss1vo=/$(entryName),NXentry/sample,NXsample/ss1vo,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1vo}
|
||||
ss1hg=/$(entryName),NXentry/sample,NXsample/ss1hg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1hg}
|
||||
ss1ho=/$(entryName),NXentry/sample,NXsample/ss1ho,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss1ho}
|
||||
ss2u=/$(entryName),NXentry/sample,NXsample/ss2u,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2u}
|
||||
ss2d=/$(entryName),NXentry/sample,NXsample/ss2d,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2d}
|
||||
ss2l=/$(entryName),NXentry/sample,NXsample/ss2l,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2l}
|
||||
ss2r=/$(entryName),NXentry/sample,NXsample/ss2r,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2r}
|
||||
ss2vg=/$(entryName),NXentry/sample,NXsample/ss2vg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2vg}
|
||||
ss2vo=/$(entryName),NXentry/sample,NXsample/ss2vo,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2vo}
|
||||
ss2hg=/$(entryName),NXentry/sample,NXsample/ss2hg,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2hg}
|
||||
ss2ho=/$(entryName),NXentry/sample,NXsample/ss2ho,NXpositioner/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,ss2ho}
|
||||
#----------------NXdata ------------------------------------------------
|
||||
scandata=/$(entryName),NXentry/scan_data,NXdata/NXVGROUP
|
||||
scanvar=/$(entryName),NXentry/scan_variable,NXdata/NXVGROUP
|
||||
scanstep=/$(entryName),NXentry/scan_step,NXdata/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,stepsize}
|
||||
#histogram=/$(entryName),NXentry/histogram,NXdata/NXVGROUP
|
||||
#scanvar=/$(entryName),NXentry/$(scan_variable),NXdata/NXVGROUP
|
||||
|
||||
Reference in New Issue
Block a user