This object is a small tool to allow user to quickly determine the variance in q from the instrumental parameters.
Bases: object
compute resolution in 2D
alias of type
x.__delattr__(‘name’) <==> del x.name
x.__getattribute__(‘name’) <==> x.name
x.__hash__() <==> hash(x)
helper for pickle
helper for pickle
x.__repr__() <==> repr(x)
x.__setattr__(‘name’, value) <==> x.name = value
x.__str__() <==> str(x)
list of weak references to the object (if defined)
Find the angle phi of q on the detector plane for qx_value, qy_value given : qx_value: x component of q : qy_value: y component of q
: return phi: the azimuthal angle of q on x-y plane
Calculate A value for gravity
: s_distance: source to sample distance : d_distance: sample to detector distance
Calculate 1D Gaussian distribution : value: value : mean: mean value : sigma: variance
: return: gaussian (value)
Calculate 2D Gaussian distribution : x_val: x value : y_val: y value : x0_val: mean value in x-axis : y0_val: mean value in y-axis : sigma_x: variance in x-direction : sigma_y: variance in y-direction
: return: gaussian (value)
Calculate 2D Gaussian distribution for polar coodinate : x_val: x value : y_val: y value : x0_val: mean value in x-axis : y0_val: mean value in y-axis : sigma_x: variance in r-direction : sigma_y: variance in phi-direction : sigma_r: wavelength variance in r-direction
: return: gaussian (value)
Get the beam center drop (delta y) in y diection due to gravity
Return delta y: | the beam center drop in cm |
---|
Parameters: |
|
---|---|
Returns: | pix number; pos_x, pos_y in pix index |
Get the pixel positions of the detector in the qx_value-qy_value space
Find qr_value and phi from qx_value and qy_value values
: return qr_value, phi
Parameters: |
|
---|---|
Returns: | q-value at the given position |
Rotate x-y cordinate around z-axis by theta : x_value: numpy array of x values : y_value: numpy array of y values : theta: angle to rotate by in rad
Returns: | x_prime, y-prime |
---|
check if qvalues are within detector range
Compute the Q resoltuion in || and + direction of 2D : qx_value: x component of q : qy_value: y component of q
Compute the resolution : qx_value: x component of q : qy_value: y component of q
Get all instrumental parameters
Get default_spectrum
Get detector pixel size
get max detector q ranges
: return: qx_min, qx_max, qy_min, qy_max tuple
Get detector size
Get the resolution in polar coordinate ready to plot : qx_value: qx_value value : qy_value: qy_value value : sigma_1: variance in r direction : sigma_2: variance in phi direction : coord: coordinate system of image, ‘polar’ or ‘cartesian’
Get intensity
Set wavelength spread
Get Neutron mass
Get detector sample2detector_distance
Get detector sampleslitsample_distance
Get sample aperture size
Get detector source2sample_distance
Get source aperture size
Get _spectrum
Get the variance when the slit/pinhole size is given : size: list that can be one(diameter for circular)
or two components(lengths for rectangular)
: distance: [z, x] where z along the incident beam, x // qx_value : comp: direction of the sigma; can be ‘phi’, ‘y’, ‘x’, and ‘radial’
: return variance: sigma^2
Get the variance from gravity when the wavelength spread is given
: s_distance: source to sample distance : d_distance: sample to detector distance : wavelength: wavelength : spread: wavelength spread (ratio) : comp: direction of the sigma; can be ‘phi’, ‘y’, ‘x’, and ‘radial’
: return variance: sigma^2
Get the variance when the wavelength spread is given
: radius: the radial distance from the beam center to the pix of q : distance: sample to detector distance : spread: wavelength spread (ratio) : comp: direction of the sigma; can be ‘phi’, ‘y’, ‘x’, and ‘radial’
: return variance: sigma^2 for 2d, sigma^2 for 1d [tuple]
Set wavelength spread
Get wavelength
Get wavelength spread
Plot image using pyplot : image: 2d resolution image
: return plt: pylab object
Reset image to default (=[])
Set detector pixel size
Set detector size in number of pixels : param size: [pixel_nums] or [x_pix_num, yx_pix_num]
Set intensity
Set Neutron mass
Set detector sample2detector_distance
: param distance: [distance, x_offset]
Set detector sample_slit2sample_distance
: param distance: [distance, x_offset]
Set sample aperture size
: param size: [dia_value] or [xheight_value, yheight_value]
Set detector source2sample_distance
: param distance: [distance, x_offset]
Set source aperture size
: param size: [dia_value] or [x_value, y_value]
Set spectrum
Set wavelength list or wavelength
Set wavelength and its spread list
Set wavelength spread or wavelength spread
Set wavelength
Set wavelength spread
Setup all parameters in instrument
: param ind: index of lambda, etc