Message Boards Message Boards

Calculate the background of the annexed spectrum with EstimatedBackground?

GROUPS:

Hello, I would like to calculate the background of the annexed spectrum (csv format). I have imported the data and I have managed to put these data in a Table or in graphic form. But the EstimatedBackground[Data] doesn't seem to work. Your help would be very appreciated! Thank you! Sandra

Attachments:
POSTED BY: Sandra Fernandes
Answer
16 days ago

Hello Sandra,

data = Import[
   "<your path>\\Plot_W3234-3240.csv"];

EstimatedBackground does not support data in the form {{xi,yi}...}, but can handle TimeSeries

ts = TimeSeries[data];

Off[InterpolatingFunction::dmval]

ListPlot[{ts, EstimatedBackground[ts], ts - EstimatedBackground[ts]}, 
 PlotRange -> All, ImageSize -> Large, Joined -> True]

ListPlot[{ts, EstimatedBackground[ts], ts - EstimatedBackground[ts]}, 
 PlotRange -> {{0, 20}, Automatic} , ImageSize -> Large, 
 Joined -> True, 
 PlotLegends -> {"data", "background", "corrected data"}]
POSTED BY: Michael Helmle
Answer
16 days ago

Thank you so much Michael! It worked well :-) I would like to find peaks in this spectra, using the FindPeak command... peak=FindPeak[data], doesn't seem to work. Could you give me a hint about this? Does anyone know where can I find the algorithm for the EstimatedBackground or any other mathematica commands?

POSTED BY: Sandra Fernandes
Answer
15 days ago
ts2 = TimeSeriesResample[ts];
peaks = FindPeaks[ts2, 0.5, 0.1, 120];
peaks["Path"] // TableForm
ListPlot[ts2, 
 Epilog -> {Orange, PointSize[0.03], Point[peaks["Path"]]}, 
 PlotRange -> All]

You have to play with the parameters of FindPeaks

POSTED BY: Michael Helmle
Answer
15 days ago

Thank you so much once more, Michael!

POSTED BY: Sandra Fernandes
Answer
15 days ago

Group Abstract Group Abstract