Commit 435a6a4
authored
Use King function for Northern Tracks PSF (#444)
* Use astropy Tables for data everywhere
* Load npz file if present
* Improve cache coherence in NTSeason.simulate_background
Cuts time in Injector.create_dataset() from ~1500 ms to ~600 ms
* CircularGaussian: do not attempt to modify data in-place
* Blacken/isorten following #415
* Use Table for EffectiveAreaInjector
* Annotate factory functions
* Avoid modifying columns in place
* Use instance variables in NorthernTracksKDE
* Normalize KDE PDF to region of interest
* Speed up TableInjector
by a factor ~2 when drawing ~175 events from 11.5e6 MC events across 1000 sources
* Speed up StaticFloor
numpy broadcasting is much faster than a list comprehension
* Cache effective injection time for steady sources
There's no point in calculating this tens of thousands of times, since it's independent of the source for a steady time pdf
* Remove upper bound on n_s
* Squeeze the last bits of fluff out of StdMatrixKDEEnabledLLH.get_spatially_coincident_indices
Unexpected bottlenecks:
- Repeatedly slicing into astropy Tables (overhead from copying units)
- Temporary arrays in ra_dist and angular_distance
* Evaluate SoB for different gammas lazily
Keys appear as before, but values are only evaluated when accessed. Speeds up initialization when gamma is not being fitted.
* Use less accurate (but much faster) angular distance calculation in NorthernTracksKDE
* Annotate PDF factory functions
* HACK: allow StdMatrixKDEEnabledLLH to use CircularGaussian pdf
* Revert "Annotate PDF factory functions"
This reverts commit 9afa53e13556e783a73909fa2751ed98bad35f27.
* Normalize gaussian PDF
* WIP: King function PSF
* chore: annotate BaseInjector
* Allow Season to simulate background only in the source box
* Evaluate energy SoB lazily
* Add log of King PDF
* Add an option to disable energy S/B interpolation
The 2nd-order spline interpolation does not necessarily reflect the normalization of the underyling signal or background energy PDFs
* Use splines for King PDF parameters
* Speed up make_season_weight 10x
180 ms -> 11 ms for 22k sources
* Microoptimization: sparse matrix projection 25% faster
* Microoptimization: slice result of background pdf calculation instead of inputs
* mypy cleanup
* Guard annotation-only imports
* Cosmetic: raw string for latex
* Return excluded events from create_dataset in unblinded injectors
* Consider excluded events in flare likelihoods (but require ==0)
* Handle unbounded n_s in 1D llh scan1 parent 4b25a5f commit 435a6a4
19 files changed
Lines changed: 928 additions & 406 deletions
File tree
- flarestack
- analyses
- angular_error_floor
- ccsn/necker_2019
- core
- data
- icecube
- northern_tracks
- public/icecube
- icecube_utils
- utils
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | | - | |
97 | | - | |
98 | | - | |
| 95 | + | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
| |||
Lines changed: 18 additions & 20 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
132 | | - | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| |||
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
200 | 226 | | |
201 | 227 | | |
202 | 228 | | |
| |||
218 | 244 | | |
219 | 245 | | |
220 | 246 | | |
221 | | - | |
| 247 | + | |
222 | 248 | | |
223 | | - | |
| 249 | + | |
224 | 250 | | |
225 | 251 | | |
226 | 252 | | |
| |||
252 | 278 | | |
253 | 279 | | |
254 | 280 | | |
255 | | - | |
| 281 | + | |
256 | 282 | | |
257 | 283 | | |
258 | 284 | | |
| |||
278 | 304 | | |
279 | 305 | | |
280 | 306 | | |
281 | | - | |
282 | | - | |
283 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
284 | 311 | | |
285 | 312 | | |
286 | 313 | | |
287 | 314 | | |
288 | 315 | | |
289 | | - | |
| 316 | + | |
290 | 317 | | |
291 | 318 | | |
292 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
0 commit comments