polynomial_from_table

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

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_abscissa : array

Elements are the abscissa determining the input polynomial.

table_ordinates : array

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

input_abscissa : array

Points at which to evaluate the input polynomial.

Returns:

output_ordinates : array

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)