Ulyssys Water Quality Viewer Technical Description Supplementary

Easy to use satellite-based water quality visualizations are needed for monitoring and understanding coastal and inland waters, but to date, no publicly accessible real-time global visualization system was in place. Here we introduce the Ulyssys Water Quality Viewer (UWQV), a Sentinel Hub EO Browser Custom script designed for qualitative views of aquatic chlorophyll and suspended sediment concentrations. The viewer avoids unmixing of the chlorophyll and suspended sediment spectral signal by visualizing these parameters together, with high concentrations of suspended sediment obscuring chlorophyll if present. Cloud masking uses the Hollstein and Braaten algorithms (existing EO Browser custom script code), additionally water surfaces are masked using the Normalized Differential Water Index. Chlorophyll is estimated using reflectance line height-based indicators such as fluorescence line height and maximum chlorophyll index. Suspended sediment is visualized based on single-band reflectances at 620 or 700 nm. Data sources are Sentinel-2 and Sentinel-3 images, allowing either 20 m spatial resolution or up to daily imaging. This visualization system is easy to operate and interpret, and combined with the data service capacity of the Sentinel Hub, it is expected that UWQV will contribute to monitoring of remote water bodies and to our overall understanding of physical limnology and aquatic ecology.


Introduction
Compared to the wide availability of remote sensing data products for terrestrial and ocean applications, global data products for inland and coastal water quality are hardly available (Topp et al., 2020). The Ulyssys Water Quality Viewer (UWQV) is a Sentinel Hub EO Browser custom script for the qualitative visualization of the two most important water quality parameters globally from Sentinel-2 and Sentinel-3 data. Sentinel Hub EO Browser is an online browser for the complete archive of earth observation satellite imagery, which supports user-friendly visualization and online scripting in JavaScript (Sinergise, 2019).
"Water quality" is rarely defined (Chapra, 2008) and can be understood in several different ways. From an ecological perspective, water quality is defined by the status of the most important abiotic and biotic properties of the water column. Material and energy fluxes through the food web are almost exclusively based on photosynthesis. In aquatic habitats, most of photosynthesis is provided by microscopic algae living suspended in the water column known collectively as phytoplankton. Therefore, understanding their quantity is a basic requirement for understanding biogeochemical cycles in aquatic habitats. Additionally, the amount of algae can strongly influence the perceived quality of water for bathing, and extremely high amounts of algae, called algae blooms, have been known to adversely affect human health. Furthermore, the amount of algae in water is typically closely linked to the nutrient content, therefore some sources of water pollution can be localized based on the algae growth they cause. The amount of algae in the water column is measured by chemically extracting chlorophyll from water samples, therefore chlorophyll concentration is widely accepted as the status indicator of algae growth in waters. Several satellite-based algorithms have been developed for mapping chlorophyll concentration, first for clear oceanic waters (Case I waters), and more recently for optically complex water bodies where the colour of the surface is a product of several factors (Case II waters) (Matthews, 2011). At an even more basic level, the main controlling factor of algae growth besides nutrients and temperature is the availability of light, governed by the depth transparency of the water. Transparency is mainly affected by particulate matter suspended in the water column (silt, mud). The quantity of such suspended (not dissolved) matter is used as an indicator of this transparency, traditionally quantified by filtering water from samples. In rivers, sediment is carried by the flow, while in lakes, sediment can enter from tributary rivers or can be resuspended from the bottom by waves and currents.
From a human perspective, water quality includes the suitability of water for bathing and drinking. Therefore, water quality is influenced by the presence of pollutants and harmful bacteria. These properties are not directly visible on satellite imagery, but are often correlated with chlorophyll and suspended sediment indicators. Pollutants arriving with communal sewage or agricultural runoff typically produce signals in chlorophyll or suspended sediment concentrations (Jutla et al., 2013). Therefore especially chlorophyll concentrations are indicative of water quality for human use. Of course, the presence of pollutants and toxins will also influence ecological properties of a water body, and these may come from sources that do not influence chlorophyll and sediment signals.
The spatial distribution of suspended sediment is mainly governed by sediment inflow and currentdriven resuspension. Therefore sediment concentrations can be highly variable in space and time, creating complex patterns. Eddies and plumes are often traced by different concentrations in sediment, and upwelling from the bottom can outline Langmuir circulation lines. These features help us understand the movement and mixing of water in lakes and coastal seas.
The spatial distribution of chlorophyll changes less rapidly than sediment patterns do, due to delays caused by the generation time of algae. Nevertheless, patterns of chlorophyll will also reflect currents, especially since up-and downwelling processes taking place in eddies may create especially favourable conditions for algae growth.
So far, water quality data for most inland waters was typically available online in the form of tables joined to points visualized on maps. Understanding whether water quality is improving or deteriorating required the effort of finding and evaluating the relevant information from this form of presentation. Additionally, these datasets often create the false impression that lakes or rivers are spatially homogeneous. In some rare cases, satellite-based quantitative maps were made available for systems of a few lakes. Sentinel-3 water products are routinely calculated, but since these datasets are only accessible after downloading, their ad-hoc use for evaluating water quality or comparing to field observations is limited. True colour satellite images already provide a lot of information about water quality processes on inland waters, but their interpretation is not straightforward, especially in case of low concentrations. Therefore satellite imagery was rarely used for providing and understanding of water quality processes at local scale. UWQV answers the need for global water quality information from inland and coastal waters. It is not the first attempt to create such a system: the UNESCO World Water Quality Portal provides water quality information from a selected set of water bodies worldwide, with algorithms validated on a global dataset, but does not provide time series maps outside the selected sites, and is not dynamically updated with new satellite image acquisitions (Zandaryaa, 2018). Global Lake Watch (globallakewatch.org) was launched in 2017 and provides time series visualizations of individual water quality parameters based on Google Earth Engine, but was mainly suitable for scientific users and experienced long periods of functionality loss . UWQV is based heavily on Global Lake Watch, using a subset of the satellites and algorithms offered there with a more advanced visualization in the more accessible interface of the Sentinel Hub EO Browser.

Objective:
The Ulyssys Water Quality Viewer is a visualization of water surface chlorophyll and suspended sediment concentrations based on Sentinel-2 and Sentinel-3 satellite imagery. The purpose of this viewer is to aid water management by providing qualitative information on the status of lakes, rivers and coastal seas, and to improve our understanding of physical and ecological processes in aquatic ecosystems. This document aims to provide a detailed description of the methods used, some initial results and applications, and a discussion of the findings and limitations.

Methods and use of visualization:
The UWQV algorithm combines cloud and water masking with chlorophyll and suspended sediment concentration visualization. In the first step snow, cloud and cloud shadow pixels are masked and water pixels are selected based on a simple calculation. The next step is the visualization of water quality. Quantifying chlorophyll in the presence of high concentrations of suspended sediment is a difficult task involving spectral unmixing (Tyler et al., 2006), and has not been attempted here. With the default settings, our script visualizes chlorophyll wherever sediment concentrations are low, overlays a transparent sediment layer on the chlorophyll map wherever they are medium high, and shows only sediment concentrations wherever they are high ( Fig. 1).
This setup allows interpreting chlorophyll patterns where they are visible, outlines the pixels where chlorophyll visualization is possible but the results should be treated with criticism, and also marks the places where it is not possible with these simple tools to collect information on chlorophyll since it is obscured by sediment.
Water masking is based on the Normalized Differential Water Index (McFeeters, 1996). For cloud masking of sentinel-3 images, we use the method of Hollstein et al (Hollstein et al., 2016), or alternatively the Braaten-Cohen-Yang cloud detector (Braaten et al., 2015). Both of these algorithms are already implemented as EO Browser Custom Scripts. Suspended sediment concentrations are assumed to be directly linear to the radiance at 700 nm for both satellites (Nechad et al., 2010), additionally Band 07 (620 nm) can be optionally used in a similar way for Sentinel-3.
The satellite algorithms for chlorophyll concentration we use are based on chlorophyll fluorescence near 680 nm and have been developed and extensively tested for the MERIS sensor. Based on the reflectance line height calculation, two popular indices have been defined for chlorophyll mapping from MERIS data, FLH and MCI. The MERIS FLH index is based on chlorophyll fluorescence observed in the 685 nm band and MCI uses the 705 nm band (Gower et al., 2005). Sentinel-3 has appropriate spectral resolution for calculating both of these indices, but Sentinel-2 lacks a spectral band at 685 nm, therefore only MCI can be calculated from these images. It has been shown in a comparative test that for Case II waters, that this approach is more robust and reliable than several other methods, including more complex ones (Stephanie C. J. . FLH is more suitable for lower chlorophyll concentrations (<20 mg/m 3 ), MCI performs better where the chlorophyll concentration is high. The default algorithm is FLH for Sentinel-3 and MCI for Sentinel-2. Additionally, another reflectance line height based chlorophyll algorithm is available for both satellites, which was developed and tested for Global Lake Watch . Thresholds and min-max values were selected visually, mostly trained on Lake Balaton in Hungary, and the Adriatic and Baltic sea.

Initial results and use examples:
Example: Lake Balaton algae bloom 2019

Fig: Lake Balaton algae bloom 2019
Lake Balaton is the largest lake in Central Europe with 597 km 2 water surface but only 3.3 m mean depth. The lake has an elongated shape and 50% of the water inflow and most of the nutrient load arrives with the main tributary to the SW end of the lake. Therefore, the lake has a well-defined trophic gradient from the SW to the northeast, which means a wide range of chlorophyll concentrations can be observed there at the same time. Lake Balaton was severely affected by eutrophication in the 1980's and 1990's, but water quality recovered after extensive nutrient load reduction efforts, with normal maximum chlorophyll concentrations of about 50 mg/m 3 (Somlyódy, 1983). In September 2019, chlorophyll conditions of up to 300 mg/m 3 were found in field monitoring data for a period of 2 weeks in a bloom produced by cyanobacteria and dinoflagellates at the same time. Water quality conditions returned to normal by the end of September.
The bloom produced a series of optically complex situations on the lake, with high chlorophyll and high suspended sediment concentrations observed at the same time and partly at the same locations. Satellite imagery processed by UWQV allowed a detailed view of the extent of the problem and the dynamics of mixing between clear and turbid water (Fig. 2). Additionally, a time-lapse of Sentinel-3 imagery showed that unusually high concentrations of algae were already present several weeks before the presumed start of the bloom.
We believe that the usefulness of a satellite image visualization can be judged by comparing it to a true colour rendering. True colour images of lakes and rivers can already provide a wealth of information to an experienced user, but by highlighting the water bodies themselves and by applying an intuitive colour scheme to the water quality parameters, a lot of this information is made accessible to nonexpert users as well. UWQV takes a novel approach to water quality visualization: instead of producing separate maps of chlorophyll and suspended sediment concentrations, both of these parameters are visualized together, within the limitations of the algorithm. In many situations, a visualization of only chlorophyll concentration (without sediment) creates the false impression that the estimation of chlorophyll has the same accuracy everywhere. Therefore, visualizing both chlorophyll and sediment concentrations on the same image seems to be a reasonable solution until reliable algorithms for spectral unmixing become widely available (Zhang et al., 2014), together with methods for quantifying uncertainty in a spatially explicit way (Zlinszky and Kania, 2016).
Finding two separate colour gradients that can be interpreted both together and independently is not trivial. Chlorophyll was visualized on a dichromacy-compatible colour gradient from dark blue through green, yellow and red, while sediment was shown with an increasing saturation of a single, intuitive colour (brown), adding transparency for low concentrations. The resulting maps can often (but not always) be interpreted at a glance, leaving the user to focus on thinking about the patterns and processes depicted.
We expect UWQV to aid management of coastal and freshwater systems by providing an understanding of the typical water quality patterns that occur under various weather situations. The accessibility of the EO browser platform allows operators to quickly compare current and archive images to determine if something unusual is happening. The high spatial resolution also supports the interpretation of field samples. Sample-based monitoring is inherently spatially sparse, and by comparing measurements with the UWQV visualization as a background, more informed extrapolations can be made.
The high spatial or temporal resolution offered by Sentinel imagery has enabled UWQV to improve the observers' understanding of water quality processes. Especially bottom resuspension, sediment input and current systems show striking patterns that are even more compelling when colourized by the viewer. The high spatial resolution of Sentinel-2 already shows small details of a few tens of meters. This means that relatively small sub-processes are discernible that are simple enough to look familiar to non-experienced users as well. Vortices and eddies come in a very wide range of sizes, but for inland and coastal waters, high resolution images are necessary for finding them. For example, everyone recognizes a whirlpool, and seeing a similar form on a satellite image immediately conveys the direction and strength of the flow.
The option of creating time series images allows users to see movement. Especially the daily "frame rate" of Sentinel-3 images produces animations that support understanding of water quality processes, since even the relatively slow wind-driven currents that occur in lakes and coastal seas produce visible displacement.

Discussion:
For cloud masking we provide the choice between two algorithms. Since this was not the focus of our development we took two of the approaches that were already implemented as EO Browser custom scripts. Hollstein cloud detection has the advantage of also producing a water mask, and has proved to be rather powerful (although not perfect) for cloud and cloud shadow identification. Hazy conditions and thin cirrus clouds are especially difficult to detect and may be confused with water. As we have observed during testing, the water mask of the Hollstein cloud detection algorithm may deliver erroneous results for very sediment-or chlorophyll-rich waters. We did not attempt to change settings for the Hollstein algorithm, however, as an alternative, we provide the Braaten-Cohen-Young cloud detection algorithm which has the advantage that the separation between cloud and other pixels can be tuned with a parameter. Therefore, in case cloud haze and water seem to form a smooth transition, the user can decide which level of separation is preferred. A potential solution would be to build in the L2A scene classification cloud masking, at least for Sentinel-2.
Since NDWI is the classical method for finding water, and since it can be tuned using the detection threshold, we opted for it although it produces both false positives and false negatives in some wellknown cases. In cases of extreme turbidity or eutrophication, the most important assumption of water detection (that near-infrared reflectivity is lower than green or blue) will be invalid, therefore a simple band ratio index is not sufficient for identifying these cases. Again, the L2A scene classification could work for water masking, but tests have shown that this also fails for very turbid waters.
The most important problem source is that suspended sediment has a rather broad spectral signature and can have different colours from very white (calcite) to very dark (silt). Therefore finding a spectral band where reflectivity of a water surface is not influenced by sediment is hardly possible. For our case, this means that for Sentinel-2, the band used by MCI or RLH for chlorophyll detection is also strongly influenced by suspended sediment. Therefore, sediment will also produce a chlorophyll signal. We have tried to avoid this by using the combined palette described in the Methods section, but this problem still persists in situations where moderate sediment concentrations or bottom reflection affect otherwise clear water. In some cases, we believe that the resuspension of benthic algae together with sediment results in a valid chlorophyll signal, but water sample data are required for deciding how frequently this happens. We have certainly seen cases where visual interpretation suggests the presence of sediment but our algorithm interprets it as a weak chlorophyll signal. For Sentinel-3, this effect is a lot less prominent due to the independence of the bands used for sediment mapping from those used in the chlorophyll algorithm. Since Sentinel-3 has a revisit time of two days (at worst), for most Sentinel-2 scenes a near-synchronous Sentinel-3 image can also be found, which allows crosschecking of results and identification of artefacts.
A lot of alternative suspended sediment algorithms exist in the literature, with different levels of validation. However, most of them are tested for a specific range of conditions while here we aimed for a more generic solution that would be robust across a wide range of situations. During initial tests, single-band algorithms proved to be sufficiently robust in most cases, though as detailed above, independence from other parameters could not always be ensured.
More complex chlorophyll algorithms could probably have delivered somewhat more accurate results, but this would also influence the interpretation of artefacts. If the calculation is sufficiently simple, the reasons for any unexpected results are easier to explain than they would be for a complex algorithm. Additionally, processing time also had to be taken into account.
Coloured Dissolved Organic Matter (CDOM) is an important constituent of water colour and also ecological water quality. CDOM colours the water dark brown or black, is typically produced by decomposition of plant organic matter, and can have a strong influence on the availability of light in the water column. Therefore adding CDOM to UWQV was considered and tested, but no algorithm was found that was sufficiently selective and was not influenced by sediment or chlorophyll, and therefore we did not include CDOM in UWQV.
Future users will probably want to include other chlorophyll, suspended sediment or CDOM mapping algorithms in the script, depending on what has worked for them in the past or what has already been validated for their specific conditions. UWQV is written with this in mind, supporting modification of the algorithms in the structure of the code. We also provide the tools for ensuring compatibility of even rather long calculations with the EO Browser framework in a script for minifying the code before passing it on to the EO Browser.

Impact
By making a wide range of satellite imagery accessible to people who are not necessarily remote sensing experts, the Sinergise EO Browser and the Sentinel Playground have already contributed to a broader interest in water quality processes. UWQV can raise further interest by providing information that is considerably easier to interpret than raw satellite images. Instead of trying to figure out what the patterns on a natural colour image mean, people can focus their attention on understanding the underlying causes of water quality processes.
Limnology, the science of inland waters, is often based on the assumption that at a macroscopic scale, lakes and rivers are homogeneous, "thoroughly-mixed" systems (Padisák, 2005). Satellite imagerybased water quality visualizations have been challenging this assumption for decades, but so far, these images were only snapshots of low temporal resolution, and the processes creating the patterns remained difficult to interpret. The wealth of data available now showing the heterogeneity of coastal and inland waters can hopefully change this. We expect that by providing globally available high resolution visualizations of the most important water quality variables, UWQV can contribute to a paradigm shift in water quality research and aquatic ecology (Stendera et al., 2012).
Access to clean water is a human right (United Nations, 2010) and no. 6 of the UN Sustainable Development Goals is to ensure "safe and affordable drinking water for all of Humanity". Providing open and accessible information on water quality is an essential step towards this goal. On one hand, visualizations based on satellite imagery provide information from waters that are not covered by regular monitoring schemes, such as those in remote regions or areas of conflict. On the other hand, independent and transparent water quality datasets empower citizens to safeguard their water resources. By demonstrating the richness of information available from satellite imagery, we hope UWQV will encourage water authorities and non-governmental organizations worldwide to invest in locally calibrated monitoring systems for the waters they are entrusted with.

Future outlook
UWQV is a short and simple script that supports further development. Since the image processing and the visualization steps are separated, adding new water quality algorithms can be done with very basic programming knowledge. Additionally, alternative satellite sensors can theoretically be integrated. The EO Browser also delivers MODIS and Landsat imagery. An earlier study has shown that MODIS band 13 can be used to represent chlorophyll fluorescence  and band 1 has been used for sediment visualization. Broad band chlorophyll indices have produced encouraging results for Landsat satellites (Ho et al., 2017), theoretically allowing extension of the data archive to several decades. The UWQV script in its current form already handles the choice between several satellite sensors, but integrating further sensor systems will probably require a clone of the script, specifically adapted to the satellite(s) of choice.
The EO Browser custom script repository already includes several scripts that are of high relevance for water quality monitoring. Among these, the Landsat Surface Temperature Mapping Script (Gartner, 2019) is of special interest from an ecological perspective, as nutrient cycles and algae blooms are strongly influenced by water temperature , and temperature is also relevant for the recreational use of bathing waters. From the perspective of physical limnology, the Water Surface Roughness Visualization script of Luongo (2019) delivers important complementary information, showing currents, wave height patterns and eventual oil spills. Since this algorithm is based on Sentinel-1 radar data, it allows following water quality processes to a certain extent even when the water itself is obscured by clouds. If the functionality to view several layers from different data sources at the same time or at least two geo-linked windows could be added to EO Browser, data products from these algorithms could be evaluated together with water quality from UWQV, leading to a more profound understanding of water quality processes.
Finally, a close link to weather data could substantially improve the interpretation of water quality patterns. We have found that timeanddate.com provides access to a global archive on historic weather information that can be queried by date and city. The information is not particularly detailed but daily wind speeds and directions and precipitation are accessible and already this information can help a lot to explain water quality patterns.

Conclusion
The Ulyssys Water Quality Viewer is a Sentinel Hub EO Browser Custom Script for combined visualization of chlorophyll and suspended sediment concentrations in coastal and inland waters. The script runs on Sentinel-2 and Sentinel-3 images and applies simple band math indices that were tested for a range of conditions by earlier studies. The problem of high sediment concentrations obscuring the sediment signal is handled by using a colour scheme that visualizes both parameters together. The script harnesses the power of the EO Browser for rapid visual investigation of satellite imagery and combines it with the evaluation of basic water quality parameters. As a result, the high spatial resolution of Sentinel-2 and the high temporal resolution of Sentinel-3 can be exploited for understanding water quality processes even for non-scientific users.