示例#1
0
    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,
                                          nopull=True)
示例#2
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))
    histlite.plot1d(ax, h, histtype='step', label=l, color=c)