repair_coefficients

romanisim.nonlinearity.repair_coefficients(coeffs, dq)

Fix cases of zeros and NaNs in non-linearity coefficients.

This function replaces suspicious-looking non-linearity coefficients with no-op coefficients from a non-linearity perspective; all coefficients are zero except for the linear term, which is set to 1.

This function doesn’t try to make sure that the derivative of the correction is greater than 1, which we would expect for a non-linearity correction.

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

Nonlinearity coefficients, starting with the constant term and increasing in power.

dqnp.ndarray[n_resultant, nx, ny]

Data Quality array

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

“repaired” coefficients with NaNs and weird coefficients replaced with linear values with slopes of unity.

dqnp.ndarray[n_resultant, nx, ny]

DQ array marking pixels with improper non-linearity coefficients