elo, ehi = float(elo), float(ehi) load_pha(id, filename) ignore_id(id, None, None) notice_id(id, elo, ehi) ids.append(id) set_analysis(id, 'ener', 'counts') set_xlog() set_ylog() set_stat('cstat') set_xsabund('wilm') set_xsxsect('vern') id = ids[0] galabso = bxa.auto_galactic_absorption(id) galabso.nH.freeze() # Models available at https://doi.org/10.5281/zenodo.602282 load_table_model("torus", '/home/user/Downloads/specmodels/uxclumpy-cutoff.fits') load_table_model("scat", '/home/user/Downloads/specmodels/uxclumpy-cutoff-omni.fits') # the limits correspond to fluxes between Sco X-1 and CDFS7Ms faintest fluxes srclevel = Parameter('src', 'level', 0, -8, 3, -20, 20) print('combining components') model = torus + scat print('linking parameters') torus.norm = 10**srclevel srcnh = Parameter('src', 'nH', 22, 20, 26, 20, 26) torus.nh = 10**(srcnh - 22)
print('loading background fitting module...') from bxa.sherpa.background.pca import auto_background # BXA fully supports fitting multiple ids with the usual id=2, otherids=(3,4,5) # parameters id = 2 load_pha(id, 'interval0pc.pi') if get_rmf(id).energ_lo[0] == 0: get_rmf(id).energ_lo[0] = 0.001 if get_arf(id).energ_lo[0] == 0: get_arf(id).energ_lo[0] = 0.001 set_stat('cstat') set_xsabund('wilm') set_xsxsect('vern') # next we set up a source model. # with automatic milky way absorption model = xszpowerlw.src * xszwabs.abso * bxa.auto_galactic_absorption(id) src.norm.val = 1e-5 # with automatic background from PCA set_model(id, model) convmodel = get_model(id) bkg_model = auto_background(id) #set_bkg_full_model(id, bkg_model) set_full_model(id, convmodel + bkg_model*get_bkg_scale(id)) id2 = None if os.path.exists('interval0wt.pi'): id2 = 3 load_pha(id2, 'interval0wt.pi') if get_rmf(id2).energ_lo[0] == 0: get_rmf(id2).energ_lo[0] = 0.001 if get_arf(id2).energ_lo[0] == 0: get_arf(id2).energ_lo[0] = 0.001