# Path: environ.py
# FERMI_CATALOG_DIR = os.environ.get('FERMI_CATALOG_DIR', '')


import numpy
import matplotlib.pyplot as plt
from Plot.PlotLibrary import *
from Catalog.ReadFermiCatalog import *
from environ import FERMI_CATALOG_DIR
# author David Sanchez david.sanchez@lapp.in2p3.fr

# ------ Imports --------------- #
# ------------------------------ #
#look for this 2FGL source
#source = "2FGL J1015.1+4925"
#source = "1FHL J2158.8-3013"
source = "3FGL J2158.8-3013"
Cat = FermiCatalogReader(source,FERMI_CATALOG_DIR,"e2dnde","TeV")

#print some information
print "2FGL association ",Cat.Association('3FGL')
print "3FGL Name ",Cat.Association('2FHL','3FGL_name')
print "3FGL Var Index ",Cat.GetVarIndex("3FGL")


#create a spectrum for a given catalog and compute the model+butterfly

# Path: environ.py
# FERMI_CATALOG_DIR = os.environ.get('FERMI_CATALOG_DIR', '')


# Path: Example/ExReadFermiCatalog.py
import numpy
import matplotlib.pyplot as plt
from Plot.PlotLibrary import *
from Catalog.ReadFermiCatalog import *
from environ import FERMI_CATALOG_DIR

# author David Sanchez david.sanchez@lapp.in2p3.fr

# ------ Imports --------------- #
# ------------------------------ #
#look for this 2FGL source
#source = "2FGL J1015.1+4925"
#source = "1FHL J2158.8-3013"
source = "3FGL J2158.8-3013"
Cat = FermiCatalogReader(source,FERMI_CATALOG_DIR,"e2dnde","TeV")

#print some information
print "2FGL association ",Cat.Association('3FGL')
print "3FGL Name ",Cat.Association('2FHL','3FGL_name')
print "3FGL Var Index ",Cat.GetVarIndex("3FGL")


#create a spectrum for a given catalog and compute the model+butterfly

Cat.MakeSpectrum("3FGL",1e-4,0.3)