Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Baseline Correction

It is known that baseline correction is usually required for SEC-SAXS data. In this chapter, we will explain how to do it in Molass Library with one of the methods below.

  • linear (default)

  • uvdiff

  • integral

Learning Points

  • ssd.plot_compact(baseline=True)

  • ssd.set_baseline_method(‘linear’)

  • ssd.set_baseline_method((‘linear’, ‘uvdiff’))

  • ssd.set_baseline_method(‘integral’)

  • ssd.get_baseline_method()

  • ssd.corrected_copy()

Linear Correction (Default)

The default baseline method for X-ray data is linear (Low Percentile Method). Before correction, you can confirm how the baseline is determined with the baseline=True option as follows.

from molass import requires
requires('0.8.5')
from molass_data import SAMPLE2
from molass.DataObjects import SecSaxsData as SSD
ssd = SSD(SAMPLE2)
trimmed_ssd = ssd.trimmed_copy()
trimmed_ssd.plot_compact(baseline=True);
<Figure size 1200x500 with 4 Axes>

Note that just plotting does not change the data set. Actual correction is performed by making a corrected copy of the object with the corrected_copy as shown below.

corrected_ssd = trimmed_ssd.corrected_copy()
corrected_ssd.plot_compact(baseline=True);
<Figure size 1200x500 with 4 Axes>

To change the correction method, you can use set_baseline_method with one of the following specifications.

ssd.set_baseline_method('linear')             # default linear fit
ssd.set_baseline_method(('linear', 'uvdiff')) # recommended: linear for X-ray, uvdiff for UV
ssd.set_baseline_method('integral')

UV-specific Correction

From our experience, it is known that baselines for UV data are usually not linear. To address this peculiarity, you can change the method for UV data only as follows.

set_baseline_method interprets the first element of the tuple as the method for X-ray data and the second as the method for UV data. The recommended combination is ('linear', 'uvdiff').

trimmed_ssd.set_baseline_method(('linear', 'uvdiff'))
trimmed_ssd.plot_compact(baseline=True);
<Figure size 1200x500 with 4 Axes>

This baseline method setting is retained with copies so that the following standard coding sequence works as expected.

corrected_ssd = trimmed_ssd.corrected_copy()
corrected_ssd.plot_compact(baseline=True);
<Figure size 1200x500 with 4 Axes>
corrected_ssd.get_baseline_method()
('linear', 'uvdiff')

Integral Correction

There is another established method which deals with the baseline drift due to the accumulation of fouling. The integral method can be activated by specifying integral.

To contrast the difference, compare the following plots resulted from linear and integral methods.

trimmed_ssd.set_baseline_method('integral')
trimmed_ssd.plot_compact(baseline=True);
<Figure size 1200x500 with 4 Axes>

The actual stardard correction procedure will be as follows.

corrected_ssd = trimmed_ssd.corrected_copy()
corrected_ssd.plot_compact(baseline=True);
<Figure size 1200x500 with 4 Axes>

Note that the last specified and retained method (here 'integral') has been applied, which can be confirmed as follows.

corrected_ssd.get_baseline_method()
'integral'