Instrument

sans.calculator.instrument

This module is a small tool to allow user to control instrumental parameters

class sans.calculator.instrument.Aperture

Bases: object

An object class that defines the aperture variables

set_sample_distance(distance=[])

Set the sample aperture distance

set_sample_size(size=[])

Set the sample aperture size

set_source_size(size=[])

Set the source aperture size

class sans.calculator.instrument.Detector

Bases: object

An object class that defines the detector variables

set_distance(distance=[])

Set the detector distance

set_pix_size(size=[])

Set the detector pix_size

set_size(size=[])

Set the detector size

class sans.calculator.instrument.Neutron

Bases: object

An object that defines the wavelength variables

get_band()

To get the wavelength band

get_default_spectrum()

get default spectrum

get_intensity()

To get the value of intensity

get_mass()

To get the neutron mass

get_ramdom_value()

To get the value of wave length

get_spectrum()

To get the wavelength spectrum

get_wavelength()

To get the value of wavelength

get_wavelength_spread()

To get the value of wavelength spread

plot_spectrum()

To plot the wavelength spactrum : requirment: matplotlib.pyplot

set_band(band=[])

To set the wavelength band

Parameters:band – array of [min, max]
set_full_band()

set band to default value

set_intensity(intensity=368428)

Sets the intensity in counts/sec

set_mass(mass=1.6749272900000001e-024)

Sets the wavelength

set_spectrum(spectrum)

Set spectrum

Parameters:spectrum – numpy array
set_wavelength(wavelength=6.0)

Sets the wavelength

set_wavelength_spread(spread=0.125)

Sets the wavelength spread

setup_spectrum()

To set the wavelength spectrum, and intensity, assumes wavelength is already within the spectrum

class sans.calculator.instrument.Sample

Bases: object

An object class that defines the sample variables

set_distance(distance=[])

Set the sample distance

set_size(size=[])

Set the sample size

set_thickness(thickness=0.0)

Set the sample thickness

class sans.calculator.instrument.TOF

Bases: sans.calculator.instrument.Neutron

TOF: make list of wavelength and wave length spreads

get_band()

To get the wavelength band

get_default_spectrum()

get default spectrum

get_intensity()

To get the value of intensity

get_intensity_list()

get list of the intensity wrt wavelength_list

get_mass()

To get the neutron mass

get_ramdom_value()

To get the value of wave length

get_spectrum()

To get the wavelength spectrum

get_wave_list()

Get wavelength and wavelength_spread list

get_wavelength()

To get the value of wavelength

get_wavelength_spread()

To get the value of wavelength spread

plot_spectrum()

To plot the wavelength spactrum : requirment: matplotlib.pyplot

set_band(band=[])

To set the wavelength band

Parameters:band – array of [min, max]
set_full_band()

set band to default value

set_intensity(intensity=368428)

Sets the intensity in counts/sec

set_mass(mass=1.6749272900000001e-024)

Sets the wavelength

set_spectrum(spectrum)

Set spectrum

Parameters:spectrum – numpy array
set_wave_list(wavelength=[])

Set wavelength list

Parameters:wavelength – list of wavelengths
set_wave_spread_list(wavelength_spread=[])

Set wavelength_spread list

Parameters:wavelength_spread – list of wavelength spreads
set_wavelength(wavelength=6.0)

Sets the wavelength

set_wavelength_spread(spread=0.125)

Sets the wavelength spread

setup_spectrum()

To set the wavelength spectrum, and intensity, assumes wavelength is already within the spectrum

sans.calculator.instrument.validate(value=None)

Check if the value is folat > 0.0

Return value:True / False

Table Of Contents

Previous topic

Reference

Next topic

Slit Length Calculator

This Page