between 40 and 128 pixels in $x$, and between 20 and 60 pixels in $y$. The sky level is calculated with an outlier resistant mean with a threshold at 3.5 $\sigma$, multiplied by the number of pixels in the star region, and subtracted to the stellar flux. The lightcurve RMS is calculated from the 2[$^{\textrm{\scriptsize nd}}$ ]{}and the 5[$^{\textrm{\scriptsize th}}$ ]{}orbit of each visit, to avoid the first orbit which is commonly affected strongly by systematics, as well as the ingress, egress, and in-transit orbits. Independently for each visit, we determine the optimal height in $y$ as the one resulting in the smallest RMS. We find an optimal height in $y$ of 18, 20, and 18 pixels for XO-2 N, and 24, 18, and 16 pixels for XO-2 S, for the 1[$^{\textrm{\scriptsize st}}$]{}, 2[$^{\textrm{\scriptsize nd}}$]{}, and 3[$^{\textrm{\scriptsize rd}}$ ]{}visit respectively.

The RMS is calculated after correcting the orbit lightcurves for the 7 detector states (Figure \[fig:get7phases\]), without applying any other decorrelation. Indeed, the detector state clearly affects the photometry: flux measurements corresponding to a given state are systematically offset from the mean flux during the orbit. Following the procedure outlined in [@Burke2010], a correction is applied by correcting the mean 