Baseline.UvBaseline#

Baseline.UvBaseline.py

class UvBaseline(ssd, params=None)#

Bases: Curve

A class to represent the UV baseline correction.

x#

The x-coordinates of the baseline.

Type:

array-like

y#

The y-coordinates of the baseline.

Type:

array-like

params#

The parameters used to compute the baseline.

Type:

array-like

Initializes the UvBaseline object with the given SSD and parameters. :param ssd: The SSD object containing the UV data. :type ssd: SSD :param params: The parameters used to compute the baseline. If None, default parameters are used. :type params: array-like, optional

estimate_uvbaseline_params(curve1, curve2, pickat=None, plot_info=None, counter=None, return_also_baseline=False, debug=False)#

Estimate UV baseline parameters by analyzing the difference between two curves.

Parameters:
  • curve1 (Curve) – The first curve (usually the original UV curve).

  • curve2 (Curve) – The second curve (usually the UV curve with pickat applied).

  • pickat (int, optional) – The index at which the pickat was applied. If None, it will be estimated.

  • plot_info (tuple, optional) – A tuple containing (fig, ax) for plotting. If None, no plot is generated.

  • counter (int, optional) – A counter for labeling plots. If None, no labeling is done.

  • return_also_baseline (bool, optional) – If True, the function returns a tuple containing the parameters, the DFEF curve, and the baseline. If False, it returns only the parameters.

  • debug (bool, optional) – If True, debug information is printed and plots are generated.

Returns:

  • uvbaseline_params (array-like) – The estimated UV baseline parameters.

  • dy (array-like, optional) – The DFEF curve if return_also_baseline is True.

  • baseline (array-like, optional) – The estimated baseline if return_also_baseline is True.

inspect_uv_baseline(uv_data, pickat=400, smooth=False, return_also_plotresult=False, title=None, debug=False)#

Estimate UV baseline parameters and plot the result.

Parameters:
  • uv_data (UvData) – The UV data object containing the curves.

  • pickat (int, optional) – The index at which the pickat was applied. Default is 400.

  • smooth (bool, optional) – If True, smooth the curves before analysis. Default is False.

  • return_also_plotresult (bool, optional) – If True, return a PlotResult object along with the parameters. Default is False.

  • title (str, optional) – The title for the plot. If None, no title is set. Default is None.

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

Returns:

  • params (array-like) – The estimated UV baseline parameters.

  • plot_result (PlotResult, optional) – The PlotResult object if return_also_plotresult is True.