NL

class romanisim.nonlinearity.NL(coeffs, dq=None, gain=None)

Bases: object

Keep track of non-linearity and inverse non-linearity coefficients.

Construct an NL class handling non-linearity correction.

Parameters:
coeffsnp.ndarray[ncoeff, nx, ny] (float)

Non-linearity coefficients from reference files.

dqnp.ndarray[n_resultant, nx, ny]

Data Quality array

gainfloat or np.ndarray[float]

Gain (electrons / count) for converting counts to electrons

Methods Summary

apply(counts[, electrons, reversed])

Compute the correction of observed to true counts

Methods Documentation

apply(counts, electrons=False, reversed=False)

Compute the correction of observed to true counts

Parameters:
countsnp.ndarray[nx, ny] (float)

The observed counts

electronsbool

Set to True for ‘counts’ being in electrons, with coefficients designed for DN. Accrdingly, the gain needs to be removed and reapplied.

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 counts.