first image of the orbit. The 7 detector states appear clearly in the XO-2 data, and are represented by different colors.[]{data-label="fig:get7phases"}](fig5.png){width="8cm"}

Bias calibration
----------------

The calibration is made from the raw images. The bias calibration is performed by subtracting the first readout from the last [@Fixsen2000]. Pixels with a dark current greater than 1[e$^{-}$]{}/s are already marked as bad, and lower dark currents are negligible for our purpose.

Bad pixel correction
--------------------

To correct for bad pixels, we combine the nominal bad pixel mask for the NIC3 detector with the pixel flags provided in each individual image. In addition, we flag as bad pixels those that deviate by more than 3.5 $\sigma$ from their average value in the orbit, or from their value in the adjacent images. We find typically 35 bad pixels out of $\sim2100$ in the spectral aperture. Each bad pixel’s value is then replaced by a spline interpolation of adjacent pixels.

The set of bad pixels for each image defines a mask (Figure \[fig:bad pixels mask\]). In some masks, lines appear along the $x$ axis at the location of the spectral traces. This behavior appears mostly at the beginning of the orbits, for which the detector temperature 