29. 2-D resolution functions¶
sasmodels.resolution2d¶
#This software was developed by the University of Tennessee as part of the #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) #project funded by the US National Science Foundation. #See the license text in license.txt
- class sasmodels.resolution2d.Pinhole2D(data=None, index=None, nsigma=3.0, accuracy='Low', coords='polar')¶
Bases:
ResolutionGaussian Q smearing class for SAS 2d data
- __annotations__ = {}¶
- __class__¶
alias of
type
- __delattr__(name, /)¶
Implement delattr(self, name).
- __dict__ = mappingproxy({'__module__': 'sasmodels.resolution2d', '__doc__': '\n Gaussian Q smearing class for SAS 2d data\n ', '__init__': <function Pinhole2D.__init__>, '_init_data': <function Pinhole2D._init_data>, '_calc_res': <function Pinhole2D._calc_res>, 'apply': <function Pinhole2D.apply>, '__annotations__': {'q': 'np.ndarray', 'q_calc': 'np.ndarray'}})¶
- __dir__()¶
Default dir() implementation.
- __doc__ = '\n Gaussian Q smearing class for SAS 2d data\n '¶
- __eq__(value, /)¶
Return self==value.
- __format__(format_spec, /)¶
Default object formatter.
- __ge__(value, /)¶
Return self>=value.
- __getattribute__(name, /)¶
Return getattr(self, name).
- __getstate__()¶
Helper for pickle.
- __gt__(value, /)¶
Return self>value.
- __hash__()¶
Return hash(self).
- __init__(data=None, index=None, nsigma=3.0, accuracy='Low', coords='polar')¶
Assumption: equally spaced bins in dq_r, dq_phi space.
- Parameters:
data – 2d data used to set the smearing parameters
index – 1d array with len(data) to define the range of the calculation: elements are given as True or False
nr – number of bins in dq_r-axis
nphi – number of bins in dq_phi-axis
coord – coordinates [string], ‘polar’ or ‘cartesian’
- classmethod __init_subclass__()¶
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- __le__(value, /)¶
Return self<=value.
- __lt__(value, /)¶
Return self<value.
- __module__ = 'sasmodels.resolution2d'¶
- __ne__(value, /)¶
Return self!=value.
- classmethod __new__(*args, **kwargs)¶
- __reduce__()¶
Helper for pickle.
- __reduce_ex__(protocol, /)¶
Helper for pickle.
- __repr__()¶
Return repr(self).
- __setattr__(name, value, /)¶
Implement setattr(self, name, value).
- __sizeof__()¶
Size of object in memory, in bytes.
- __str__()¶
Return str(self).
- classmethod __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __weakref__¶
list of weak references to the object
- _calc_res()¶
Over sampling of r_nbins times phi_nbins, calculate Gaussian weights, then find smeared intensity
- _init_data(data, index)¶
Get qx_data, qy_data, dqx_data,dqy_data, and calculate phi_data=arctan(qx_data/qy_data)
- apply(theory)¶
Smear theory by the resolution function, returning Iq.
- q: ndarray = None¶
- q_calc: ndarray = None¶
- class sasmodels.resolution2d.Slit2D(q, q_length, q_width=0.0, q_calc=None, accuracy='low')¶
Bases:
ResolutionSlit aperture with resolution function on an oriented sample.
q points at which the data is measured.
q_length slit length (long axis); assumed to be in the direction of qx
q_width slit width (short axis); assumed to be in the direction of qy; current implementation requires a fixed q_width for all q points.
Please note that this assumption of laboratory-frame qx and qy directions can be inverted by adding or subtracting 90 degrees from the model orientation. For the particular case of USANS, which has a vertical slit of width q_width sweeping through qx, add 90 degrees to the fitted phi angle to find the orientation relative to laboratory frame.
q_calc is the list of q points to calculate, or None if this should be estimated from the q and qx_width.
accuracy determines the number of q_width points to compute for each q. The values are stored in sasmodels.resolution2d.N_SLIT_PERP. The default values are: low=101, med=401, high=1001, xhigh=2001
- __annotations__ = {}¶
- __class__¶
alias of
type
- __delattr__(name, /)¶
Implement delattr(self, name).
- __dict__ = mappingproxy({'__module__': 'sasmodels.resolution2d', '__doc__': '\n Slit aperture with resolution function on an oriented sample.\n\n *q* points at which the data is measured.\n\n *q_length* slit length (long axis); assumed to be in the direction of qx\n\n *q_width* slit width (short axis); assumed to be in the direction of qy; current implementation requires a fixed\n q_width for all q points.\n\n Please note that this assumption of laboratory-frame qx and qy directions can be inverted by adding or subtracting\n 90 degrees from the model orientation. For the particular case of USANS, which has a vertical slit of width\n *q_width* sweeping through qx, add 90 degrees to the fitted phi angle to find the orientation relative to laboratory\n frame.\n\n *q_calc* is the list of q points to calculate, or None if this\n should be estimated from the *q* and *qx_width*.\n\n *accuracy* determines the number of *q_width* points to compute for each *q*.\n The values are stored in sasmodels.resolution2d.N_SLIT_PERP. The default\n values are: low=101, med=401, high=1001, xhigh=2001\n ', '__init__': <function Slit2D.__init__>, 'apply': <function Slit2D.apply>, '__annotations__': {'q': 'np.ndarray', 'q_calc': 'np.ndarray'}})¶
- __dir__()¶
Default dir() implementation.
- __doc__ = '\n Slit aperture with resolution function on an oriented sample.\n\n *q* points at which the data is measured.\n\n *q_length* slit length (long axis); assumed to be in the direction of qx\n\n *q_width* slit width (short axis); assumed to be in the direction of qy; current implementation requires a fixed\n q_width for all q points.\n\n Please note that this assumption of laboratory-frame qx and qy directions can be inverted by adding or subtracting\n 90 degrees from the model orientation. For the particular case of USANS, which has a vertical slit of width\n *q_width* sweeping through qx, add 90 degrees to the fitted phi angle to find the orientation relative to laboratory\n frame.\n\n *q_calc* is the list of q points to calculate, or None if this\n should be estimated from the *q* and *qx_width*.\n\n *accuracy* determines the number of *q_width* points to compute for each *q*.\n The values are stored in sasmodels.resolution2d.N_SLIT_PERP. The default\n values are: low=101, med=401, high=1001, xhigh=2001\n '¶
- __eq__(value, /)¶
Return self==value.
- __format__(format_spec, /)¶
Default object formatter.
- __ge__(value, /)¶
Return self>=value.
- __getattribute__(name, /)¶
Return getattr(self, name).
- __getstate__()¶
Helper for pickle.
- __gt__(value, /)¶
Return self>value.
- __hash__()¶
Return hash(self).
- __init__(q, q_length, q_width=0.0, q_calc=None, accuracy='low')¶
- classmethod __init_subclass__()¶
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- __le__(value, /)¶
Return self<=value.
- __lt__(value, /)¶
Return self<value.
- __module__ = 'sasmodels.resolution2d'¶
- __ne__(value, /)¶
Return self!=value.
- classmethod __new__(*args, **kwargs)¶
- __reduce__()¶
Helper for pickle.
- __reduce_ex__(protocol, /)¶
Helper for pickle.
- __repr__()¶
Return repr(self).
- __setattr__(name, value, /)¶
Implement setattr(self, name, value).
- __sizeof__()¶
Size of object in memory, in bytes.
- __str__()¶
Return str(self).
- classmethod __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __weakref__¶
list of weak references to the object
- apply(theory)¶
Smear theory by the resolution function, returning Iq.
- q: ndarray = None¶
- q_calc: ndarray = None¶