Pixels Non-Linearity#
This tools helps the user to find the pixel non-linearity coefficients to as inputs for ExoSim, starting from the measurable pixel non-linearity correction.
In fact, the detector non linearity model, is usually written as polynomial such as
where \(Q_{det}\) is the charge read by the detector, and \(Q\) is the ideal count, as \(Q = \phi_t\), with \(\phi\) being the number of electrons generated and \(t\) being the elapsed time.
Pixels Non-Linearity from scratch#
The PixelsNonLinearity tool retrieves the \(a_i\) coefficients, starting from physical assumptions.
The detector non linearity model, is written as polynomial such as
where \(Q_{det}\) is the charge read by the detector, and \(Q\) is the ideal count, as \(Q = \phi_t\), with \(\phi\) being the number of electrons generated and \(t\) being the elapsed time.
Considering the detector as a capacitor, the charge \(Q_{det}\) is given by
where \(\phi\) is the charge generated in the detector pixel, and \(\tau\) is the capacitor time constant. In fact the product \(\phi \tau\) is constant \(Q\) is the response of a linear detectror is given by \(Q = \phi t\)
The detector is considered saturated when the charge \(Q_{det}\) at the well depth \(Q_{det, \, wd}\) differs from the ideal well depth \(Q_{wd}\) by 5%.
Then
This equation can be solved numerically and gives
Therefore the detector collected charge is given by
Which can be approximated by a polynomial of order 4 as
The results are the coefficients for a 4-th order polynomial:
The user should indicate the expected non-linearity shape, by setting the saturation parameter, called well_depth:
<channel> channel_name
<detector>
<well_depth> 25000 </well_depth>
</detector>
</channel>
Then the tool can be run as
import exosim.tools as tools
tools.PixelsNonLinearity(options_file='tools_input_example.xml',
output='pnl_map.h5')
With the given example, we obtain the following expected non-linearity shape:
However, each pixel is different, and therefore, this class also produces a map of the coefficient for each pixel. Each coefficient is normally distributed around the mean value, with a standard deviation indicated in the configuration. If no standard deviation is indicated, the coefficients are assumed to be constant.
<channel> channel_name
<detector>
<spatial_pix> 200 </spatial_pix>
<spectral_pix> 200 </spectral_pix>
<pnl_coeff_std> 0.005 </pnl_coeff_std>
</detector>
</channel>
To obtain the map we added to the configuration the detector sizes and the standard deviation of the coefficients.
The code output is a map of \(a_i\) coefficients for each pixel, which can be injected into ApplyPixelsNonLinearity.
Pixels Non-Linearity from correcting coefficients#
Let’s write again the detector non linearity model as
where \(Q_{det}\) is the charge read by the detector, and \(Q\) is the ideal count, as \(Q = \phi_t\), with \(\phi\) being the number of electrons generated and \(t\) being the elapsed time. In the equation above, \(\bigtriangleup\) is the operator used to defined the relation between \(Q_{det}\) and \(Q\), which depends on the definition of the coefficients \(a_i\) (see also equation below).
However, it is usually the inverse operation that is known, as it’s coefficients are measurable empirically:
Where \(\bigtriangledown\) is the inverse operator of \(\bigtriangleup\). Depending on the way the non linearity is estimated, the operator can either be a division (\(\div\)) or a multiplication (\(\times\)). If not specified, a division is assumed.
The PixelsNonLinearityFromCorrection can determine the coefficients \(b_i\) from the measured non linearity correction.
The \(b_i\) correction coefficients should be listed in the configuration file using the pnl_coeff keyword in increasing alphabetical order: pnl_coeff_a for \(b_1\), pnl_coeff_b for \(b_2\), pnl_coeff_c for \(b_3\), pnl_coeff_d for \(b_4\), pnl_coeff_e for \(b_5\) and so on. The user can list any number of correction coefficients, and they will be automatically parsed. Please, note that using this notation, \(b_1\) is not forced to be the unity.
<channel> channel_name
<detector>
<well_depth> 25000 </well_depth>
<pnl_coeff_a> 1.00117667e+00 </pnl_coeff_a>
<pnl_coeff_b> -5.41836850e-07 </pnl_coeff_b>
<pnl_coeff_c> 4.57790820e-11 </pnl_coeff_c>
<pnl_coeff_d> 7.66734616e-16 </pnl_coeff_d>
<pnl_coeff_e> -2.32026578e-19 </pnl_coeff_e>
<pnl_correction_operator> / </pnl_correction_operator>
<pnl_coeff_std> 0.005 </pnl_coeff_std>
</detector>
</channel>
as example of non linearity, we used the parameters from Hilbert 2009: “WFC3 TV3 Testing: IR Channel Nonlinearity Correction” (link).
This class will restrieve the \(a_i\) coefficients, starting from the the indicated \(b_i\). The results are the coefficients for a 4-th order polynomial:
With the given example, we obtain the following expected non-linearity shape:
However, each pixel is different, and therefore, this class also produces a map of the coefficient for each pixel as before.