DataObjects.SecSaxsData#
DataObjects.SecSacsData.py
Copyright (c) 2024-2025, SAXS Team, KEK-PF
- class SecSaxsData(folder=None, object_list=None, uv_only=False, xr_only=False, trimmed=False, remove_bubbles=False, beamlineinfo=None, mapping=None, debug=False)#
Bases:
object
A class to represent a SEC-SAXS data object.
ssd = SecSacsData(data_folder)
Creates a SEC-SAXS data object.
- Parameters:
folder (str, optional) – Specifies the folder path where the data are stored. It is required if the data_list parameter is ommitted.
object_list (list, optional) – A list which includes [xr_data, uv_data] in this order to be used as corresponding data items. It is required if the folder parameter is ommitted.
uv_only (bool, optional) – If it is True, only UV data will be loaded to suppress unnecessary data access.
xr_only (bool, optional) – If it is True, only XR data will be loaded to suppress unnecessary data access.
trimmed (bool, optional) – If it is True, the data will be treated as trimmed.
remove_bubbles (bool, optional) – If it is True, bubbles will be removed from the data.
beamlineinfo (BeamlineInfo, optional) – If specified, the beamline information will be used.
mapping (MappingInfo, optional) – If specified, the mapping information will be used.
Examples
>>> ssd = SecSacsData('the_data_folder')
>>> uv_only_ssd = SecSacsData('the_data_folder', uv_only=True)
- plot_3d(view_init=None)#
Plots a pair of 3D figures of UV and XR data.
- Parameters:
view_init (dict, optional) – A dictionary which specifies the view_init parameters. The default is dict(elev=30, azim=-60) as of matplotlib 3.10.
view_arrows (bool, optional) – If it is True, the 2D view arrows are drawn on the 3D plot. One of the arrows shows the elutional view, while the other shows the spectral view. The default is False.
Rturns
-------
result (PlotResult) –
A PlotResult object which contains the following attributes.
fig: Figure axes: Axes
- plot_compact()#
Plots a pair of compact figures of UV and XR data.
- Parameters:
None
- Returns:
result – A PlotResult object which contains the following attributes.
fig: Figure axes: Axes
- Return type:
- make_trimming_info(xr_qr=None, xr_mt=None, uv_wr=None, uv_mt=None, uv_fc=None)#
Returns a pair of indeces which should be used as a slice for the spectral axis to trim away unusable UV data regions.
- Parameters:
xr_qr
xr_mt
uv_wr
uv_mt
uv_fc
See also
ssd.copy
Examples
>>> trim = ssd.make_trimming_info()
- plot_baselines()#
Plots a pair of figures of UV and XR data, which include baselines.
- Parameters:
None
- plot_trimming_info(trim)#
Plots a set of trimmming info.
- Parameters:
trim
title (str, optional) – If specified, add a super title to the plot.
return_fig (bool, optional) – If it is True, returns the figure object.
- Returns:
result – A PlotResult object which contains the following attributes.
fig: Figure axes: Axes trimming : TrimmingInfo
- Return type:
See also
ssd.get_trimming_info
Examples
>>> trim = ssd.get_trimming_info() >>>
- copy(xr_slices=None, uv_slices=None)#
Returns a deep copy of this object.
- Parameters:
xr_slices ((xr_islice, xr_jslice), optional.) – If specified, the returned copy contains the deep copies of elements xrM[xr_islice:xr_jslice] and qv[xr_islice]. Otherwise, the returned copy contains the deep copies of elements xrM and qv.
uv_slices ((uv_islice, uv_jslice), optional.) – If specified, the returned copy contains the deep copies of elements uvM[uv_islice:uv_jslice] and wv[uv_islice]. Otherwise, the returned copy contains the deep copies of elements uvM and wv.
See also
ssd.get_trimming_info
Examples
>>> copied_ssd = ssd.copy()
>>> ti = ssd.get_trimming_info() >>> trimmed_ssd = ssd.copy(xr_slices=ti.xr_slices, uv_slices=ti.uv_slices)
- trimmed_copy(trim=None)#
- corrected_copy()#
Returns a deep copy of this object which has been corrected subtracting the baseline from the original data.
- Parameters:
None
- estimate_mapping(debug=False)#
- get_mapping()#
Returns the mapping information object.
- Parameters:
None
- Returns:
mapping – A MappingInfo object which contains the mapping information. If the mapping information is not available, returns None.
- Return type:
- get_concfactor()#
- make_conc_info(mapping=None, **kwargs)#
- quick_lowrank_info(num_components=None, ranks=None, **kwargs)#
ssd.make_lowrank_info(elution_model=’egh’)
Returns a lowrank information object.
- Parameters:
num_components (int, optional) – Specifies the number of components which also implies the SVD rank used to denoise the matrix data.
elution_model (str, optional) – Specifies the elution model to be used. The default is ‘egh’.
- inspect_ip_effect()#
- Parameters:
None