How to crop a spectrum? #60
|
Is there any way I can crop a spectrum in ramanchada2? |
Answered by
georgievgeorgi
Feb 28, 2023
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. |
2 replies
|
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 |
0 replies
Answer selected by
georgievgeorgi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, we have such a method in RC2 -- trim_axes
One can specify boundaries in
'x-axis'units or'bin'index viamethodparameter.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