single_polynomial_terms¶
- sofia_redux.toolkit.resampling.single_polynomial_terms(coordinate, exponents)[source]¶
Derive polynomial terms for a single coordinate given polynomial exponents.
Raises a single coordinate by a power and then calculates the product over all dimensions. For example, the output of an (x, y) vector with
exponent=[[2, 3]]
would be \(x^2y^3\).Note that multiple sets of exponents are expected to be provided during this operation, so the
exponents
parameter should be a 2-dimensional array. The return value will be a 1-dimensional array with size equal to the number of exponent sets provided.- Parameters:
- coordinatenumpy.ndarray (N,)
The coordinate in each dimension.
- exponentsnumpy.ndarray (n_exponents, N)
Sets of exponents to apply to the coordinate.
- Returns:
- numpy.ndarray of numpy.float64 (n_exponents,)
The polynomial terms for the coordinate.