-
Notifications
You must be signed in to change notification settings - Fork 24
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
Interpolate psf #156
Interpolate psf #156
Conversation
Codecov Report
@@ Coverage Diff @@
## master #156 +/- ##
==========================================
+ Coverage 89.83% 90.13% +0.29%
==========================================
Files 42 42
Lines 1594 1642 +48
==========================================
+ Hits 1432 1480 +48
Misses 162 162
Continue to review full report at Codecov.
|
Hi @maxnoe can you approve the PR? as I wrote above, your comments are already implemented |
stds = np.empty(n_en) | ||
for i_en in np.arange(n_en): | ||
w = matrix[i_en, :] | ||
if np.sum(w) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For weights to make sense, they have to be all >= 0, not just the sum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually there should be no negative weights, but it can happen at low energies that all bins are empty and you have 0s everywhere, this check is meant exactly for such a case
Looks good to me, sorry for the delay @jsitarek |
thx for quick feedback @maxnoe, I merged the PR |
I wanted to give @HealthyPear a chance to review as well, but I think it's ok |
I was about to re-start, but I understand it was open since a while... |
Hi, sorry @HealthyPear, since there were no comments from you before in this PR I did not think that you wanted to still have a look into this. If you have any further comments, please let me know and I can make a separate PR with them. |
a function to interpolate PSF tables. I made it in a similar style like the other two interpolation functions. One difference is that I added an option to interpolate over cumulative distribution. In principle this could help in the binning is fine and thus event statistics are sparse. For the tests that I did I haven't seen any significant difference, but the performance might depend on a particular use case. The default is to interpolate over differential distribution (which is slightly simpler)
@maxnoe I incorporated your comments about solid cone function, please let me know if you have any further comments