evaluate_nl_polynomial¶
- romanisim.nonlinearity.evaluate_nl_polynomial(counts, coeffs, reversed=False)¶
Correct the observed counts for non-linearity.
As photons arrive, they make it harder for the device to count future photons due to classical non-linearity. This function converts some observed counts to what would have been seen absent non-linearity given some non-linearity corrections described by polynomials with given coefficients.
- Parameters:
- countsnp.ndarray[nx, ny] (float)
Number of counts already in pixel
- coeffsnp.ndarray[ncoeff, nx, ny] (float)
Coefficients of the non-linearity correction polynomials
- reversedbool
If True, the coefficients are in reversed order, which is the order that np.polyval wants them. One can maybe save a little time reversing them once ahead of time.
- Returns:
- correctednp.ndarray[nx, ny] (float)
The corrected number of counts