Note
Go to the end to download the full example code.
Denoising a 2D Raman spectrum
In this example, we use the denoise
method to remove the noise from a 2D Raman
spectrum.
Import spectrochempy
import spectrochempy as scp
scp.set_loglevel("INFO") # to see information
Load the data (should be a 2D spectrum or a list of datasets that can be merged):
select the useful region
Basic plot
nd.plot(title="original data")

Detrend the data (for a easier comparison)

Denoise the data using the denoise
method with the default parameters
i.e., ratio=99.8

Denoise the data using a different ratio
This example shows that denoising can be used effectively on such spectra to increase the signal-to-noise ratio.
However, it apparently has a poor effect on eliminating cosmic ray peaks.
For the latter, it may be useful to use despike
methods as seen in another example.
This ends the basic example of denoising a 2D Raman spectrum. scp.show() # uncomment to show plot if running from a script sphinx_gallery_thumbnail_number = -1
Total running time of the script: (0 minutes 2.168 seconds)