function xspec,win,spix,lbkg=lbkg,rbkg=rbkg,xaxis=xaxis,lambda=lambda,sanoff=sanoff
LAMP function to extract the specular intensity from a workspace.
It simply integrates the counts within a certain range of x-pixels and subtracts the backgrounds (if specified)
It also (correctly) calculates the errors and weights by the number of pixels in each range
NECESSARY VARIABLES:
win = the input workspace. This has usually been passed through mload, but will also work for TOF data loaded directly
spix = two element array with the left and right pixels that limit the width of the specular ridge
OPTIONAL VARIABLES:
lbkg = two element array with the left and right pixels that limit the background to the LEFT of the specular ridge
rbkg = a two element array with the left and right pixles that limit the background to the RIGHT of the specular ridge
In reality, the two optional variables are interchangeable
- i.e. left and right don't matter. What matters is that two separate pixel ranges can be used for background
xaxis = a choice of the final x-axis values
You may choose the x-axis in Qz (xaxis = 'q') (default choice)
or theta_in (xaxis='san')
lambda = the wavelength. If unspecified, the wavelength will be taken from the data parameters
sanoff = an offset in the sample angle in degrees.
This will be ADDED to the recorded sample angle
OUTPUT VARIABLES
wout is the workspace containing the specular intensity, background subtracted, with the x-axis = the y axis for win
e.g. type at LAMP interface:
w2=xspec(w1,[60,85],lbkg=[11,59],rbkg=[120,140])