Skip to content

Conversation

jvansanten
Copy link
Contributor

@jvansanten jvansanten commented Sep 4, 2025

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

jvansanten added 30 commits July 8, 2025 15:55
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
This was referenced Sep 4, 2025
@jvansanten jvansanten merged commit 435a6a4 into icecube:master Sep 5, 2025
10 of 13 checks passed
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.

1 participant