コード例 #1
0
def init79(energy=False, stacking=True, decorr=False, mode='all', **kwargs):
    if decorr:
        arr_exp = cache.load(filename_pickle + "IC79/noMESE/exp.pickle")
        arr_mc = cache.load(filename_pickle + "IC79/noMESE/mc.pickle")
    else:
        arr_exp = cache.load(filename_pickle + "IC79/exp.pickle")
        arr_mc = cache.load(filename_pickle + "IC79/mc.pickle")

    dec_bins = np.unique(
        np.concatenate([
            np.linspace(-1., -0.75, 10 + 1),
            np.linspace(-0.75, 0.0, 15 + 1),
            np.linspace(0.0, 1., 20 + 1),
        ]))

    energy_bins = [np.linspace(2., 9., 67 + 1), dec_bins]

    if energy:

        llh_model = EnergyLLH(energy_bins, sinDec_bins=dec_bins)

        #llh_model = EnergyLLH(sinDec_bins=dec_bins(50),#min(50, Nexp // 50),
        #                      sinDec_range=[-1., 1.],
        #                      logE_bins=min(50, Nexp // 50), #energybins(50)
        #                      logE_range=[[0.9 * min(arr_exp["logE"].min(),
        #                                               arr_mc["logE"].min()),
        #                                     1.1 * max(arr_exp["logE"].max(),
        #                                               arr_mc["logE"].max())],
        #                                     [-1., 1.]])
    else:

        llh_model = ClassicLLH(  #["logE"], min(50, Nexp // 50),
            #twodim_range=[0.9 * arr_mc["logE"].min(),
            #             1.1 * arr_mc["logE"].max()],
            sinDec_bins=dec_bins,
            sinDec_range=[-1., 1.])

    if stacking:
        llh = StackingPointSourceLLH(arr_exp,
                                     arr_mc,
                                     livetime=livetime_IC79,
                                     llh_model=llh_model,
                                     mode=mode,
                                     seed=np.random.randint(2**32),
                                     **kwargs)
    else:
        llh = PointSourceLLH(arr_exp,
                             arr_mc,
                             livetime=livetime_IC79,
                             llh_model=llh_model,
                             mode=mode,
                             seed=np.random.randint(2**32),
                             **kwargs)
    return llh
コード例 #2
0
def init40(energy=False, stacking=True, mode='all', nopull=False, **kwargs):
    if nopull:
        arr_exp = cache.load(filename_pickle + "nopull/sirin_IC40/exp.pickle")
        arr_mc = cache.load(filename_pickle + "nopull/sirin_IC40/mc.pickle")
    else:
        arr_exp = cache.load(filename_pickle + "IC40/exp.pickle")
        arr_mc = cache.load(filename_pickle + "IC40/mc.pickle")

    dec_bins = np.unique(
        np.concatenate([
            np.linspace(-1., -0.25, 10 + 1),
            np.linspace(-0.25, 0.0, 5 + 1),
            np.linspace(0.0, 1., 10 + 1),
        ]))

    dec_bins_logE = np.unique(
        np.concatenate([
            np.linspace(-1., -0.25, 10 + 1),
            np.linspace(-0.25, 0.0, 10 + 1),
            np.linspace(0.0, 1., 10 + 1),
        ]))
    #These binnings are done, year specifically, in load.py from stefan.
    energy_bins = [np.linspace(2., 9., 75 + 1), dec_bins_logE]

    if energy:

        llh_model = EnergyLLH(energy_bins, sinDec_bins=dec_bins)

    else:

        llh_model = ClassicLLH(sinDec_bins=dec_bins, sinDec_range=[-1., 1.])
    if stacking:
        llh = StackingPointSourceLLH(arr_exp,
                                     arr_mc,
                                     livetime=livetime_IC40,
                                     llh_model=llh_model,
                                     mode=mode,
                                     seed=np.random.randint(2**32),
                                     **kwargs)
    else:
        llh = PointSourceLLH(arr_exp,
                             arr_mc,
                             livetime=livetime_IC40,
                             llh_model=llh_model,
                             mode=mode,
                             seed=np.random.randint(2**32),
                             **kwargs)

    return llh
コード例 #3
0
def initMESE3yr(energy=False, stacking=True, mode='all', **kwargs):
    arr_exp = cache.load(filename_pickle + "MESE/exp3yr.pickle")
    arr_mc = cache.load(filename_pickle + "MESE/mc.pickle")

    dec_bins = np.unique(
        np.concatenate([
            np.linspace(-1., -0.92, 3 + 1),
            np.linspace(-0.92, hem, 10 + 1),
        ]))

    energy_bins = [
        np.linspace(2., 8.5, 40 + 1),
        np.linspace(-1., hem, 4 + 1),
    ]

    arr_mc = arr_mc[arr_mc["logE"] > 1.]

    if energy:

        llh_model = EnergyLLH(energy_bins, sinDec_bins=dec_bins)

    else:

        llh_model = ClassicLLH(  #["logE"], min(50, Nexp // 50),
            #twodim_range=[0.9 * arr_mc["logE"].min(),
            #             1.1 * arr_mc["logE"].max()],
            sinDec_bins=dec_bins,
            sinDec_range=[-1., 1.])

    if stacking:
        llh = StackingPointSourceLLH(arr_exp,
                                     arr_mc,
                                     livetime=livetimeMESE3yr,
                                     llh_model=llh_model,
                                     mode=mode,
                                     seed=np.random.randint(2**32),
                                     **kwargs)
    else:
        llh = PointSourceLLH(arr_exp,
                             arr_mc,
                             livetime=livetimeMESE3yr,
                             llh_model=llh_model,
                             mode=mode,
                             seed=np.random.randint(2**32),
                             **kwargs)

    return llh
コード例 #4
0
def init3yr(energy=False, stacking=True, decorr=False, mode='all', **kwargs):
    if decorr:
        arr_exp = cache.load(filename_pickle + "epinat_3yr/noMESE/exp.pickle")
        arr_mc = cache.load(filename_pickle + "epinat_3yr/noMESE/mc.pickle")
    else:
        arr_exp = cache.load(filename_pickle + "epinat_3yr/exp.pickle")
        arr_mc = cache.load(filename_pickle + "epinat_3yr/mc.pickle")
    dec_bins = np.unique(
        np.concatenate([
            np.linspace(-1., -0.93, 4 + 1),
            np.linspace(-0.93, -0.3, 10 + 1),
            np.linspace(-0.3, 0.05, 9 + 1),
            np.linspace(0.05, 1., 18 + 1),
        ]))

    energy_bins = [np.linspace(1., 9.5, 50 + 1), dec_bins]

    if energy:

        llh_model = EnergyLLH(energy_bins, sinDec_bins=dec_bins)

    else:

        llh_model = ClassicLLH(  #["logE"], min(50, Nexp // 50),
            #twodim_range=[0.9 * arr_mc["logE"].min(),
            #             1.1 * arr_mc["logE"].max()],
            sinDec_bins=dec_bins,
            sinDec_range=[-1., 1.])

    if stacking:
        llh = StackingPointSourceLLH(arr_exp,
                                     arr_mc,
                                     livetime=livetime3yr,
                                     llh_model=llh_model,
                                     mode=mode,
                                     seed=np.random.randint(2**32),
                                     **kwargs)
    else:
        llh = PointSourceLLH(arr_exp,
                             arr_mc,
                             livetime=livetime3yr,
                             llh_model=llh_model,
                             mode=mode,
                             seed=np.random.randint(2**32),
                             **kwargs)

    return llh