-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix/fill negatives gauss #113
Conversation
Fixed buggy fill negatives function and replaced it by a new method, ``` Fill negative channels with positive counts from neighboring channels. The idea is that the negative counts are somehow connected to the (γ-ray) resolution and should thus be filled from a channel within the resolution. This implementation loops through the closest channels with positive number of counts to fill the channle(s) with negative counts. Note that it can happen that some bins will remain with negative counts (if not enough bins with possitive counts are available within the window_size) . The routine is performed for each Ex row independently. ``` Additionally changed code of FirstGeneration and Unfoder to have easier access if someone want to replace the fill negatives function by a custom function
Increased default window size to 20. (arb. number) Additionally, corrected the window size to be the total window size (before it was actually twice as large as expected)
Routine now resembles the one in mama, let's study the impact
The array for the gaussian was messed up before
Will discuss this issue further with Ann-Cecilie, but for now I will pull this down due to the issues mentioned above. The version of just removing the negative counts seems more appropriate; although we might choose this here for the very first step, the subtracted background spectra. Note that the effects would also be very interesting to test for a low count spectrum, like in beta-decay. |
btw: This has of course a sigificant impact on the analyzed nld and gsf. Here is the comparison with the input data (for the version with the corrected likelihood, #112 ): product from the synthetic dataset: |
This gave better results, see discussions in the PRs oslocyclotronlab#110 and oslocyclotronlab#113
Similar to #110, but here we have the option to fill the negatives by smoothing with a (1D) gaussian, where the window size can be chosen in accordance with the FWHM.
However, when using this method on the synthetic dataset, one get's a significant and probably negative impact on the 1Gen spectra:
See spectrum on the right side (median of each bin for 50 realizations). Note that the middle pannel, the unfolded spectrum, still looks quite reasonable.
vs the "true" spectrum from RAINIER.
My impression is that the effect is larger for the synthetic spectra, but it would need more time to investigate.