Resolution Calculator

sans.calculator.resolution_calculator

This object is a small tool to allow user to quickly determine the variance in q from the instrumental parameters.

class sans.calculator.resolution_calculator.ResolutionCalculator

Bases: object

compute resolution in 2D

compute(wavelength, wavelength_spread, qx_value, qy_value, coord='cartesian')

Compute the Q resoltuion in || and + direction of 2D : qx_value: x component of q : qy_value: y component of q

compute_and_plot(qx_value, qy_value, qx_min, qx_max, qy_min, qy_max, coord='cartesian')

Compute the resolution : qx_value: x component of q : qy_value: y component of q

get_all_instrument_params()

Get all instrumental parameters

get_default_spectrum()

Get default_spectrum

get_detector_pix_size()

Get detector pixel size

get_detector_qrange()

get max detector q ranges

: return: qx_min, qx_max, qy_min, qy_max tuple

get_detector_size()

Get detector size

get_image(qx_value, qy_value, sigma_1, sigma_2, sigma_r, qx_min, qx_max, qy_min, qy_max, coord='cartesian', full_cal=True)

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()

Get intensity

get_intensity_list()

Set wavelength spread

get_neutron_mass()

Get Neutron mass

get_sample2detector_distance()

Get detector sample2detector_distance

get_sample2sample_distance()

Get detector sampleslitsample_distance

get_sample_aperture_size()

Get sample aperture size

get_source2sample_distance()

Get detector source2sample_distance

get_source_aperture_size()

Get source aperture size

get_spectrum()

Get _spectrum

get_variance(size=[], distance=0, phi=0, comp='radial')

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_variance_gravity(s_distance, d_distance, wavelength, spread, phi, comp='radial', switch='on')

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_variance_wave(radius, distance, spread, phi, comp='radial', switch='on')

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

get_wave_list()

Set wavelength spread

get_wavelength()

Get wavelength

get_wavelength_spread()

Get wavelength spread

plot_image(image)

Plot image using pyplot : image: 2d resolution image

: return plt: pylab object

reset_image()

Reset image to default (=[])

set_detector_pix_size(size)

Set detector pixel size

set_detector_size(size)

Set detector size in number of pixels : param size: [pixel_nums] or [x_pix_num, yx_pix_num]

set_intensity(intensity)

Set intensity

set_neutron_mass(mass)

Set Neutron mass

set_sample2detector_distance(distance)

Set detector sample2detector_distance

: param distance: [distance, x_offset]

set_sample2sample_distance(distance)

Set detector sample_slit2sample_distance

: param distance: [distance, x_offset]

set_sample_aperture_size(size)

Set sample aperture size

: param size: [dia_value] or [xheight_value, yheight_value]

set_source2sample_distance(distance)

Set detector source2sample_distance

: param distance: [distance, x_offset]

set_source_aperture_size(size)

Set source aperture size

: param size: [dia_value] or [x_value, y_value]

set_spectrum(spectrum)

Set spectrum

set_wave(wavelength)

Set wavelength list or wavelength

set_wave_list(wavelength_list, wavelengthspread_list)

Set wavelength and its spread list

set_wave_spread(wavelength_spread)

Set wavelength spread or wavelength spread

set_wavelength(wavelength)

Set wavelength

set_wavelength_spread(wavelength_spread)

Set wavelength spread

setup_tof(wavelength, wavelength_spread)

Setup all parameters in instrument

: param ind: index of lambda, etc

Table Of Contents

Previous topic

Kiessig Calculator

This Page