lbl-anp / becquerel

Becquerel is a Python package for analyzing nuclear spectroscopic measurements.
Other
43 stars 16 forks source link

Exception during peak finding #350

Open arunpersaud opened 2 years ago

arunpersaud commented 2 years ago

I ran into a problem where I have a spectrum that has a pileup in its largest bin and the resulting self.snr is constant for the last few bins... this creates a second derivative that d2=0, which raises and exception. Perhaps it's better to just print a warning, so that the program can continue?

Screen Shot 2022-08-23 at 10 00 31 AM

blue: spectrum orange: self.snr from peakfinder

I'll submit a pull request in a minute for a possible code change

arunpersaud commented 1 year ago

Just a quick not that after a discussion with the becquerel team we noticed that there is already code in there that should handle edge cases... I will check if that code can be improved to handle the above case as well