polynomial_from_table

halotools.empirical_models.polynomial_from_table(table_abscissa, table_ordinates, input_abscissa)[source]

Method to evaluate an input polynomial at the input_abscissa. The input polynomial is determined by solve_for_polynomial_coefficients from table_abscissa and table_ordinates.

Parameters:
table_abscissaarray

Elements are the abscissa determining the input polynomial.

table_ordinatesarray

Elements are the desired values of the input polynomial when evaluated at table_abscissa

input_abscissaarray

Points at which to evaluate the input polynomial.

Returns:
output_ordinatesarray

Values of the input polynomial when evaluated at input_abscissa.

Examples

>>> table_abscissa = [0, 1, 2, 3]
>>> table_ordinates = [0, 2, 4, 6]
>>> input_abscissa = 0.5
>>> result = polynomial_from_table(table_abscissa, table_ordinates, input_abscissa)
>>> assert np.allclose(result, 1.0)