Sherpa 4.13 (Python)
load_pha(1, "459_heg_m1_bin10.pha")
load_pha(2, "459_heg_p1_bin10.pha")
load_pha(3, "459_meg_m1_bin10.pha")
load_pha(4, "459_meg_p1_bin10.pha")
load_arf(1, "459_heg_m1.arf")
load_arf(2, "459_heg_p1.arf")
load_arf(3, "459_meg_m1.arf")
load_arf(4, "459_meg_p1.arf")
load_arf(1, "459_heg_m1.arf", bkg_id=1)
load_arf(1, "459_heg_m1.arf", bkg_id=2)
load_arf(2, "459_heg_p1.arf", bkg_id=1)
load_arf(2, "459_heg_p1.arf", bkg_id=2)
load_arf(3, "459_meg_m1.arf", bkg_id=1)
load_arf(3, "459_meg_m1.arf", bkg_id=2)
load_arf(4, "459_meg_p1.arf", bkg_id=1)
load_arf(4, "459_meg_p1.arf", bkg_id=2)
set_analysis("wave")
ignore()
notice(1., 15.)
set_analysis("wave")
hc = 12.39841874 #in [keV-Angstrom]
dummy = atten.dummy
dummy.integrate = False
def atten_wave(p, *energ_args, **kwargs):
wave_args = [hc/arg for arg in energ_args[::-1]]
return dummy.calc(p, *wave_args, **kwargs)
load_user_model(atten_wave, "abs1")
add_user_pars("abs1", ['hcol','heiRatio','heiiRatio'],
[dummy.hcol.val,dummy.heiRatio.val,dummy.heiiRatio.val],
[dummy.hcol.min,dummy.heiRatio.min,dummy.heiiRatio.min],
[dummy.hcol.max,dummy.heiRatio.max,dummy.heiiRatio.max],
[dummy.hcol.units,dummy.heiRatio.units,dummy.heiiRatio.units],
[False,False,False])
abs1.hcol = 1e+20
abs1.heiRatio = 0.1
abs1.heiiRatio = 0.01
create_model_component("bpl1d", "bpow1")
bpow1.gamma1 = 0
bpow1.gamma2 = 0
bpow1.eb = 7.99625
bpow1.ref = 1
freeze(bpow1.ref)
bpow1.ampl = 0.001
create_model_component("powlaw1d","pow1d")
pow1d.gamma = 1
pow1d.ref = 1
pow1d.ampl = 1e-5
pow1d.ampl.min = 2.383e-10
abs1.hcol = 1.81e20
freeze(abs1)
set_model(1, abs1*bpow1)
set_model(2, abs1*bpow1)
set_model(3, abs1*bpow1)
set_model(4, abs1*bpow1)
set_bkg_model(1, abs1*pow1d, 1)
set_bkg_model(1, abs1*pow1d, 2)
set_bkg_model(2, abs1*pow1d, 1)
set_bkg_model(2, abs1*pow1d, 2)
set_bkg_model(3, abs1*pow1d, 1)
set_bkg_model(3, abs1*pow1d, 2)
set_bkg_model(4, abs1*pow1d, 1)
set_bkg_model(4, abs1*pow1d, 2)
set_method("neldermead")
set_stat("cstat")
fit()
plot("fit", 1, "fit", 2, "fit", 3, "fit", 4)
current_plot("all")
set_plot_title("3C 273 (ObsID 459)")
current_plot("plot1")
add_label(10, 0.1, "HEG -1")
set_label(["color","green"])
current_plot("plot2")
add_label(10, 0.1, "HEG +1")
set_label(["color","green"])
current_plot("plot3")
add_label(10, 0.15, "MEG -1")
set_label(["color","green"])
current_plot("plot4")
add_label(10, 0.15, "MEG +1")
set_label(["color","green"])
|
Sherpa 3.4
data 1 459_heg_m1_bin10.pha
data 2 459_heg_p1_bin10.pha
data 3 459_meg_m1_bin10.pha
data 4 459_meg_p1_bin10.pha
paramprompt off
rsp[hegm1]
rsp[hegp1]
rsp[megm1]
rsp[megp1]
hegm1.arf = 459_heg_m1.arf
hegp1.arf = 459_heg_p1.arf
megm1.arf = 459_meg_m1.arf
megp1.arf = 459_meg_p1.arf
instrument 1 = hegm1
instrument 2 = hegp1
instrument 3 = megm1
instrument 4 = megp1
ignore allsets all
notice allsets wave 1:15
paramprompt on
atten[abs]
bpl1d[bpow]
bpow1.gamma1 = 0
bpow1.gamma2 = 0
bpow1.eb = 7.99625
bpow1.ref = 1
freeze(bpow1.ref)
bpow1.ampl = 0.001
powlaw1d[pow1d]
pow1d.gamma = 1
pow1d.ref = 1
pow1d.ampl = 1e-5
pow1d.ampl.min = 2.383e-10
abs.hcol=1.81e20
freeze abs
source 1:4 = abs*bpow
background 1:4 = abs*pow1d
fit
lplot 4 fit 1 fit 2 fit 3 fit 4
d 1,3,4 ylabel ""
title "3C 273 (ObsID 459)"
d 1 label 12 0.075 "HEG -1"
d 2 label 12 0.075 "HEG +1"
d 3 label 12 0.125 "MEG -1"
d 4 label 12 0.125 "MEG +1"
d all l all green
redraw
|