Set x and y pixel offsets and run number.

The run number is used as the first dimension axis for
simple count and save operations.

r1770 | ffr | 2007-04-01 14:36:09 +1000 (Sun, 01 Apr 2007) | 4 lines
This commit is contained in:
Ferdi Franceschini
2007-04-01 14:36:09 +10:00
committed by Douglas Clowes
parent e67510e6bd
commit 2d7cf89385
5 changed files with 55 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
# $Revision: 1.6 $ # $Revision: 1.7 $
# $Date: 2007-03-31 01:27:52 $ # $Date: 2007-04-01 04:36:09 $
# Author: Mark Lesha (mle@ansto.gov.au) # Author: Mark Lesha (mle@ansto.gov.au)
# Last revision by: $Author: ffr $ # Last revision by: $Author: ffr $
@@ -405,6 +405,10 @@ proc count_withbm {mode preset} {
proc save {} { proc save {} {
nxcreatefile nexus_hmscan.dic; nxcreatefile nexus_hmscan.dic;
hmm_save nxscript entry1 0; hmm_save nxscript entry1 0;
$nxobj makelink scanvar erun;
$nxobj putattribute erun axis 1;
$nxobj putattribute hmcounts signal 1;
$nxobj putattribute hmcounts axes run_number:x_pixel_offset:y_pixel_offset;
nxclosefile; nxclosefile;
} }
} }

View File

@@ -18,8 +18,9 @@ etitle=/$(entryName),NXentry/SDS title -type NX_CHAR
sics_release=/version,NXentry/SDS sics_release_tag -type NX_CHAR sics_release=/version,NXentry/SDS sics_release_tag -type NX_CHAR
sics_revision=/version,NXentry/SDS sics_revision_num -type NX_CHAR sics_revision=/version,NXentry/SDS sics_revision_num -type NX_CHAR
nx_content_release=/version,NXentry/SDS nx_content_release_tag -type NX_CHAR -attr {schema_release,$Name: not supported by cvs2svn $} nx_content_release=/version,NXentry/SDS nx_content_release_tag -type NX_CHAR -attr {schema_release,$Name: not supported by cvs2svn $}
nx_content_revision=/version,NXentry/SDS nx_content_revision_num -type NX_CHAR -attr {schema_revision,$Revision: 1.8 $} nx_content_revision=/version,NXentry/SDS nx_content_revision_num -type NX_CHAR -attr {schema_revision,$Revision: 1.9 $}
erun=/$(entryName),NXentry/SDS run_number -type NX_INT32 -rank1 -dim {-1}
estart=/$(entryName),NXentry/SDS start_time -type NX_CHAR estart=/$(entryName),NXentry/SDS start_time -type NX_CHAR
eend=/$(entryName),NXentry/SDS end_time -type NX_CHAR eend=/$(entryName),NXentry/SDS end_time -type NX_CHAR

View File

@@ -7,8 +7,8 @@ dheight=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS de
detangle_rad=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS angular_coverage -type NX_FLOAT32 -attr {units,radians} detangle_rad=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS angular_coverage -type NX_FLOAT32 -attr {units,radians}
detangle_degrees=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS angular_coverage -type NX_FLOAT32 -attr {units,degrees} detangle_degrees=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS angular_coverage -type NX_FLOAT32 -attr {units,degrees}
dtheta=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS polar_angle -type NX_FLOAT32 -LZW -rank 2 -dim {$(padim0),$(padim1)} -attr {units,radians} dtheta=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS polar_angle -type NX_FLOAT32 -LZW -rank 2 -dim {$(padim0),$(padim1)} -attr {units,radians}
dvaxis=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS vertical_axis -type NX_FLOAT32 -LZW -rank 1 -dim {$(padim0)} -attr {units,mm} dvaxis=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS y_pixel_offset -type NX_FLOAT32 -LZW -rank 1 -dim {$(padim0)} -attr {units,mm}
dhaxis=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS x_pixel_offset -type NX_FLOAT32 -LZW -rank 1 -dim {$(padim1)} -attr {units,mm}
hmcounts=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS \ hmcounts=/$(entryName),NXentry/$(inst),NXinstrument/$(detector),NXdetector/SDS \
data -type NX_INT32 -LZW -rank 3 -dim {-1,$(padim0),$(padim1)} data -type NX_INT32 -LZW -rank 3 -dim {-1,$(padim0),$(padim1)}

View File

@@ -6,7 +6,8 @@ scanvar_longname=xxx
#TODO replace scandata with generic name #TODO replace scandata with generic name
scandata=/$(entryName),NXentry/data,NXdata/NXVGROUP scandata=/$(entryName),NXentry/data,NXdata/NXVGROUP
scanvertaxis=/$(entryName),NXentry/vertical_axis,NXdata/NXVGROUP scanhoraxis=/$(entryName),NXentry/data,NXdata/NXVGROUP
scanvertaxis=/$(entryName),NXentry/data,NXdata/NXVGROUP
scanvar=/$(entryName),NXentry/data,NXdata/NXVGROUP scanvar=/$(entryName),NXentry/data,NXdata/NXVGROUP
scanstep=/$(entryName),NXentry/scan_step,NXdata/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,stepsize} scanstep=/$(entryName),NXentry/scan_step,NXdata/SDS value -type NX_FLOAT32 -attr {units,degree} -attr {long_name,stepsize}
#histogram=/$(entryName),NXentry/histogram,NXdata/NXVGROUP #histogram=/$(entryName),NXentry/histogram,NXdata/NXVGROUP

View File

@@ -7,7 +7,7 @@
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.16 $}] set tmpstr [string map {"$" ""} {$Revision: 1.17 $}]
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]] set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
MakeNXScript MakeNXScript
@@ -68,12 +68,12 @@ set tubedia 0.0254
set pi 3.1415926 set pi 3.1415926
set angsep 1.25 set angsep 1.25
# stthmin = (180 - (1.25*127))/2 # stthmin = (180 - (1.25*127))/2
proc det_height_arr {active_height_mm row_zero dim0} { proc det_height_arr {active_height_mm row_zero dim1} {
global det_height global det_height
set hsep [expr $active_height_mm/($dim0-1)] set hsep [expr $active_height_mm/($dim1-1)]
for {set i 0} {$i < $dim0} {incr i} { for {set i 0} {$i < $dim1} {incr i} {
set height [expr ($row_zero - $i) *$hsep] set height [expr ($row_zero - $i) *$hsep]
set det_height($i) $height set det_height($i) $height
} }
@@ -90,8 +90,9 @@ proc hmm_save {nxobj entryname point} {
putsample $nxobj; putsample $nxobj;
$nxobj putfloat detangle_degrees [SplitReply [detector_angle_deg]] $nxobj putfloat detangle_degrees [SplitReply [detector_angle_deg]]
# putpolar_angle $nxobj $dim0 $dim1 # put1Dpolar_angle $nxobj $dim0;
put_det_height_arr $nxobj $dim0 put_det_haxis_arr $nxobj $dim0;
put_det_vaxis_arr $nxobj $dim1;
$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]]
@@ -102,7 +103,8 @@ proc hmm_save {nxobj entryname point} {
$nxobj putslab $dictalias(hmm) [list $point 0 0] [list 1 $dim0 $dim1 ] hmm [SplitReply [hmm_start]] $histo_length [SplitReply [hmm_bank]] $nxobj putslab $dictalias(hmm) [list $point 0 0] [list 1 $dim0 $dim1 ] hmm [SplitReply [hmm_start]] $histo_length [SplitReply [hmm_bank]]
#TODO replace scandata with generic name #TODO replace scandata with generic name
$nxobj makelink scandata hmcounts $nxobj makelink scandata hmcounts
$nxobj makelink scanvertaxis dvaxis $nxobj makelink scanhoraxis x_pixel_offset
$nxobj makelink scanvertaxis y_pixel_offset
} }
proc hmm_addnxscanentry {nxobj entryname point scanVariable scanVarPos scanVarStep start_time} { proc hmm_addnxscanentry {nxobj entryname point scanVariable scanVarPos scanVarStep start_time} {
@@ -112,9 +114,9 @@ proc hmm_addnxscanentry {nxobj entryname point scanVariable scanVarPos scanVarSt
hmm_save $nxobj $entryname $point; hmm_save $nxobj $entryname $point;
fillPath $nxobj $scanVariable; fillPath $nxobj $scanVariable;
$nxobj makelink scanvar $dictalias($scanVariable); $nxobj makelink scanvar $dictalias($scanVariable);
$nxobj putattribute scanvar axis 1; $nxobj putattribute $dictalias($scanVariable) axis 1;
$nxobj putattribute hmcounts signal 1; $nxobj putattribute hmcounts signal 1;
$nxobj putattribute hmcounts axes $scanVariable; $nxobj putattribute hmcounts axes $scanVariable:x_pixel_offset:y_pixel_offset;
$nxobj puttext eend [sicstime]; $nxobj puttext eend [sicstime];
} }
@@ -137,7 +139,7 @@ proc bm_addnxscanentry {nxobj entryname point scanVariable scanVarPos scanVarSte
bm_save $nxobj $entryname $point; bm_save $nxobj $entryname $point;
fillPath $nxobj $scanVariable; fillPath $nxobj $scanVariable;
$nxobj makelink scanvar $dictalias($scanVariable); $nxobj makelink scanvar $dictalias($scanVariable);
$nxobj putattribute scanvar axis 1; $nxobj putattribute $dictalias($scanVariable) axis 1;
$nxobj putattribute bmcounts signal 1; $nxobj putattribute bmcounts signal 1;
$nxobj putattribute bmcounts axes $scanVariable; $nxobj putattribute bmcounts axes $scanVariable;
#TODO add dtype ddesc #TODO add dtype ddesc
@@ -154,16 +156,40 @@ proc putmonitor {nxobj point} {
$nxobj putfloat mdistance [SplitReply [bmon_distance]] $nxobj putfloat mdistance [SplitReply [bmon_distance]]
} }
proc put_det_height_arr {nxobj dim0} { proc put_det_haxis_arr {nxobj dim0} {
set det_radius_mm [SplitReply [detector_radius_mm]]
set angsep [expr $det_angle_rad / ($dim0-1)]
for {set i 0} {$i < $dim0} {incr i} {
set x_arr($i) [expr ($dim0 - 1 - $i)*$angsep*$detector_radius_mm]
}
$nxobj putarray x_pixel_offset x_arr $dim0;
}
proc put_det_vaxis_arr {nxobj dim1} {
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 $dim0 det_height_arr $det_active_ht_mm $row_zero $dim1
$nxobj putarray dvaxis det_height $dim0 $nxobj putarray dvaxis det_height $dim1
$nxobj putattribute dvaxis axis 3;
} }
proc putpolar_angle {nxobj dim0 dim1} { proc put1Dpolar_angle {nxobj dim0} {
set det_angle_rad [SplitReply [detector_angle_rad]]
set col_zero [ SplitReply [detector_zero_col]]
set col_offset [ SplitReply [detector_ROI_col_offset]]
set det_rot_rad [ expr [SplitReply [stth]]/[SplitReply [deg_per_rad]] ]
set angsep [expr $det_angle_rad / ($dim0-1)]
for {set i 0} {$i < $dim0} {incr i} {
set polar_array($i) [expr $det_rot_rad+(($dim0 - 1 - $i) + $col_zero + $col_offset)*$angsep]
}
$nxobj putarray polar_angle polar_array $dim0;
}
proc put2Dpolar_angle {nxobj dim0 dim1} {
global det_height global det_height
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]]
@@ -187,6 +213,9 @@ proc putcrystal {nxobj} {
} }
proc putcommon {nxobj entryName point} { proc putcommon {nxobj entryName point} {
$nxobj updatedictvar entryName $entryName $nxobj updatedictvar entryName $entryName
nxscript_data clear;
nxscript_data putint 0 $point;
$nxobj putslab erun [list $point] [list 1] nxscript_data;
$nxobj puttext etitle [getVal [Title]] $nxobj puttext etitle [getVal [Title]]
$nxobj puttext iname [getVal [Instrument]] $nxobj puttext iname [getVal [Instrument]]
$nxobj puttext username [SplitReply [user]] $nxobj puttext username [SplitReply [user]]