How to crop a spectrum? #60
-
Is there any way I can crop a spectrum in ramanchada2? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I see one possibility would be to do the following (see code below). However, it only works for spe.x and spe.y, but I would get an error if I do spe[condition]. So I could go on working with spe.x and spe.y as numpy arrays, but then I would miss all the advantages of working with spectrum class.
|
Beta Was this translation helpful? Give feedback.
-
Yes, we have such a method in RC2 -- trim_axes This example should do the same as yours (unless i have a typo): low_end = 580
high_end = 600
spe_cr = spe.trim_axes(method='x-axis', boundaries=(low_end, high_end))
spe_cr.plot() My original answer was as a reply to the second comment. I am posting it again so that it can be marked as an answer |
Beta Was this translation helpful? Give feedback.
Yes, we have such a method in RC2 -- trim_axes
One can specify boundaries in
'x-axis'
units or'bin'
index viamethod
parameter.This example should do the same as yours (unless i have a typo):
My original answer was as a reply to the second comment. I am posting it again so that it can be marked as an answer