How to use the known position of peaks for peak fitting? #67
-
I saw that I can use .find_peak_multipeak() on my spectrum to find some peak candidates and then use the result as candidates when I use .fit_peak_multimodel(). Thank you in advance for your time, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
-
This example plots manually created candidates. from ramanchada2.misc.types import ListPeakCandidateMultiModel
cand = ListPeakCandidateMultiModel.validate([
{'base_slope': -.1, 'base_intersept': 100, 'boundaries': [0, 300], 'peaks': [
{'amplitude': 100, 'position': 50, 'sigma': 30, 'skew': 0},
{'amplitude': 10, 'position': 150, 'sigma': 30, 'skew': .5},
{'amplitude': 200, 'position': 250, 'sigma': 30, 'skew': -.5},
], },
{'base_slope': .1, 'base_intersept': -50, 'boundaries': [500, 800], 'peaks': [
{'amplitude': 100, 'position':550, 'sigma': 30, 'skew': 0},
{'amplitude': 10, 'position': 650, 'sigma': 30, 'skew': .5},
{'amplitude': 200, 'position': 700, 'sigma': 30, 'skew': -.5},
], },
])
cand.plot() If you are interested in the candidates only in a specified range, you could do something like: cand = spe.trim_axes('x-axis', (580, 600)).find_peak_multipeak()
spe.fit_peak_multimodel(candidates=cand) |
Beta Was this translation helpful? Give feedback.
This example plots manually created candidates.