Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d234d5e
Change FastResponseAnalysis and PointSourceFollowup to let them use m…
christophra Jun 4, 2024
304a43d
can now generate report with multiple datasets in skymaps and skylab …
christophra Jun 4, 2024
14bdea0
ReportGenerator: distinguish results table by source type, no skymap_…
christophra Jun 13, 2024
9a2b51f
MultiFollowup: change to Greco with factor 2 fix
christophra Jun 13, 2024
10ae42d
plotting_utils: when loading default settings, first reset to MPL def…
christophra Jun 13, 2024
dfa76d1
fix llh_exp property to combine different dtypes
christophra Jun 14, 2024
60e6a9b
use all available data seasons 2011-2022, make sure to only add 2020 …
christophra Jun 14, 2024
6ea0aa7
PointSourceFollowup: allow setting spectral index in constructor
christophra Jun 14, 2024
a423f1e
Changes for floating index: print and save fit parameters, injector E…
christophra Jun 14, 2024
789aeb5
add sample enum to coincident_events
christophra Jun 14, 2024
d5af62a
plot_skymap: edit legend
christophra Jun 14, 2024
15fbba9
add docstrings to new methods or reinstate docstrings that I dropped …
christophra Jun 14, 2024
72c348c
FRA_ifelse: make dNdE plot consistent again
christophra Jul 2, 2024
400d679
First version of inheritance-style implementation to generate a full …
christophra Jul 2, 2024
e565a51
rename for consistency
christophra Jul 2, 2024
e2c9fcb
increase resolution in plotting settings from MPL default 100 to 300
christophra Jul 10, 2024
0a9513b
plot_skymap_zoom: use different styles for dataset, and to that end a…
christophra Jul 19, 2024
d960c05
re-enable closing skymap_zoom figure as it was before
christophra Jul 19, 2024
a35de06
fix a few bugs, slightly change labeling of upper limit plot, include…
christophra Jul 22, 2024
c7cb69e
in FRA base class: save best fit gamma in case of floating index, as …
christophra Jul 22, 2024
a26d233
Individual dataset style and label now also in plot_skymap, relativel…
christophra Jul 24, 2024
721b59a
AlertFollowup: paths for sensitivity and BG trials from hardcoded in …
christophra Jul 29, 2024
d5a0893
MultiPriorFollowup, MultiAlertFollowup; background trial handling sti…
christophra Jul 29, 2024
3650b77
MultiFRA: fix constructor and string representation, insert debug sta…
christophra Aug 26, 2024
e4a5312
included trace messages for DEBUG log level
christophra Sep 26, 2024
5fd8447
with _inherit default, make class names consistent
christophra Sep 26, 2024
1e77c26
now MultiAlertFollowup can use cached BG trials
christophra Sep 26, 2024
484180f
class rename
christophra Sep 26, 2024
d045caa
dNdE plot with line style instead of colors
christophra Sep 26, 2024
7d2ca4a
shorten line
christophra Jun 6, 2025
d979a2d
access common llh_exp with unified order and precision for all samples
christophra Jun 6, 2025
6fe6c9d
Add DNN followup and handling of jitter settings
christophra Jun 6, 2025
773f499
allow computing differential sensitivity
christophra Jun 6, 2025
6ac1375
fix setting seed for reproducible scrambles
christophra Jun 6, 2025
71426b9
labels in skymap plot
christophra Jun 6, 2025
7da7e7e
MultiPriorFollowup: drop extraneous arg when filling injector
christophra Jun 10, 2026
db4f220
Add followup classes for DNN Cascades
christophra Jun 10, 2026
16ee617
belatedly commit skymap plotting updates used for 2025 proceedings
christophra Jun 10, 2026
ec3d52d
Background days added to livestream must be configurable per followup…
christophra Jun 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions fast_response/AlertFollowup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ class AlertFollowup(PriorFollowup):
_fix_index = True
_float_index = not _fix_index
_index = 2.5
_bg_trial_dir = os.path.join(
'/data/ana/analyses/NuSources/',
'2021_v2_alert_stacking_FRA/fast_response/',
'alert_precomputed_trials/'
)
_sens_dir = '/data/ana/analyses/NuSources/2021_v2_alert_stacking_FRA/' \
+ 'fast_response/reference_sensitivity_curves/'
# These directories will need to changed for each AlertFollowup LLH configuration
# i.e. dataset combination and such

def run_background_trials(self, ntrials = 1000):
r"""For alert events with specific time windows,
Expand All @@ -36,15 +45,11 @@ def run_background_trials(self, ntrials = 1000):
test-statistic distribution with weighting
from alert event spatial prior
"""

current_rate = self.llh.nbackground / (self.duration * 86400.) * 1000.
closest_rate = sensitivity_utils.find_nearest(np.linspace(6.2, 7.2, 6), current_rate)

bg_trial_dir = '/data/ana/analyses/NuSources/' \
+ '2021_v2_alert_stacking_FRA/fast_response/' \
+ 'alert_precomputed_trials/'

pre_ts_array = sparse.load_npz(
bg_trial_dir
self._bg_trial_dir
+ 'precomputed_trials_delta_t_'
+ '{:.2e}_trials_rate_{:.1f}_low_stats.npz'.format(
self.duration * 86400., closest_rate, self.duration * 86400.))
Expand Down Expand Up @@ -80,10 +85,9 @@ def ps_sens_range(self):
highest sensitivity within the 90% contour of the skymap
"""

sens_dir = '/data/ana/analyses/NuSources/2021_v2_alert_stacking_FRA/' \
+ 'fast_response/reference_sensitivity_curves/'
filename = os.path.join(self._sens_dir, f'ideal_ps_sensitivity_deltaT_{self.duration:.2e}_50CL.pkl')

with open(f'{sens_dir}ideal_ps_sensitivity_deltaT_{self.duration:.2e}_50CL.pkl', 'rb') as f:
with open(filename, 'rb') as f:
ideal = pickle.load(f, encoding='bytes')
delta_t = self.duration * 86400.
src_theta, src_phi = hp.pix2ang(self.nside, self.ipix_90)
Expand All @@ -101,10 +105,9 @@ def sens_range_plot(self):
"""
fig, ax = plt.subplots()

sens_dir = '/data/ana/analyses/NuSources/2021_v2_alert_stacking_FRA/' \
+ 'fast_response/reference_sensitivity_curves/'
filename = os.path.join(self._sens_dir, f'ideal_ps_sensitivity_deltaT_{self.duration:.2e}_50CL.pkl')

with open(f'{sens_dir}ideal_ps_sensitivity_deltaT_{self.duration:.2e}_50CL.pkl', 'rb') as f:
with open(filename, 'rb') as f:
ideal = pickle.load(f, encoding='bytes')
delta_t = self.duration * 86400.
plt.plot(ideal[b'sinDec'], np.array(ideal[b'sensitivity'])*delta_t*1e6, lw=3, ls='-',
Expand Down
272 changes: 216 additions & 56 deletions fast_response/FastResponseAnalysis.py

Large diffs are not rendered by default.

Loading