Exemplo n.º 1
0
    (castro, test_dict) = tscube.test_spectra_of_peak(peaks[0])

    nll = castro[2]
    fig, ax = plotNLL_v_Flux(nll, flux_type)

    fig2, ax2, im2, ztmp2 = plotCastro(castro, ylims=flux_lims, nstep=100)

    spec_pl = test_dict["PowerLaw"]["Spectrum"]
    spec_lp = test_dict["LogParabola"]["Spectrum"]
    spec_pc = test_dict["PLExpCutoff"]["Spectrum"]

    fig3, ax3 = plotSED(castro,
                        ylims=flux_lims,
                        TS_thresh=2.0,
                        specVals=[spec_pl])

    result_pl = test_dict["PowerLaw"]["Result"]
    result_lp = test_dict["LogParabola"]["Result"]
    result_pc = test_dict["PLExpCutoff"]["Result"]
    ts_pl = test_dict["PowerLaw"]["TS"]
    ts_lp = test_dict["LogParabola"]["TS"]
    ts_pc = test_dict["PLExpCutoff"]["TS"]

    print("TS for PL index = 2:  %.1f" % max_ts)
    print("Cumulative TS:        %.1f" % castro.ts_vals().sum())
    print("TS for PL index free: %.1f (Index = %.2f)" % (ts_pl, result_pl[1]))
    print("TS for LogParabola:   %.1f (Index = %.2f, Beta = %.2f)" %
          (ts_lp, result_lp[1], result_lp[2]))
    print("TS for PLExpCutoff:   %.1f (Index = %.2f, E_c = %.2f)" %
          (ts_pc, result_pc[1], result_pc[2]))
Exemplo n.º 2
0
    max_ts = tscube.tsmap.counts.max()
    (castro, test_dict) = tscube.test_spectra_of_peak(peaks[0])

    nll = castro[2]
    fig, ax = plotNLL_v_Flux(nll, flux_type)

    fig2, ax2, im2, ztmp2 = plotCastro(castro, ylims=flux_lims, nstep=100)

    spec_pl = test_dict["PowerLaw"]["Spectrum"]
    spec_lp = test_dict["LogParabola"]["Spectrum"]
    spec_pc = test_dict["PLExpCutoff"]["Spectrum"]

    fig3, ax3 = plotSED(castro, ylims=flux_lims, TS_thresh=2.0,
                        specVals=[spec_pl])

    result_pl = test_dict["PowerLaw"]["Result"]
    result_lp = test_dict["LogParabola"]["Result"]
    result_pc = test_dict["PLExpCutoff"]["Result"]
    ts_pl = test_dict["PowerLaw"]["TS"]
    ts_lp = test_dict["LogParabola"]["TS"]
    ts_pc = test_dict["PLExpCutoff"]["TS"]

    print("TS for PL index = 2:  %.1f" % max_ts)
    print("Cumulative TS:        %.1f" % castro.ts_vals().sum())
    print("TS for PL index free: %.1f (Index = %.2f)" %
          (ts_pl, result_pl[1]))
    print("TS for LogParabola:   %.1f (Index = %.2f, Beta = %.2f)" %
          (ts_lp, result_lp[1], result_lp[2]))
    print("TS for PLExpCutoff:   %.1f (Index = %.2f, E_c = %.2f)" %
          (ts_pc, result_pc[1], result_pc[2]))