Example #1
0
 def prepare(self, data, model, stat):
     ResidPlot.prepare(self, data, model, stat)
     self.title = 'Residuals of %s - Bkg Model' % data.name
Example #2
0
report("res.format()")
report("res")

report("mdl")

stat2 = f.calc_stat()
print("Statistic = {:.4f}".format(stat2))

from sherpa.plot import FitPlot, ResidPlot, SplitPlot
fplot = FitPlot()
mplot.prepare(d, mdl)
fplot.prepare(dplot, mplot)
splot = SplitPlot()
splot.addplot(fplot)
rplot = ResidPlot()
print("### should get a WARNING about missing errors")
rplot.prepare(d, mdl, stat=LeastSq())

rplot.plot_prefs['yerrorbars'] = False
splot.addplot(rplot)

savefig("data_model_resid.png")

report("mdl([2, 5, 10])")
report("mdl([-100])")
report("mdl([234.56])")

mdl.c1.thaw()
mdl.c2 = 0
mdl.c2.freeze()
Example #3
0
 def __init__(self):
     ResidPlot.__init__(self)
Example #4
0
report("res.format()")
report("res")

report("mdl")

stat2 = f.calc_stat()
print("Statistic = {:.4f}".format(stat2))


from sherpa.plot import FitPlot, ResidPlot, SplitPlot
fplot = FitPlot()
mplot.prepare(d, mdl)
fplot.prepare(dplot, mplot)
splot = SplitPlot()
splot.addplot(fplot)
rplot = ResidPlot()
print("### should get a WARNING about missing errors")
rplot.prepare(d, mdl, stat=LeastSq())

rplot.plot_prefs['yerrorbars'] = False
splot.addplot(rplot)

savefig("data_model_resid.png")


report("mdl([2, 5, 10])")
report("mdl([-100])")
report("mdl([234.56])")


mdl.c1.thaw()