from skylab.ps_injector_stack_100 import PointSourceInjector
from skylab.psLLH_stack import MultiPointSourceLLH
from skylab.utils import poisson_weight
from optparse import OptionParser
import argparse
## I'll have to add an argument later to do specific weighting schemes beyond this script, but for now I'll just add the ability manually. ##
sys.path.append("/home/brelethford/Documents/IceCube_Research/Scripts/AGN_Core")
projfolder='/home/brelethford/Documents/IceCube_Research/'

## Read in background trials previously logged ##

import datatest_stack_bins

llh_single = datatest_stack_bins.init(energy=True)

mc = datatest_stack_bins.MC()

##I have to load in whichever declination I'm working on at the moment...##

parser = OptionParser (usage = '%prog [options]')
parser.add_option ('--dec', dest = 'dec', type = float,
                default = 0., metavar = 'DEC',
                help = 'sin of the source declination.')

opts, args = parser.parse_args ()
dec_deg = np.arcsin(opts.dec) * 180./np.pi


datafolder='/data/user/brelethford/Output/all_sky_sensitivity/results/single_stacked/bin_test/dec{0:+010.5}/'.format(dec_deg)

outfolder='/data/user/brelethford/Output/all_sky_sensitivity/results/single_stacked/bin_test/gamma/3.0_E100/dec{0:+010.5}/'.format(dec_deg)
Пример #2
0
from scipy.stats import chi2
import healpy as hp
import itertools
from scipy.signal import convolve2d
from skylab import ps_injector_stack
#from skylab.ps_injector_stack import PointSourceInjector
livetime = 332.61 * 86400
# Okay, what I have to do here is convert the mu into flux by using a PS injector with 100TeV as the reference energy. To do this, I'm pretty much gonna follow the sensitivity calculation script in bin test

###This script imports the sensitivities from the submitter and plots them.###
#datafolder = '/data/user/brelethford/Output/all_sky_sensitivity/results/box/' ##Remember to change this depending on which results you're looking at!##
#################################
sys.path.append(
    "/home/brelethford/Documents/IceCube_Research/Scripts/AGN_Core")
import datatest_stack_bins
mc = datatest_stack_bins.MC(
)  #I'll need this to refill the point source injections

misc.tex_mpl_rc()
propsmall = mpl.font_manager.FontProperties(size='small')
propxsmall = mpl.font_manager.FontProperties(size='x-small')
propxxsmall = mpl.font_manager.FontProperties(size='xx-small')
w = 4

#stefanfolder = '/data/user/brelethford/Output/all_sky_sensitivity/stefan_c/IC86-I/'
#stefanfiles = [cache.load(stefanfolder+file) for file in os.listdir(stefanfolder) if file.endswith('.pkl')]

#stefan_flux = [file[2.0]['flux'][0] for file in stefanfiles]
#stefan_inj = [file[2.0]['mu'][0] for file in stefanfiles]
#stefan_sindec = [np.sin(file['dec']) for file in stefanfiles]

#results_stefan = sorted(zip(stefan_sindec,stefan_inj,stefan_flux))