Пример #1
0
    flux = np.array(params['flux'])
    modelweights = {'flux': flux}

##load llh and assoc. MC
if catalog == 'WHSP_Blazars':
    import load_mstacking
    if mese:
        if sirin:
            llh = load_mstacking.load_7yr_mese_nospline_79()
        else:
            llh = load_mstacking.load_7yr_mese()
    else:
        if sirin:
            llh = load_mstacking.load_7yr_nospline_79()
        else:
            llh = load_mstacking.load_7yr()
    MC = load_mstacking.monte_carlo(llh)
else:
    import load_j7yr as datascript
    if years == 7:
        if mese:
            llh = datascript.load7yr_mese(mode='all', sirin=sirin)
        else:
            llh = datascript.load7yr(mode='all', sirin=sirin)
    #The following catalogs used sirins IC79 and no pull correct of 1.1774 for the first 4yrs of data.
    elif catalog == '4yr_Starburst' or catalog == 'blackhole' or catalog == 'SNR_noPWN' or catalog == 'SNR_cloud' or catalog == 'SNR_PWN':
        if years == 3:
            llh = datascript.load3yr(mode='box', sirin=True, nopull=True)
        elif years == 4:
            llh = datascript.load4yr(mode='box', sirin=True, nopull=True)
    elif catalog == 'Milagro17':
Пример #2
0
    flux = np.array(params['flux'])
    modelweights = {'flux': flux}

##load llhmodel and assoc. MC
if catalog == 'WHSP_Blazars' or mhubertest:
    import load_mstacking
    if mese:
        if sirin:
            llhmodel = load_mstacking.load_7yr_mese_nospline_79()
        else:
            llhmodel = load_mstacking.load_7yr_mese()
    else:
        if sirin:
            llhmodel = load_mstacking.load_7yr_nospline_79()
        else:
            llhmodel = load_mstacking.load_7yr()
    MC = load_mstacking.monte_carlo(llhmodel)
else:
    import load_PS7yr as datascript
    if years == 7:
        if mese:
            llhmodel = datascript.load7yr_mese(energy=True,
                                               mode='all',
                                               sirin=sirin)
            MC = datascript.loadMC7yr_mese(sirin=sirin)
    #The following catalogs used sirins IC79 and no pull correct of 1.1774 for the first 4yrs of data.
    elif catalog == '4yr_Starburst' or catalog == 'SNR_noPWN' or catalog == 'SNR_cloud' or catalog == 'SNR_PWN':
        if years == 3:
            llhmodel = datascript.load3yr(energy=True,
                                          mode='all',
                                          sirin=True,
Пример #3
0
########## mhuber's 7yr sample #########

llh40 = load_mstacking.ic40()
llh59 = load_mstacking.ic59()
llh79 = load_mstacking.ic79b()
llh86I = load_mstacking.ic86_I()
llh86II = load_mstacking.ic86_2012()

llh = [llh40, llh59, llh79, llh86I, llh86II]
exp = []
for l in llh:
    exp.append(l.exp)
##Also have to load all at once in order to get the mc in a good format. Probably can do this separately, but this way ensures I use the exact right MC.

llh7yr = load_mstacking.load_7yr()
mc = load_mstacking.monte_carlo(llh7yr)

##Now I have exp and mc for all 7 yrs. plot. The framework for plotting is already set up, so let's just make sure the info is in a manner it's used to.

bins = 80

### Energy ###

fig_energyhist = plt.figure(figsize=(w, .75 * w))
ax = plt.gca()
labels = ['IC40', 'IC59', 'IC79', 'IC86I', 'IC86II-IV']
colors = ['purple', 'green', 'blue', 'red', 'orange']

for i, l, c in zip(exp, labels, colors):
    h = histlite.hist(10**(i['logE']), bins=bins, log=True, range=(10, 1e7))