h2020charisma / ramanchada2

A library for Raman spectroscopy harmonization
https://h2020charisma.github.io/ramanchada2/
MIT License
4 stars 3 forks source link

Does convolution to a single delta line works? #64

Closed nicocopez closed 1 year ago

nicocopez commented 1 year ago

I have tried to reproduce the example for generating synthetic spectra starting with two delta lines. It works to me, the same as in the example.

spe0 = rc2.spectrum.from_delta_lines(deltas={585:100, 700:150}, nbins=1000)
spe0.plot()
spe1 = spe0.convolve(lineshape='gaussian', sigma=2)
spe1.plot()

However, if I only want to have one peak, the plot only shows a line (and no horizontal line) for the delta line plot, but also for the convoluted function.

spe0 = rc2.spectrum.from_delta_lines(deltas={585:100}, nbins=1000)
spe0.plot()
spe1 = spe0.convolve(lineshape='gaussian', sigma=2)
spe1.plot()

Am I doing something wrong or it isn't supposed to work like this?

imagen imagen

georgievgeorgi commented 1 year ago

Fixed. An explanation is available in the commit message.