# Multidimensional Analysis of Time-Resolved Charged Particle Imaging Experiments
## 3 Numerical Fitting Procedure  
The quality of a 1D least-squares fitting procedure is related to the possibility to produce a 1D vector, constructed from a parameterized functional form, to fit a 1D data vector. The most commonly available fit procedures are developed for one dimension. Typically, the routine optimizes a set of parameters, \(p_{m}\), of a user-defined functional \(F(x;p_{m})\), which minimizes the global difference between the fit and the data for all values of the \(x\) variable. A multidimensional fit can be performed using the same procedure by comparing each element of the matrix generated by the initial guess \(F(x_{1},x_{2},\ldots,x_{n};p_{m})\) with the corresponding element in the data matrix, and searching for a global minimization (in our case, the minimization algorithm employed is a Levenberg-Marquardt nonlinear regression method [35; 36; 37]). In this sense, the multidimensional fit method can be performed using the standard 1D procedure for which all the elements of the \(n\)D matrix are stored in a single 1D vector. In this approach, the multidimensional fitting procedure requires the use of invertible functions that convert an \(n\)-dimensional matrix into a single vector. The method of choice is to construct a 1D vector that contains, in queue, all the columns of the matrix and all the images of the sequence. This same conversion procedure is applied to both simulated and data matrices before and after the use of the optimisation algorithm. A second issue concerns the choice of coordinates. Whereas the formalism of Section 2 is written in polar coordinates (\(r\), the distance from the center, and \(\alpha\), the angle from the vertical axis), the experimental signal is normally recorded using a widely available 2D CCD camera with pixels that are well defined in Cartesian coordinates. We propose relating the polar and Cartesian coordinates through the advantageous complex representation:  
\[re^{i\alpha}=i\left(x-c_{x}\right)-\left(y-c_{y}\right)d, \tag{12}\]  
where \((c_{x},c_{y})\) are the coordinates of the center of the image and \(d\) is a distortion parameter of the image (different from unity in the case that the pixels are not square). In this way, \(\alpha\) is defined from \(-\pi\) to \(\pi\) with respect to the vertical-up semi-axis, which is taken as the origin angle. In the case that the polarization axis of the laser does not match with the vertical lines of the camera but holds an angle \(\delta\alpha\) with it, it can be taken into account by multiplying Equation (12) by \(\exp(i\delta\alpha)\). We choose to fix \(\alpha=0\) in the singular case of \(r=0\) (i.e., \(c_{x}\) and \(c_{y}\) are integers). The images shown in Figures 1 and 2 are constructed using this conversion from polar to Cartesian coordinates. As was mentioned before, it is common that VMI images are recorded as a function of an experimental variable of interest. Examples of this are pump-probe time delay, laser wavelength, polarization angle, temperature or sample density. This implies that a standard experiment performed in this way can produce tens or hundreds of images (for instance, \(640\times 480\) pixels, with 12-bit dynamic range). With the conditions above, a single experiment with 100 images produces 50 MB in a stack of 3D data. Since the larger the size of the data stack, the slower the convergence of the minimization algorithm, it is important to find either symmetries or constraints that can reduce the number of data points. For example, in the case of symmetric Abel-inverted images, it is possible to work only with a square quarter of the image (corresponding to, say, \(240\times 240\) pixels). The image size can be further reduced performing an \((n\times n)\) local integration, which reduces the size by a factor \(n^{2}\), although it can only be used if the spatial resolution required is not lower than \(n\). The description of a 3D functional necessarily requires a large number of parameters.