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

Fix/fill negatives gauss #113

Closed

Conversation

fzeiser
Copy link
Collaborator

@fzeiser fzeiser commented Mar 18, 2020

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.
ensemble_164Dy_synthetic_gauss

vs the "true" spectrum from RAINIER.

1Gen

My impression is that the effect is larger for the synthetic spectra, but it would need more time to investigate.

fzeiser added 7 commits March 11, 2020 11:07
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
@fzeiser
Copy link
Collaborator Author

fzeiser commented Mar 18, 2020

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.

@fzeiser fzeiser closed this Mar 18, 2020
@fzeiser
Copy link
Collaborator Author

fzeiser commented Mar 18, 2020

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:
fg_vs_product_164Dy_synthetic_gauss-1

vs RAINIER (rebinned the same way):
1Gen_rebinned

and the nld, gsf:
compare_gauss-1

fzeiser pushed a commit to fzeiser/ompy that referenced this pull request Mar 19, 2020
fzeiser pushed a commit that referenced this pull request Mar 19, 2020
This gave better results, see discussions in the PRs #110 and #113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant