DataObjects.XrData#

DataObjects.XrData.py

class XrData(iv, jv, M, E, **kwargs)#

Bases: SsMatrixData

XrData class for XR matrix data. Inherits from SsMatrixData and adds XR-specific functionality.

qv#

The q-values corresponding to the angular axis.

Type:

array-like

Initialize the XrData object.

Parameters:
  • iv (array-like) – The q-values corresponding to the angular axis.

  • jv (array-like) – The values corresponding to the temporal axis.

  • M (2D array-like) – The 2D matrix of intensity values.

  • E (2D array-like or None) – The 2D matrix of error values. It can be None if errors are not available

  • kwargs (dict, optional) – Additional keyword arguments to pass to the SsMatrixData constructor.

get_ipickvalue()#

Get the default pickvalue for i-curves. :returns: The default pickvalue for i-curves. :rtype: float

get_icurve(pickat=0.02)#

Returns an i-curve from the XR matrix data.

Parameters:

pickat (float, optional) –

Specifies the value in ssd.qv where to pick an i-curve. The i-curve will be made from self.M[i,:] where the picking index i will be determined to satisfy

self.qv[i-1] <= pickat < self.qv[i]

according to bisect_right.

Returns:

The extracted i-curve.

Return type:

Curve

Examples

>>> curve = xr.get_icurve()
>>> curve = xr.get_icurve(pickat=0.02)
get_usable_qrange()#

Returns a pair of indeces which should be used as a slice for the angular axis to trim away unusable XR data regions.

Parameters:

None

Returns:

A pair of indeces (i_start, i_end) to be used as a slice for the angular axis.

Return type:

(int, int)

Examples

>>> i, j = xr.get_usable_qrange()
get_ibaseline(pickvalue=0.02)#

Returns a baseline i-curve from the XR matrix data.

Parameters:
  • pickvalue (float, optional) – See ssd.get_xr_icurve().

  • method (str, optional) – The baseline method to be used. If None, the method set in the object will be used.

  • kwargs (dict, optional) – Additional keyword arguments to pass to the baseline computation function. These will be merged with the default_kwargs defined above.

  • debug (bool, optional) – If True, enable debug mode.

Returns:

baseline – The computed baseline i-curve. This curve can be subtracted from the original i-curve to obtain a background-subtracted curve.

Return type:

Curve

Examples

>>> curve = xr.get_icurve()
>>> baseline = xr.get_ibaseline()
>>> corrected_curve = curve - baseline
compute_rgcurve()#

Returns a Rg-curve which is computed using the Molass standard method.

Parameters:

None

Return type:

An RgCurve object.

compute_rgcurve_atsas()#

Returns an Rg-curve which is computed using the ATSAS autorg.

Parameters:

None

Return type:

An RgCurve object.

get_jcurve_array(j=None, peak=None)#

Returns the j-curve array. This method extracts the q, I, and sigq values from the XR data. It uses the first peak in the i-curve to determine the j-curve.

Parameters:
  • j (int, optional) – The index of the j-curve to use. If None, the peak argument is used.

  • peak (int, optional) – This argument is used only if j is None. The index of the peak in the i-curve to use. If None, the first peak is used.

Returns:

jcurve_array

Return type:

np.ndarray