Example #1
0
def gtlike_analysis(roi, name, plotdir):
    gtlike = Gtlike(roi)
    like = gtlike

    print_summary = lambda: print_summary(like, maxdist=10)

    print_summary()
    paranoid_gtlike_fit(like)
    print_summary()

    results = sourcedict(like, name)

    results['powerlaw_upper_limit'] = powerlaw_upper_limit(
        like,
        name,
        powerlaw_index=2.1,
        emin=emin,
        emax=emax,
        cl=.95,
        delta_log_like_limits=10)

    sed = GtlikeSED(like, name, always_upper_limit=True)
    sed.plot('%s/sed_gtlike_%s.png' % (plotdir, name))
    sed.save('%s/sed_gtlike_%s.yaml' % (plotdir, name))

    return results
Example #2
0
def pointlike_analysis(roi, name, plotdir):

    print_summary = lambda: roi.print_summary(galactic=True, maxdist=10)

    print_summary()
    fit_prefactor(roi, name) 
    roi.fit()
    print_summary()

    results  = sourcedict(roi, name)

    results['powerlaw_upper_limit'] = powerlaw_upper_limit(roi, name, powerlaw_index=2.1, 
                                                           emin=emin, emax=emax, cl=.95)

    roi.plot_sed(which=name, filename='%s/sed_pointlike_%s.png' % (plotdir,name), use_ergs=True)

    return results
Example #3
0
def gtlike_analysis(roi, name, plotdir):
    gtlike = Gtlike(roi)
    like = gtlike

    print_summary = lambda: print_summary(like, maxdist=10)

    print_summary()
    paranoid_gtlike_fit(like)
    print_summary()

    results=sourcedict(like, name)

    results['powerlaw_upper_limit'] = powerlaw_upper_limit(like, name, powerlaw_index=2.1,
                                                           emin=emin, emax=emax, cl=.95, delta_log_like_limits=10)

    sed = GtlikeSED(like, name, always_upper_limit=True)
    sed.plot('%s/sed_gtlike_%s.png' % (plotdir,name))
    sed.save('%s/sed_gtlike_%s.yaml' % (plotdir,name))

    return results
Example #4
0
def pointlike_analysis(roi, name, plotdir):

    print_summary = lambda: roi.print_summary(galactic=True, maxdist=10)

    print_summary()
    fit_prefactor(roi, name)
    roi.fit()
    print_summary()

    results = sourcedict(roi, name)

    results['powerlaw_upper_limit'] = powerlaw_upper_limit(roi,
                                                           name,
                                                           powerlaw_index=2.1,
                                                           emin=emin,
                                                           emax=emax,
                                                           cl=.95)

    roi.plot_sed(which=name,
                 filename='%s/sed_pointlike_%s.png' % (plotdir, name),
                 use_ergs=True)

    return results