Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong local maximum #30

Closed
judober opened this issue Jul 21, 2023 · 2 comments · Fixed by #31
Closed

Wrong local maximum #30

judober opened this issue Jul 21, 2023 · 2 comments · Fixed by #31
Labels
bug Something isn't working

Comments

@judober
Copy link

judober commented Jul 21, 2023

I tried to to find the local maxima of my data with this package. It worked very well except for two points where the results seem wrong. An example with reduced data:

maxPeakfalse

Here is the code to reproduce this with the attached data (with CSV.jl):

w = 327
CSVData = CSV.File("WrongPeak.csv")
x = CSVData.Column1
y = CSVData.Column2
pks, vals = findmaxima(y, w)
plotpeaks(x, y, peaks=pks, scale=:log10)

WrongPeak.csv

Am I doing something wrong here?

@halleysfifthinc halleysfifthinc added the bug Something isn't working label Jul 21, 2023
@judober
Copy link
Author

judober commented Jul 23, 2023

I looked a bit into what is happening:
it seems the wrong result is identified as a plateau.
However, it is hard for me to tell where it exactly is going wrong.

The good news: with findmaxima(y, w, strict=false), I get the right results.

@halleysfifthinc
Copy link
Owner

Yep the quick debugging I did on Friday revealed a dumb bug on my part, where the plateau test doesn't check/require that an equal (===) value occurs after the current "peak" candidate. I will push and register a fix this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants