-
Notifications
You must be signed in to change notification settings - Fork 7
Use King function for Northern Tracks PSF #444
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cuts time in Injector.create_dataset() from ~1500 ms to ~600 ms
by a factor ~2 when drawing ~175 events from 11.5e6 MC events across 1000 sources
numpy broadcasting is much faster than a list comprehension
There's no point in calculating this tens of thousands of times, since it's independent of the source for a steady time pdf
…ially_coincident_indices Unexpected bottlenecks: - Repeatedly slicing into astropy Tables (overhead from copying units) - Temporary arrays in ra_dist and angular_distance
Keys appear as before, but values are only evaluated when accessed. Speeds up initialization when gamma is not being fitted.
This reverts commit 9afa53e13556e783a73909fa2751ed98bad35f27.
The 2nd-order spline interpolation does not necessarily reflect the normalization of the underyling signal or background energy PDFs
180 ms -> 11 ms for 22k sources
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#442 attempted to fix a systematic shift in n_s and gamma in large-catalog stacking against the Northern Tracks sample by renormalizing the spline-parameterized PSF to the "source box." This would have fixed the problem had the PSF been normalized to the solid angle of the sample, which was only true to the ~1% level. This is not surprising in retrospect, as the least-squares fit that produced the spline does not guarantee that the interpolated function integrates to any particular value over one of its dimensions.
This PR enforces the normalization more robustly by parameterizing the PSF with a set of splines that describe the parameters of a (normalized, integrable) King function, rather than the PSF itself, and obviates #442.