## 4 Data and Methods
### Image Restoration Algorithm  
The basis of the implemented approach is the Closest Spectral Fit (CSF) technique for multi-spectral images proposed by [PERSON] _et al._[35]. It requires two input images, a clouded image \(C\) and a cloud-free fill image \(F\). Since the spectral information of each pixel beneath a cloud in image \(C\) is useless, it is desirable to restore these spectra with the support of the image \(F\). A fundamental assumption is that the co-registration of the images results in a perfect match of the geolocation between the two images. Based on this requirement, the geolocation \(x,y\) of every cloudy pixel \(C_{x,y}\) in image \(C\) can be recognized in image \(F\). Subsequently, for each of these pixels \(F_{x,y}\), the spectral distance to all other pixels \(F_{i,j}\) is computed. This distance is derived by the Euclidean Distance (ED), which is given by:  
\[ED=\sqrt{\sum_{i=1}^{k}{(F_{xyk}-F_{ijk})^{2}}} \tag{1}\]  
where \(k\) denotes the number of bands, \(F_{x,y,k}\) represents the digital numbers of the reference pixel at the geolocation \(x,y\) in the band \(k\), and \(F_{ijk}\) defines the DN of a pixel at the geolocation \(i,j\), which is compared with the DN at \(x,y\) in band \(k\). The smaller the evaluated distance between \(F_{x,y}\) and \(F_{i,j}\)the higher the similarity between those two pixels. Therefore, the ideal value of \(ED\) is zero [35]. After the determination of the spectral distance for each pixel in image \(F\), the geolocation \(i,j\) of the spectrally most similar pixel is returned. In case of ambiguous occurrence of minimum values of \(ED\), the pixel that is spatially closest to the geolocation \(x,y\) is regarded as best choice. The DN of \(C_{x,y}\) is then substituted by the DN of \(C_{i,j}\) for each Band \(k\). The algorithm introduced by [PERSON] _et al._[35] is referred to as Closest Spectral Fit (CSF). Since the aim of this study is the test of a potential integration of SAR data as support image \(F\) in a cloud filling approach, the term \"spectral\" seems misleading. Therefore the abovementioned technique is further referred to as Closest Feature Vector (CFV). Figure 4 gives a schematic overview of the functionality of the CFV approach. Based on the CFV, the spectral neighborhood or the spectral similarity respectively is assessed and used as the criterion to identify the most appropriate pixel to fill the information gap produced by a certain cloudy pixel. In the framework of this study, the approach is extended by the very fundamental assumption of spatial correlation. Justified by the first law of geography, it is assumed that \"everything is related to everything else, but near things are more related than distant things.\" [18]. Therefore the spatial distance of a pixel \(F_{i,j}\) to the pixel \(F_{x,y}\) is considered as a weighting factor by means of the Spatial Euclidean Distance (\(SD\)) by:  
\[SD=\sqrt{\sum_{i=1}^{k}{(F_{x}-F_{i})^{2}+(F_{y}-F_{j})^{2}}} \tag{2}\]  
where \(F_{x}\) and \(F_{y}\) are the x- and the y-coordinate of the reference pixel and \(F_{i}\) and \(F_{j}\) are the x- and y-coordinate of the pixel of which distance is the subject of investigation. The distance weight of a certain pixel is implemented by the usage of an Inverse Distance Weighting (\(IDW\)) function, which is calculated for every pixel in the image. Hence, pixels proximate to \(F_{x,y}\) carry a larger weight than points in larger spatial distance [14]. \(IDW\) is implemented as:  
\[IDW=\frac{1}{(\frac{SD}{R})^{\beta}} \tag{3}\]  
with the spatial resolution \(R\) of the image and a calibration factor \(\beta\), which is responsible for the strength of the decrease of the weight in dependence of the distance. The provision for \(R\) is implemented due to two reasons. First the weighting function is supposed to account for the absolute metric distance. Second, in case the absolute metric distance is neglected, \(SD\) tends to become zero for remote pixel.