OrthoPolynomialBase#

class astropy.modeling.polynomial.OrthoPolynomialBase(x_degree, y_degree, x_domain=None, x_window=None, y_domain=None, y_window=None, n_models=None, model_set_axis=None, name=None, meta=None, **params)[source]#

Bases: PolynomialBase

This is a base class for the 2D Chebyshev and Legendre models.

The polynomials implemented here require a maximum degree in x and y.

For explanation of x_domain, y_domain, `x_window and `y_window see Notes regarding usage of domain and window.

Parameters:
x_degreeint

degree in x

y_degreeint

degree in y

x_domaintuple or None, optional

domain of the x independent variable

x_windowtuple or None, optional

range of the x independent variable

y_domaintuple or None, optional

domain of the y independent variable

y_windowtuple or None, optional

range of the y independent variable

**paramsdict

{keyword: value} pairs, representing {parameter_name: value}

Attributes Summary

n_inputs

The number of inputs.

n_outputs

The number of outputs.

x_domain

x_window

y_domain

y_window

Methods Summary

__call__(*inputs[, model_set_axis, ...])

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(x, y, *coeffs)

Evaluate the model on some input variables.

get_num_coeff()

Determine how many coefficients are needed.

imhorner(x, y, coeff)

invlex_coeff(coeffs)

prepare_inputs(x, y, **kwargs)

This method is used in __call__ to ensure that all the inputs to the model can be broadcast into compatible shapes (if one or both of them are input as arrays), particularly if there are more than one parameter sets.

Attributes Documentation

n_inputs = 2#

The number of inputs.

n_outputs = 1#

The number of outputs.

x_domain#
x_window#
y_domain#
y_window#

Methods Documentation

__call__(*inputs, model_set_axis=None, with_bounding_box=False, fill_value=nan, equivalencies=None, inputs_map=None, **new_inputs)#

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(x, y, *coeffs)[source]#

Evaluate the model on some input variables.

get_num_coeff()[source]#

Determine how many coefficients are needed.

Returns:
numcint

number of coefficients

imhorner(x, y, coeff)[source]#
invlex_coeff(coeffs)[source]#
prepare_inputs(x, y, **kwargs)[source]#

This method is used in __call__ to ensure that all the inputs to the model can be broadcast into compatible shapes (if one or both of them are input as arrays), particularly if there are more than one parameter sets. This also makes sure that (if applicable) the units of the input will be compatible with the evaluate method.