Polynomial

class sherpa.astro.optical.Polynomial(name='polynomial')[source]

Bases: sherpa.models.model.RegriddableModel1D

Polynomial model of order 5.

This model can be used with any one-dimensional data set since there are no units on the parameters.

c0

The constant term.

c1

The amplitude of the (x-offset) term.

c2

The amplitude of the (x-offset)^2 term.

c3

The amplitude of the (x-offset)^3 term.

c4

The amplitude of the (x-offset)^4 term.

c5

The amplitude of the (x-offset)^5 term.

offset

There is a degeneracy between c0 and offset, so it is recommended that at least one of these remains frozen.

See also

Powerlaw

Notes

The functional form of the model for points is:

f(x) = sum_(i=0)^(i=8) c_i * (x - offset)^i

and for integrated data sets the low-edge of the grid is used.

Attributes Summary

thawedparhardmaxes
thawedparhardmins
thawedparmaxes
thawedparmins
thawedpars

Methods Summary

apply(outer, *otherargs, **otherkwargs)
calc(p, x[, xhi]) Evaluate the model on a grid.
get_center()
guess(dep, *args, **kwargs) Set an initial guess for the parameter values.
regrid(*arrays)
reset()
set_center(*args, **kwargs)
startup() Called before a model may be evaluated multiple times.
teardown() Called after a model may be evaluated multiple times.

Attributes Documentation

thawedparhardmaxes
thawedparhardmins
thawedparmaxes
thawedparmins
thawedpars

Methods Documentation

apply(outer, *otherargs, **otherkwargs)
calc(p, x, xhi=None, **kwargs)[source]

Evaluate the model on a grid.

Parameters:
  • p (sequence of numbers) – The parameter values to use. The order matches the pars field.
  • *args – The model grid. The values can be scalar or arrays, and the number depends on the dimensionality of the model and whether it is being evaluated over an integrated grid or at a point (or points).
get_center()
guess(dep, *args, **kwargs)

Set an initial guess for the parameter values.

Attempt to set the parameter values, and ranges, for the model to match the data values. This is intended as a rough guess, so it is expected that the model is only evaluated a small number of times, if at all.

regrid(*arrays)
reset()
set_center(*args, **kwargs)
startup()

Called before a model may be evaluated multiple times.

See also

teardown()

teardown()

Called after a model may be evaluated multiple times.

See also

setup()