In [1]:
%pylab inline
In [2]:
from VOT import *
This is an example of calculating one of the built-in objects (PG1553, Crab Nebula etc.). It shows which effective area table was used and some other diagnostic information.
In [3]:
vt1 = VOT("PG1553")
In [4]:
from VOTPlot import Plot, PlotSpectrum
In [5]:
PlotSpectrum(vt1.VS)
In [6]:
Plot(vt1.VS, vt1.VR)
The first plot shows the LAT spectrum (blue) extrabolated out to VHE energies, the red curve is the EBL curve used and the green curve is the LAT spectrum with the EBL effects. The second plot shows the same blue and green curves from before along with the Effecitve Area curve used. The blue vertical lines are the 'safe energy range'.
This is the same calculation but with a different average zenith angle.
In [7]:
vt2 = VOT("PG1553", zenith=35)
In [8]:
vt3 = VOT("PG1553", zenith=35, eblModel="Kneiske")
In [9]:
Plot(vt3.VS, vt3.VR)
This is the same calculation but with a different EBL Model. Now, if you wanted to compare to the Crab, just do:
In [10]:
vtcrab = VOT("Crab")
In [11]:
vtCTA = VOT("PG1553", instrument="CTA", eblModel="Finke")
In [12]:
Plot(vtCTA.VS, vtCTA.VR)
The rate is stored in each of these variables so you can compare these:
In [13]:
"PG1553 is {:,.2f}% of the Crab".format(100.*(vt1.rate/vtcrab.rate))
Out[13]:
You can create you're own source with any of the functions in the 2FGL (powerlaw, curved powerlaw etc.) and with a few different EBL models. This is a work in progress and if there is a particular source type that you need, I'll add it in.
In [14]:
vtcustom = VOT("custom", eMin=0.1, eMax=100000, Nbins=10000, redshift=0.8955, eblModel='Dominguez', instrument='VERITAS', zenith=20, spectralModel='LogParabola', N0 = 1.359e-11,
alpha=-1.8772, beta=-0.067012, Eb = 0.9085)
In [15]:
Plot(vtcustom.VS, vtcustom.VR)
This is actually one of the built in sources:
In [16]:
vt4C = VOT("4C5517")
In [17]:
"4C5517 is {:,.4f}% of the Crab".format(100.*(vt4C.rate/vtcrab.rate))
Out[17]:
In [18]:
vtHESS = VOT("PG1553", instrument="HESS", zenith=45)
In [19]:
Plot(vtHESS.VS, vtHESS.VR)
You can get a JSON string as output if you like which is useful for websites.
In [5]:
vtjson = VOT("PG1553", output = "JSON")
And you can use JSON as input which is useful for websites.
In [6]:
vtjson2 = VOT(output = "JSON", input = "JSON", jsonString='[{"source":"custom", "eMin":0.1, "eMax":100000, "Nbins":10000, "redshift":0.8955, "eblModel":"Dominguez","instrument":"VERITAS", "zenith":20, "spectralModel":"LogParabola", "N0":1.359e-11, "alpha":-1.8772, "beta":-0.067012, "Eb":0.9085}]')
There's a really simple CLI right now.
python VOT.py --source custom --output JSON --input JSON --jsonInput '[{"source":"custom", "eMin":0.1, "eMax":100000, "Nbins":10000, "redshift":0.8955, "eblModel":"Dominguez","instrument":"VERITAS", "zenith":20, "spectralModel":"LogParabola", "N0":1.359e-11, "alpha":-1.8772, "beta":-0.067012, "Eb":0.9085}]'
In [7]:
vtpl2 = VOT("custom", eMin=0.1, eMax=100000, Nbins=10000, redshift=0.5846, eblModel='Dominguez', instrument='VERITAS', zenith=40, spectralModel='PowerLaw2', N = 1.7e-6, index = -2.26 , E1 = 0.1, E2 = 300)
In [8]:
Plot(vtpl2.VS, vtpl2.VR)
Some other examples (HESS2, HAWC)...
In [5]:
HESS2 = VOT("PG1553", instrument='HESS2')
In [6]:
Plot(HESS2.VS, HESS2.VR)
In [12]:
HAWC = VOT("Crab", instrument='HAWC')
In [ ]: