This module is a small tool to allow user to control instrumental parameters
Bases: object
An object class that defines the aperture variables
Set the sample aperture distance
Set the sample aperture size
Set the source aperture size
Bases: object
An object class that defines the detector variables
Set the detector distance
Set the detector pix_size
Set the detector size
Bases: object
An object that defines the wavelength variables
To get the wavelength band
get default spectrum
To get the value of intensity
To get the neutron mass
To get the value of wave length
To get the wavelength spectrum
To get the value of wavelength
To get the value of wavelength spread
To plot the wavelength spactrum : requirment: matplotlib.pyplot
To set the wavelength band
Parameters: | band – array of [min, max] |
---|
set band to default value
Sets the intensity in counts/sec
Sets the wavelength
Set spectrum
Parameters: | spectrum – numpy array |
---|
Sets the wavelength
Sets the wavelength spread
To set the wavelength spectrum, and intensity, assumes wavelength is already within the spectrum
Bases: object
An object class that defines the sample variables
Set the sample distance
Set the sample size
Set the sample thickness
Bases: sas.calculator.instrument.Neutron
TOF: make list of wavelength and wave length spreads
get list of the intensity wrt wavelength_list
Get wavelength and wavelength_spread list
Set wavelength list
Parameters: | wavelength – list of wavelengths |
---|
Set wavelength_spread list
Parameters: | wavelength_spread – list of wavelength spreads |
---|
Check if the value is folat > 0.0
Return value: | True / False |
---|
This module is a small tool to allow user to quickly determine the size value in real space from the fringe width in q space.
Bases: object
compute thickness from the fringe width of data
Calculate thickness.
Returns: | the thickness. |
---|
return deltaQ value in 1/A unit
Returns: | the thickness unit. |
---|
Receive deltaQ value
Parameters: | dq – q fringe width in 1/A unit |
---|
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
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
SAS generic computation and sld file readers
Bases: sas.models.BaseComponent.BaseComponent
Generic SAS computation Model based on sld (n & m) arrays
Evaluate a distribution of q-values. * For 1D, a numpy array is expected as input: evalDistribution(q) where q is a numpy array. * For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], where 1D arrays. :param qdist: ndarray of scalar q-values or list [qx,qy] where qx,qy are 1D ndarrays
Get SLD profile
: return: sld_data
Evaluate the model :param x: simple value :return: (I value)
Evaluate the model :param x: simple value :return: I value :Use this runXY() for the computation
Sets is_avg: [bool]
Set the volume of a pixel in (A^3) unit :Param volume: pixel volume [float]
Sets sld_data
Magnetic SLD.
Returns (sldm, sld_theta, sld_phi)
Returns (sld_mx, sldmy, sld_mz)
Returns nuclear sld
Set bonding line data if taken from pdb
Set xnodes, ynodes, and znodes
Set pixel type :Param pix_type: string, ‘pixel’ or ‘atom’
Set pixel :Params pixel: str; pixel or atomic symbol, or array of strings
Set pixel volumes :Params pixel: str; pixel or atomic symbol, or array of strings
Sets (|m|, m_theta, m_phi)
Sets neutron SLD
Set xtepsize, ystepsize, and zstepsize
Convert OMFData to MAgData
return MagSLD
Return all data
Return output
Removes any mx, my, and mz = 0 points
Set all data
OMF Data.
Set the Mx, My, Mz values
Class to load omf/ascii files (3 columns w/header).
Load data file :param path: file path :return: x, y, z, sld_n, sld_mx, sld_my, sld_mz
PDB reader class: limited for reading the lines starting with ‘ATOM’
Load data file
Parameters: | path – file path |
---|---|
Returns: | MagSLD |
Raises RuntimeError: | |
when the file can’t be opened |
Write
Class to load ascii files (7 columns).
Load data file
Parameters: | path – file path |
---|---|
Return MagSLD: | x, y, z, sld_n, sld_mx, sld_my, sld_mz |
Raises: |
|
Write sld file
Param path: | file path |
---|---|
Param data: | MagSLD data object |
Convert magnetization to magnatic SLD sldm = Dm * mag where Dm = gamma * classical elec. radius/(2*Bohr magneton) Dm ~ 2.853E-12 [A^(-2)] ==> Shouldn’t be 2.90636E-12 [A^(-2)]???
re-center
Returns: | posx, posy, posz [arrays] |
---|
This module is a small tool to allow user to quickly determine the slit length value of data.
Bases: object
compute slit length from SAXSess beam profile (1st col. Q , 2nd col. I , and 3rd col. dI.: don’t need the 3rd)
Calculate slit length.
Returns: | the slit length calculated value. |
---|
Returns: | the slit length unit. |
---|
Receive two vector x, y and prepare the slit calculator for computation.
Parameters: |
|
---|