diff --git a/flarestack/core/llh.py b/flarestack/core/llh.py index f2673c59..885be1ee 100644 --- a/flarestack/core/llh.py +++ b/flarestack/core/llh.py @@ -702,7 +702,6 @@ def calculate_test_statistic(self, params, weights, **kwargs): return 2.0 * np.sum(llh_value) -@LLH.register_subclass("standard") class StandardLLH(FixedEnergyLLH): fit_energy = True @@ -1063,7 +1062,6 @@ def return_injected_parameters(mh_dict): return res_dict -@LLH.register_subclass("standard_kde_enabled") class StandardKDEEnabledLLH(StandardLLH): def create_kwargs(self, data, pull_corrector, weight_f=None): kwargs = dict() diff --git a/flarestack/core/minimisation.py b/flarestack/core/minimisation.py index 2abfa9f0..1d9fb986 100644 --- a/flarestack/core/minimisation.py +++ b/flarestack/core/minimisation.py @@ -359,8 +359,6 @@ class FixedWeightMinimisationHandler(MinimisationHandler): compatible_llh = [ "spatial", "fixed_energy", - "standard", - "standard_kde_enabled", "standard_overlapping", "standard_matrix", "std_matrix_kde_enabled", @@ -1271,7 +1269,7 @@ def add_injector(self, season, sources): @MinimisationHandler.register_subclass("fit_weights") class FitWeightMinimisationHandler(FixedWeightMinimisationHandler): - compatible_llh = ["spatial", "fixed_energy", "standard", "standard_kde_enabled"] + compatible_llh = ["spatial", "fixed_energy", "standard_matrix", "std_matrix_kde_enabled"] compatible_negative_n_s = False def __init__(self, mh_dict): @@ -1487,7 +1485,7 @@ def corner_likelihood_scan( @MinimisationHandler.register_subclass("flare") class FlareMinimisationHandler(FixedWeightMinimisationHandler): - compatible_llh = ["spatial", "fixed_energy", "standard"] + compatible_llh = ["spatial", "fixed_energy", "standard_matrix"] compatible_negative_n_s = False def __init__(self, mh_dict): diff --git a/tests/test_full_analysis_chain.py b/tests/test_full_analysis_chain.py index a0488f77..9ce02e28 100644 --- a/tests/test_full_analysis_chain.py +++ b/tests/test_full_analysis_chain.py @@ -35,7 +35,7 @@ def test_full_chain(self): } llh_dict = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_sig_time_pdf": {"time_pdf_name": "steady"}, "llh_bkg_time_pdf": { "time_pdf_name": "steady", diff --git a/tests/test_likelihood_standard.py b/tests/test_likelihood_standard.py deleted file mode 100644 index ed579db8..00000000 --- a/tests/test_likelihood_standard.py +++ /dev/null @@ -1,68 +0,0 @@ -"""A standard time-integrated analysis is performed, using one year of -IceCube data (IC86_1). -""" -import logging -import unittest -import numpy as np -from flarestack.data.public import icecube_ps_3_year -from flarestack.utils.prepare_catalogue import ps_catalogue_name -from flarestack.core.unblinding import create_unblinder - -# Initialise Injectors/LLHs - -llh_dict = { - "llh_name": "standard", - "llh_sig_time_pdf": {"time_pdf_name": "steady"}, - "llh_bkg_time_pdf": { - "time_pdf_name": "steady", - }, - "llh_energy_pdf": {"energy_pdf_name": "power_law"}, -} - -# Loop over sin(dec) values - -sindecs = np.linspace(0.5, -0.5, 3) - - -# These results arise from high-statistics sensitivity calculations, -# and can be considered the "true" answers. The results we obtain will be -# compared to these values. - -true_parameters = [ - [0.0, 2.3746234433776863], - [0.0, 2.1278706029950163], - [3.118277154641447, 4.0], -] - - -class TestTimeIntegrated(unittest.TestCase): - def setUp(self): - pass - - def test_declination_sensitivity(self): - logging.info("Testing 'standard' LLH class") - - # Test three declinations - - for j, sindec in enumerate(sindecs): - unblind_dict = { - "name": "tests/test_llh_standard/", - "mh_name": "fixed_weights", - "dataset": icecube_ps_3_year.get_seasons("IC86-2011"), - "catalogue": ps_catalogue_name(sindec), - "llh_dict": llh_dict, - } - - ub = create_unblinder(unblind_dict) - key = [x for x in ub.res_dict.keys() if x != "TS"][0] - res = ub.res_dict[key] - - logging.info("Best fit values {0}".format(list(res["x"]))) - logging.info("Reference best fit {0}".format(true_parameters[j])) - - for i, x in enumerate(res["x"]): - self.assertAlmostEqual(x, true_parameters[j][i], delta=0.1) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_mh_fit_weights.py b/tests/test_mh_fit_weights.py index e9e2191d..18efb00e 100644 --- a/tests/test_mh_fit_weights.py +++ b/tests/test_mh_fit_weights.py @@ -11,7 +11,7 @@ # Initialise Injectors/LLHs llh_dict = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_sig_time_pdf": {"time_pdf_name": "steady"}, "llh_bkg_time_pdf": { "time_pdf_name": "steady", diff --git a/tests/test_mh_fixed_weights.py b/tests/test_mh_fixed_weights.py index 86aac2a5..bd475f84 100644 --- a/tests/test_mh_fixed_weights.py +++ b/tests/test_mh_fixed_weights.py @@ -10,7 +10,7 @@ # Initialise Injectors/LLHs llh_dict = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_sig_time_pdf": {"time_pdf_name": "steady"}, "llh_bkg_time_pdf": { "time_pdf_name": "steady", diff --git a/tests/test_mh_flare.py b/tests/test_mh_flare.py index e977c2eb..0fe343a5 100644 --- a/tests/test_mh_flare.py +++ b/tests/test_mh_flare.py @@ -20,7 +20,7 @@ llh_time = {"time_pdf_name": "custom_source_box"} unblind_llh = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_sig_time_pdf": llh_time, "llh_bkg_time_pdf": {"time_pdf_name": "steady"}, "llh_energy_pdf": llh_energy, diff --git a/tests/test_negative_ns.py b/tests/test_negative_ns.py index 889c28bf..4d626fa2 100644 --- a/tests/test_negative_ns.py +++ b/tests/test_negative_ns.py @@ -11,7 +11,7 @@ # Initialise Injectors/LLHs llh_dict = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_sig_time_pdf": {"time_pdf_name": "steady"}, "llh_bkg_time_pdf": { "time_pdf_name": "steady", diff --git a/tests/test_submitter.py b/tests/test_submitter.py index 20d62d86..506192eb 100644 --- a/tests/test_submitter.py +++ b/tests/test_submitter.py @@ -33,7 +33,7 @@ llh_energy = injection_energy llh_kwargs = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_energy_pdf": llh_energy, "llh_sig_time_pdf": llh_time, "llh_bkg_time_pdf": {"time_pdf_name": "steady"}, diff --git a/tests/test_time_pdfs.py b/tests/test_time_pdfs.py index ed3743cb..dd0db810 100644 --- a/tests/test_time_pdfs.py +++ b/tests/test_time_pdfs.py @@ -43,7 +43,7 @@ def test_declination_sensitivity(self): for i, t_pdf_dict in enumerate(time_pdfs): llh_dict = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_sig_time_pdf": t_pdf_dict, "llh_bkg_time_pdf": { "time_pdf_name": "steady", diff --git a/tests/test_util_custom_dataset.py b/tests/test_util_custom_dataset.py index 8bf1e14d..5ed24f14 100644 --- a/tests/test_util_custom_dataset.py +++ b/tests/test_util_custom_dataset.py @@ -22,7 +22,7 @@ def test_custom_dataset(self): logging.info("Testing custom_dataset util function.") llh_dict = { - "llh_name": "standard", + "llh_name": "standard_matrix", "llh_sig_time_pdf": { "time_pdf_name": "box", "pre_window": 0.0,