Exemplo n.º 1
0
mdl.c2.thaw()
report("mdl")

from sherpa.fit import Fit
f = Fit(d, mdl)
report("f")
report("f.data")
report("f.model")

dump("f.model.c2.val")
mdl.c2 = 1
dump("f.model.c2.val")

print("Starting statistic: {:.3f}".format(f.calc_stat()))
sinfo1 = f.calc_stat_info()
report("sinfo1")

d.ignore(0, 5)
sinfo2 = f.calc_stat_info()
d.notice()
dump("sinfo1.numpoints")
dump("sinfo2.numpoints")

res = f.fit()
if res.succeeded: print("Fit succeeded")
if not res.succeeded: print("**** ERRRR, the fit failed folks")

report("res.format()")
report("res")
Exemplo n.º 2
0
"""
residplot.prepare(d, mdl, f.stat)

/home/djburke/miniconda2/envs/sherpa410-py35/lib/python3.5/site-packages/sherpa-4.10.0-py3.5-linux-x86_64.egg/sherpa/plot/__init__.py:1128: RuntimeWarning: divide by zero encountered in true_divide
  return (ylist[0] - ylist[1]) / staterr
Traceback (most recent call last):
  File "example.py", line 125, in <module>
    residplot.prepare(d, mdl, f.stat)
  File "/home/djburke/miniconda2/envs/sherpa410-py35/lib/python3.5/site-packages/sherpa-4.10.0-py3.5-linux-x86_64.egg/sherpa/plot/__init__.py", line 1140, in prepare
    self.yerr = staterr / staterr
TypeError: unsupported operand type(s) for /: 'list' and 'list'
"""

d.ignore(None, 1)

statinfo = f.calc_stat_info()
report("statinfo")

dump("statinfo.rstat == fitres3.rstat")
dump("f.estmethod.name")

coverrs = f.est_errors()
report("coverrs.format()")

dump("f.estmethod.sigma")

f.estmethod.sigma = 1.6
coverrs90 = f.est_errors()
report("coverrs90.format()")

from sherpa.estmethods import Confidence