3[$^{\textrm{\scriptsize rd}}$ ]{}visit, due to a different orientation of HST.[]{data-label="fig:images xo2"}](fig2.png "fig:"){width="2.8cm"} ![Position of the stars on the detector during the 1[$^{\textrm{\scriptsize st}}$ ]{}(left), 2[$^{\textrm{\scriptsize nd}}$ ]{}(middle), and 3[$^{\textrm{\scriptsize rd}}$ ]{}visit (right). XO-2 N is the upper star in the images. The images contain the 1[$^{\textrm{\scriptsize st}}$ ]{}order spectra of both stars, and the 0[$^{\textrm{\scriptsize th}}$ ]{}order of XO-2 S for the 1[$^{\textrm{\scriptsize st}}$ ]{}and 2[$^{\textrm{\scriptsize nd}}$ ]{}visits and of XO-2 N for the 3[$^{\textrm{\scriptsize rd}}$ ]{}visit, due to a different orientation of HST.[]{data-label="fig:images xo2"}](fig3.png "fig:"){width="2.8cm"}

Data reduction {#sec:Data reduction}
==============

Extraction of instrumental parameters {#sec:Extraction of instrumental parameters}
-------------------------------------

The instrumental parameters are derived for two reasons: to apply a wavelength-dependent flat-field correction, and to compute a decorrelation from these parameters in the derivation of the white-light transit curve and the planet spectrum. These parameters are represented in Figure \[fig:state parameters\].

-   Position $(x, y)$ of the 0[$^{\textrm{\scriptsize th}}$ ]{}order.\
    We derive the $(x, y)$ position of the observed 0[$^{\textrm{\scriptsize th}}$ ]{}order by cross-correlation with a reference image. The 0[$^{\textrm{\scriptsize th}}$ ]{}order $(x, y)$ position of the other star, which does not appear in the image, is derived by applying an offset to the 0[$^{\textrm{\scriptsize th}}$ ]{}order that is 