FitLPmodelAndMakeXmlCtools.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:CTAtools 作者: davidsanchez 项目源码 文件源码
def Get3FGL(Cat,xdata,ydata,dydata):
    #create a spectrum for a given catalog and compute the model+butterfly
    # 3FGL CATALOG
    Cat.MakeSpectrum("3FGL",1e-4,0.3)
    enerbut,but,enerphi,phi = Cat.Plot("3FGL")

    # read DATA Point from 3FGL CATALOG
    em3FGL,ep3FGL,flux3FGL,dflux3FGL =  Cat.GetDataPoints('3FGL') #energy in TeV since the user ask for that in the call of Cat
    ener3FGL = numpy.sqrt(em3FGL*ep3FGL) 
    dem3FGL = ener3FGL-em3FGL
    dep3FGL = ep3FGL-ener3FGL
    c=Cat.ReadPL('3FGL')[3]
    e2dnde3FGL = (-c+1)*flux3FGL*numpy.power(ener3FGL*1e6,-c+2)/(numpy.power((ep3FGL*1e6),-c+1)-numpy.power((em3FGL*1e6),-c+1))*1.6e-6
    de2dnde3FGL = e2dnde3FGL*dflux3FGL/flux3FGL

    for i in xrange(len(ener3FGL)):
        xdata.append(numpy.log10(ener3FGL[i]))
        ydata.append(numpy.log10(e2dnde3FGL[i]))
        dydata.append(numpy.log10(de2dnde3FGL[i]))

    return enerbut,but,enerphi,phi,ener3FGL, e2dnde3FGL, dem3FGL, dep3FGL, de2dnde3FGL
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号