# Improving the RST-OIL Algorithm for Oil Spill Detection under Severe Sun Glint Conditions
## Materials and Methods
### Extending the Applicability of RST-OIL to Different Observational Conditions  
A differential multi-temporal approach like RST-OIL may suffer in terms of reliability when the unperturbed conditions, represented by the temporal mean, show a large variability in the investigated temporal dataset. The previously mentioned \(k\sigma\)-clipping procedure [35; 41], implemented during the reference field computation, aims to eliminate outlier values from the historical dataset, which are those values that are well above (or below) the \"normal\" range identified by the \(\mu\pm k\sigma\) interval. For example, in an area where sun glint is randomly present, the reflectance rise on the sea surface (usually very high) in such conditions is automatically eliminated by this procedure. Therefore, the computed reference fields are not perturbed by this contribution, which results in a more representative expected signal and variability in the absence of sun glint. Hence, during the ALICE (Equation (1)) computation, the presence of sun glint in the image under investigation will produce high positive values regardless of the presence of oil. In order to better understand the high reflectance variation when the glint effect appears on the scene, in Figure 2, an example of the study area in glint (Figure 2a) and no glint (Figure 2b) conditions is given. In both images, the top panel represents the scene in a natural Red Green Blue (RGB) color code, while the bottom one refers to the NIR acquisition. In the latter, the signals arising from clouds and land and coastal zones (masked in purple) were not considered to focus better on the clear seawater contribution. Focusing on the NIR images, the sea surface reflectance variability under no glint conditions (Figure 2a) shows an expected pattern, with low values ranging in a very small interval (1-2%) typical of the sea surface in this spectral range. When sun glint affects the scene (Figure 2b), the values increase by up to 10% as does their spatial variability range (9%). Such a random increase may represent an outlier within the whole temporal dataset and, hence, may be discarded during the k\(\sigma\)-clipping procedure. In order to overcome this possible issue and make the approach as exportable as possible, the signal variations due to different sun-satellite geometries within the reference fields' computation process should be taken into account. To this aim, a general criterion based only on satellite data was implemented. The choice for avoiding the use of any kind of ancillary information (i.e., wind speed [43]), which might not be always available at the requested spatiotemporal scale, is related to the need to develop a general criterion that can be easily implemented. In detail, for each of the pieces of L1B data within the considered datasets, starting from sensor and solar zenith (\(\phi_{s}\) and \(\phi_{0}\), respectively) and azimuth angles (\(\omega_{s}\) and \(\omega_{0}\), respectively), each pixel (\(x\),\(y\)) was flagged as a glint (G), high glint (HG), or no glint (NG) pixel, computing the glint angle (\(\theta_{g}\)) as follows [23]. \[\theta_{g}=\arccos\left(\cos\varphi_{s}\cos\varphi_{0}+\sin\varphi_{s}\sin \varphi_{0}\cos\Delta\omega\right) \tag{2}\]  
where \(\Delta\omega\) is the difference between the satellite-solar azimuth angles. If \(\theta_{g}<40^{\circ}\), the relative pixel is in high glint. If the value ranges between \(40^{\circ}\) and \(60^{\circ}\), it is in glint. Otherwise, for \(\theta_{g}>60^{\circ}\), it is not in a glint condition. The threshold values were derived from the analysis of the \(\theta_{g}\) variation on the entire available dataset.