4.1.1. Convergence

For each domain *Di* (*i* = 1, ..., 5), we investigate the convergence of both the inner loop (from the barrier approach, that is, the iterations on the coefficient *β*) and of the outer loop (from the L-BFGS-B minimization method) for the synthetic case (Figure 2).

The value of the cost function before and after minimization for each step *i*, as well as the number of iterations needed by the L-BFGS-B method and the barrier approach to reach convergence, are shown in Table 1. The iterations on the coefficient *β* are performed only if some constraints are violated. For the ideal case described above, iterations over *β* are required for grids *D*<sup>2</sup> and *D*<sup>5</sup> (with a maximum of 3 iterations for *D*3). The number of iterations needed by the L-BFGS-B method varies depending on the domain *Di* and the coefficient *β*. It is interesting to observe that less iterations are necessary for increasing *β*. Domain *D*<sup>3</sup> necessitates the highest number of iterations and *D*<sup>1</sup> the lowest (1308 and 81 iterations respectively). These numbers are specific to this case and will vary depending on the input fields *u* and *v*, and on the coefficients *C*1, *C*<sup>2</sup> and *C*3. However, they show that convergence may require a high number of iterations and that this number is difficult to predict.

**Table 1.** Optimization results after each step *i* = 0, ..., 5 for the synthetic case. The number of iterations needed for the barrier approach (*β* iterations) and for the L-BFGS-B method are given separately. The total number of iterations correspond to the sum of the L-BFGS-B iterations for each *β* iteration. The cost function *Jp* is evaluated before and after optimization (i.e., for the first guess *<sup>T</sup>***fg** *<sup>i</sup>* and the 'optimal' grid *T*∗ *<sup>i</sup>* ). The latter is also separate into three terms, the mapping error (*Jm*), the background error (*Jb*) and the penalization term (not shown here because of its value close to zero).


The reduction of the cost function is more important on the coarser domains. It is divided by 7 on domain *D*1, by 3 on domain *D*<sup>2</sup> and by 2 on domain *D*<sup>3</sup> (Table 1). This is probably due to better first guesses, since the displaced grid obtained on a domain *Di* is used to initialize the finer grid *Di*+1. The observation error term *Jo* of the cost function is reduced greatly after optimization on the four coarsest domains (from 27.552 after optimization on domain *D*<sup>1</sup> to 13.399 on domain *D*4). However, it increases from domain *D*<sup>2</sup> to *D*3, before decreasing again on domain *D*4. This increase could be due to the smoothing which is narrower for increasing *i*, making the position error more apparent in the mapping error. This could also be due to the background error term (*Jb*), which larger decrease is also from domain *D*<sup>2</sup> to *D*3.

To investigate further the impact of each domain *Di* on the automatic registration procedure, we examine the mean absolute error (MAE) of the morphed (*u*morph = *u*morph(*λ*=1)) and warped (*u*warp = *u*warp(*λ*=1)) signals for different values of *I* (shown in Table 2). The MAE of the morphed signal is divided by around 4.2 from *I* = 1 to *I* = 2 and by 2.6 from *I* = 2 to *I* = 3. Domains *D*<sup>4</sup> and *D*<sup>5</sup> have a smaller impact on the MAE (MAE divided by around 1.3). Similar trend can be observed for the MAE of the warped signal, but with a smaller decrease. The MAE is divided by 1.9 from *I* = 1 to *I* = 2 and from *I* = 2 to *I* = 3. Increasing *I* from 4 or 5 has only a minor effect on the MAE of the warped signal.


**Table 2.** MAE (in mm/h) of the morphed (*u*morph) and warped (*u*warp) signals obtained at different steps *i*, for the synthetic case.

The number of variables to optimize on a domain *Di* increases with increasing *i*. So, solving the minimization problem becomes more computationally expensive. Moreover, we saw that domain *D*<sup>5</sup> has a smaller impact on the cost function and on the MAE of the morphed signals. Thus, in order to limit the computational cost, the finer morphing grid will be set to *I* = 4 in the following validation section.

#### 4.1.2. Validation

In this subsection, we are looking at the performance of the automatic registration and of the morphing procedure on the synthetic case for *I* = 4.

From the automatic registration procedure, we obtain a mapping function *T* that will be used to distort the image in the morphing process. The mapping *T* is shown in Figure 7a. The corresponding grid distortion is illustrated in Figure 7b which shows the regular *nx* × *ny* grid (on which *u* and *v* are defined) before and after the mapping has been applied. By comparing with the signals *u* and *v* (in Figure 2), one can see that the mapping was able to take into account both the rotation and the shear between the events. The biggest distortions occur around the two rainy peaks, while the distorted grid is more regular and closer to the original grid in the areas further away from the peaks. This is due to the first regulation term of the cost functions ensuring that the transformation *T* is as "small" as possible. The second regulation term is responsible for the smooth transition between these areas. The impact of the third regulation term is more difficult to see directly. The third term penalizes grid cell to shrinkage or expansion. Due to the locations of the rainfall events in the signals *u* and *v*, almost the entire domain is influenced by the mapping *T*. Large distortions near the boundary can raise some inconsistencies in the distorted grid, such as in the one in the lower-right corner in Figure 7b. A way to avoid such discrepancies near the boundary would be to add a padding area around the domain filled with zero precipitation.

**Figure 7.** (**a**) Mapping *T* obtained from the automatic registration (with *C*<sup>1</sup> = 0.1 and *C*<sup>2</sup> = *C*<sup>3</sup> = 1) and (**b**) its effect on the pixel grid, for the synthetic case. (**a**) Mapping *T*. (**b**) Pixel grid *Dn* before (in red) and after (in blue) distortion by the mapping *T*.

Once the mapping *T* is obtained, it can be applied to the signal *u*. One can see the impact of the mapping by comparing the morphed signal *u*morph (Figure 8b) to the original signal *u* (Figure 8a). The error between the morphed signal and the signal *v* is shown in Figure 8c. Figure 8c shows that the absolute error is small compared to the intensity of the rain events. This is also reflected by the low MAE in Table 1. Figure 8d shows that the errors have a clear delimitation, corresponding to the rain events of the target field *v*. For this synthetic case, the center of the two events in *u*morph and *v* are corresponding exactly with respect of the position.

It is interesting to note that, while the lower event had an error on the intensity and an error on its location, the error of the morphed signal is lower around its peak than for the second (upper) events. The error of the warped field is close to 5 mm/h near this peak (not shown here). This shows

the advantage of morphing over warping when there is an intensity error. The upper event does not have any intensity error, but it has a shape error (i.e., the ellipses have different inclinations). The largest error in the morphed field *u*morph occurs around its peak. The top is underestimated, while the surroundings are overestimated. This pattern would suggest an error due to the linear interpolation used for the morphing. This underestimation is greatly reduced when using a 2d spline instead of the current bi-linear interpolation (not shown here).

**Figure 8.** Morphing results: (**a**) original signal *u*, (**b**) morphed signal *u*morph, (**c**) absolute error between the morphed signal and the target signal *v* and (**d**) error between the same two signals (using a different scale). (**a**) *u*. (**b**) *u*morph. (**c**) |*u*morph − *v*|. (**d**) *u*morph − *v*.

#### *4.2. Southern Ghana Case*

The results described in this section are obtained for *I* = 4, with the regulation coefficients empirically set to *C*<sup>1</sup> = 0.1 and *C*<sup>2</sup> = *C*<sup>3</sup> = 1 (these coefficients are the same as for the synthetic cases). We define the mask function *M* such that *M* = 1 at the grid points where the kriging variance *<sup>σ</sup>kriging* <sup>&</sup>lt; 0.5 · sill <sup>=</sup> 0.5 mm2/h2 and *<sup>M</sup>* <sup>=</sup> 0 otherwise. The padding area is thus masked too.
