# 2.4.8 Astrometric Image Parameters determination

Author(s): Claus Fabricius, Lennart Lindegren

The image parameter determination needs to know the relevant PSF or LSF. A pre-requisite to determine the image shape is knowing the source colour. First, quick and simple image parameters are determined in AF using a Tukey’s bi-weight method. The resulting positions and fluxes serve two purposes. They are used as starting points for the final image parameter determination, and they are also used to propagate the image location from the AF field to the BP and RP field in order to obtain reliable colours. This process is explained in more detail in Section 3.3 of Fabricius et al. (2016). Note, however, that for Gaia DR2, the colour dependence of the image shapes has not been calibrated.

The final image parameters, viz. transit time, flux, and for 2D windows also the AC position, were determined with a maximum-likelihood method described in Section 2.4.8. For converting the fluxes from digital units to ${\rm e}^{-}/{\rm s}$, gain factors determined before launch were used. The resulting parameters are stored as intermediate data for later use in the astrometric and photometric core processes.

## A general Maximum-Likelihood algorithm for CCD modelling

The general principle for Maximum-Likelihood (ML) fitting of arbitrary models in the presence of Poissonian noise is simple and can be formulated in a general framework which is independent of the precise model. In this way, it is possible to use the same fitting procedure for 1D and 2D profile fitting to CCD sample data, as well as for more complex fitting (e.g., for estimating the parameters of the LSF model). Here, we outline the basic model for this framework.

### Model of sample data

The basic input for the estimation procedure consists of data and a parametrised model. The estimation procedure adjusts the model parameters until the predicted data agrees as well as possible with observed data. At the same time, it provides an estimate of the covariance matrix of the estimated parameters and a measure of the goodness-of-fit. The ML criterion is used for the fit, which in principle requires that the probability distribution of the data is known as a function of the model parameters. In practice, a simplified noise model is used, which is believed to be accurate enough, which leads to simple and efficient algorithms.

Let $\{N_{k}\}$ be the sample data, $\boldsymbol{\theta}=\{\theta_{i}\}$ the model parameters, and $\{\lambda_{k}(\boldsymbol{\theta})\}$ the sample values predicted by the model for given parameters. Thus, if the model is correct and $\boldsymbol{\theta}$ are the true model parameters, we have for each $k$:

 $\mbox{E}(N_{k})=\lambda_{k}(\boldsymbol{\theta}).$ (2.28)

Using a noise model, we have in addition:

 $\mbox{Var}(N_{k})=\lambda_{k}(\boldsymbol{\theta})+r^{2},$ (2.29)

where $r$ is the standard deviation of the readout noise. More precisely, the adopted continuous probability density function (pdf) for the random variable $N_{k}$ is given by:

 $p(N|\lambda,r)=\mbox{const}\times\frac{(\lambda+r^{2})^{N+r^{2}}}{\Gamma(N+r^{% 2}+1)}\,e^{-\lambda-r^{2}},$ (2.30)

valid for any real value $N\geq-r^{2}$.

It is assumed that $N_{k}$, $\lambda_{k}$, and $r$ are all expressed in electrons per sample (not in arbitrary ADU units, voltages, or similar). In particular, $N_{k}$ is the sample value after correction for bias and gain, but including dark signal and background. The readout noise $r$ is assumed to be known; it is never one of the parameters to be estimated by the methods described in this document.

The functions $\lambda_{k}(\boldsymbol{\theta})$ are in principle defined by the various source, attitude, and calibration models, including the LSF, PSF, and CTI models. The set of parameters included in the vector $\boldsymbol{\theta}$ varies depending on the application. For example, in the 1D image centroiding algorithm, $\boldsymbol{\theta}$ may consist of just two parameters representing the intensity and location of the image; in the LSF calibration process, $\boldsymbol{\theta}$ will contain the parameters (e.g., spline coefficients) defining the LSF for a particular class of stars; and so on. The intensity model $\lambda_{k}(\boldsymbol{\theta})$ is left completely open here; the only thing we need to know about it is the number of free parameters, $n=\dim(\boldsymbol{\theta})$.

### Maximum-Likelihood estimation

Given a set of sample data $\{N_{k}\}$, the ML estimation of the parameter vector $\boldsymbol{\theta}$ is done by maximizing the likelihood function:

 $L(\boldsymbol{\theta}|\{N_{k}\})=\prod_{k}p(N_{k}|\lambda_{k}(\boldsymbol{% \theta}),r),$ (2.31)

where $p(N|\lambda,r)$ is the pdf of the sample value from the adopted noise model (Equation 2.30). Mathematically equivalent, but more convenient in practice, is to maximize the log-likelihood function:

 $\ell(\boldsymbol{\theta}|\{N_{k}\})=\sum_{k}\ln p(N_{k}|\lambda_{k}(% \boldsymbol{\theta}),r).$ (2.32)

Using the modified Poissonian model, Equation 2.30, we have:

 $\ell(\boldsymbol{\theta}|\{N_{k}\})=\mbox{const}+\sum_{k}\left[(N_{k}+r^{2})% \ln\left(\lambda_{k}(\boldsymbol{\theta})+r^{2}\right)-\lambda_{k}(\boldsymbol% {\theta})\right],$ (2.33)

where the additive constant absorbs all terms that do not depend on $\boldsymbol{\theta}$. (Remember that $r$ is never one of the free model parameters.) The maximum of Equation 2.33 is obtained by solving the $n$ simultaneous likelihood equations

 $\frac{\partial\ell(\boldsymbol{\theta}|\{N_{k}\})}{\partial\boldsymbol{\theta}% }=\boldsymbol{0}.$ (2.34)

Using Equation 2.33, these equations become:

 $\sum_{k}\frac{N_{k}-\lambda_{k}(\boldsymbol{\theta})}{\lambda_{k}(\boldsymbol{% \theta})+r^{2}}\,\frac{\partial\lambda_{k}}{\partial\boldsymbol{\theta}}=% \boldsymbol{0}.$ (2.35)