Sentinel Hub Blog
Published in

Sentinel Hub Blog

A selection of visualisations created with the custom scripts submitted to the second round of the Sentinel Hub Custom Script Contest.

Step into the Beautiful World of Custom Scripts

Introducing scripts from the second round of the Sentinel Hub Custom Script Contest

We are pleased to present the custom scripts submitted to the second round of the Custom Script Contest. The Contest started on October 15th 2019 and ended on January 31st 2020. We have received 23 beautiful and useful remote sensing scripts that you can try globally in EO Browser. Entries were judged by a jury of experts on functionality and usefulness, as well as possible commercial potential. The results are published on the official Contest web page and the entries are available on our Custom Scripts repository.

Making a Difference

Satellite data have showcased their importance in our every-day life numerous times in the past decades. The remote sensing community is growing each day, helping everybody on our planet to better understand our beautiful home and spread its importance to our future. As long as we are aware of our environment and of the impact we have as individuals, we have a chance to do something about it and help to contribute to a brighter future of our planet.

We would like to believe that our contribution to the remote sensing community provides many the right tools to make a difference. To spread awareness of the free tools’ availability and showcase the simplicity of their usage, we have initiated a series of Sentinel Hub Custom Script Contests, starting with the first one in Spring 2019. The contests give everyone the opportunity to share their knowledge and contribute innovative ideas and scripts to the remote sensing community.

About the Second Round of the Contest

The participants were allowed to hand in up to three different custom scripts either as a single author or as a representative of a group. The breakdown of submitted scripts with respect to satellite missions is in favour of Sentinel-2 (13 scripts), followed by Sentinel-1 (8 scripts), Sentinel-3 OLCI (3 scripts) and one script for Landsat-8.

The scripts cover wide array of topics: from water (water mapping, water quality, flood mapping, soil moisture) to agriculture (vegetation, crop monitoring), land use and land cover classification, and finally visualisation and art. It is safe to say that all submissions contribute to the remote sensing community which can greatly benefit from them. So, we invite you to check them out and test them on your own use-cases.

Awarded Scripts

Our distinguished jury of seven remote sensing experts and Earth observation enthusiasts judged the submissions and awarded first three prizes to:

  1. “Ulyssys Water Quality Viewer (UWQV)” created by András Zlinszky and Gergely Padányi-Gulyás,
  2. “SAR-Ice: a Sea Ice RGB composite” by Martin Raspaud and Mikhail Itkin,
  3. “Satellite Derived Bathymetry Mapping (SDBM) script” by Mohor Gartner.

The interesting thing which binds all the winning scripts is that they all fall under the same topic — marine or other water bodies algorithms.

🏆 Ulyssys Water Quality Viewer

The UWQV is a custom script which dynamically visualises the chlorophyll and sediment conditions of water bodies on both Sentinel-2 and Sentinel-3 images. The result of the script is a product of two masking operations, cloud and water masking, and two water quality parameter visualisations, and. ℹ️ GitHub.

“The UWQV can provide qualitative information from all the inland waters of the world where water quality monitoring is not available. This includes remote locations but also zones of conflict or humanitarian crisis where clean water is especially precious and information difficult to obtain.”

To learn more about the UWQV we recommend to also read the Water Quality Information for Everyone guest blog post by the authors of the winning script, explaining it in detail.

Tsimlyansk Reservoir, Russia (the UWQV applied to the Sentinel-2 image, acquired on September 5th, 2019 (🌐 EO Browser).

🏆 SAR-Ice: a Sea Ice RGB composite

Sentinel-1A and B SAR-C data is the most important sources of information for operational ice-charting in many marine institutes nowadays. However, because of the lack of a good way to visualise data, only one of the polarizations (usually co-polarization) is used in EW (and sometimes IW) data stripes, and hence some important information can be overlooked.

Martin Raspaud and Mikhail Itkin have developed a new composite, proposing a way to combine both co- and cross-polarization data into one single image, not only keeping the ice features easily distinguishable, but also showing clearly different states of the sea and sea-ice that are difficult to see in single band images.

If you have a need to discriminate various features and state of the water and sea ice, you really have to check out this script. ℹ️ GitHub

Chosha bay in Barents sea in February 2018 (🌐 EO Browser) — Image shows a polynya formation, ice thickens with brine rejection on top, and frost flowers.

🏆 Satellite Derived Bathymetry Mapping (SDBM) script

Bathymetry data is needed for research in global processes in water, undersea seismic events, navigation, commerce, marine habitats, disaster prevention and management, risk assessment, etc. There are various methods to obtain it, but the most cost-effective and relatively fast is Satellite Derived Bathymetry (SDB). It might not produce as accurate results as methods with sonar, but it provides effective evaluation in shallow waters.

With the SDBM script the author offers identification of shallow water depths (up to 18 meters) for selected area and specific scene on the Sentinel-2 data. For some locations, bathymetry data can be found online or one could make in-situ measurements. The script is simplified compared to the usual scientific approach on SDB as it does not include pre-processing of the scene (atmospheric correction, water reflectance, tide offset). ℹ️ GitHub

San Luis Obispo Bay, USA (Sentinel L1C, acquired on February 16th, 2018 and with applied SDBM script) — The script is globally applicable in the coastal zones of reservoirs, ponds, lakes, seas and oceans. It is recommended to use scenes with higher illumination and no or low presence of cloud coverage (<10%), shadow areas, turbidity, waves, wind. 🌐 EO Browser

Enhanced True Color Visualisation Scripts

Tonemapped Natural Color Script

The purpose of this script is to produce beautiful natural color images. It uses global tonemapping to pack very bright values into the upper part of the spectrum. Resulted images should never have clipped values on bright objects like clouds or snow, while keeping other surfaces like soil or vegetation properly exposed, achieving a photographic look, because most modern cameras do this type of processing.

The author of the script, Gregory Ivanov, took inspiration and his experience from real-time 3D graphics in modern video games, as most of them now use High dynamic range for lighting calculations. ℹ️ GitHub

The script was added to the Education mode in EO Browser, which can be switched on by clicking on the little hat icon in the right up corner. You can find the script under the Snow and Glaciers theme. For more details on that we recommend reading the New Themes, Multi-Temporal Scripting and Other Improvements in EO Browser blog post.

Manfredonia, Province of Foggia, Italy (Sentinel-2 L1C, acquired on December 14th, 2019 with applied Tonemapped Natural Color Script) 🌐 EO Browser

TOA Ratio B09-B8A ColorMap Blue-Red & Natural Colors Script

This script represents the ratio of (B09 / B8A) with a RED-BLUE color table on CLEAR land pixels. Other pixels like clouds, snow, water, shadow are visualised in “natural” colors.

A blue color indicates a dry atmosphere like in desert area or high mountainous regions whereas red color indicates a very wet atmosphere like in the Amazonian forest, summer in Japan or India during monsoon. ℹ️ GitHub

The images illustrate described different conditions, the first one at continental scale showing the difference of atmosphere above Australia from the wet shores to the dry desert central areas. The second image shows the high contrast region of Himalaya that creates a sharp boundary between wet Northern India and very dry Tibetan plateau.

Selective Enhancement Based on Indices

Interactive enhancement dual mask to alternate selective treatment of features such as Land x Water or Snow or Vegetation, is based respectively on NDWI, NDSI and NDVI indices, for Sentinel-2 images. On most occasions a single composition of band, or luminosity adjustment, does not fit all features of an image. Therefore, the objective of this script is to help on selectively enhancing of different classes of indexed features. The script also aims to be didactically clear, simple and easy to manipulate, to be understood by beginners. Parameters for contrast, saturation, index limit and band compositions may be manually adjusted. ℹ️ GitHub

Left comparison: Pucara de Oroncota, Bolivia on November 2nd, 2019 — The script highly enhances geology differentiation, while selectively enhancing waterways (left) — 🌐EO Browser. True Color shows not much differentiation in geology itself, and with waterways, all in similar colors (right). Right comparison: Gulf of Venice, Italy on November 10th, 2019 — Using selection as an artistic blackout mask to enhance water turbidity alone (left). True Color with much less differentiation of clear water and turbidity (right).

Marine and Other Water Bodies Environment Algorithms

Aquatic Plants and Algae Custom Script Detector

The script allows to highlight aquatic plants and algae in lakes and lagoons, while the rest of the territory is visualised in natural color. Applying the script, vegetation and algae in the water are displayed from turquoise color to bright green and denser vegetation cover in bright yellow, which corresponds medium and high density areas respectively. It is globally applicable to water bodies all over the world.

The most useful application of the script is to monitor the distribution of invasive species in water bodies such as lakes or lagoons. The script also identifies turbid water. The areas with a large amount of sediment in suspension are painted in brown and red to purple colors. ℹ️ GitHub

The output of the script (left) shows the presence of aquatic plants and algae in Victoria Lake (Africa) in bright green color while the turbid water is displayed in red (acquired on October 4th, 2019). Algae and turbid water (right) in Taihu Lake, near Shanghai, China (acquired on December 10th, 2019).

Water in Wetlands Index (WIW)

The WIW script allows you to generate water maps using the Water in Wetlands logical rule by featuring water in blue and other landscape features in natural colors. It is useful for mapping open-water areas and areas with water under vegetation cover. It has Sentinel-2 and Landsat 8 implementation.

Use of WIW with Sentinel-2 sensors can help track short-term changes in water areas relative to rainfalls or floods. Considering the high temporal resolution of Sentinel 2 (every 5 days), cumulative water maps built using WIW can further be used for detecting a wide range of wetlands which are either periodically or permanently inundated. ℹ️ GitHub

The Barotse floodplain is in the Zambezian flooded grasslands ecoregion. The flood provides aquatic habitats for fish such as tigerfish and bream, crocodiles, hippopotamus, waterbirds, fish-eating birds, and lechwe, the wading antelope found in wetlands of south central Africa. The peak of the flood occurs on the floodplain about 3 months after the peak of the rainy season in January-February. 🌐 EO Browser

Use of WIW with Landsat sensors can be used to collect long-term data (back to 1984) for monitoring wetland evolution. ℹ️ GitHub

WIW timelapse with Landsat 8 data at the largest reed marsh in southern France — ChaSca — from July 2013 through June 2014 (monthly interval).

Se2WaQ — Sentinel-2 Water Quality Script

The Se2WaQ script uses Sentinel-2 products (L1C & L2A) to display the spatial distribution of six relevant indicators of water quality:

  • the concentration of Chlorophyll a (Chl_a),
  • the density of cyanobacteria (Cya),
  • turbidity (turb),
  • colored dissolved organic matter (CDOM),
  • dissolved organic carbon (DOC), and
  • water color (Color).

These indicators are used to define the trophic state on inland waters, which is particularly important when these waters are used for human consumption or leisure activities, for agriculture or industrial purposes. The script allows the user to explore the results as the values of the scales are changed, and to discover more structures on the images. ℹ️ GitHub

Distribution of Cya in the Alqueva Lake, in Portugal, on October 12th, 2017, during a particular dry Autumn. The lake is showing a high density of cyanobacteria, specially in the northern region.

Water Bodies’ Mapping — WBM Script

The goal of the script is to identify water bodies and it was designed on the basis of indices, which were developed and are used by the scientific community. Incorporated indices are based on bands, which are included in Sentinel L1C and Landsat 8 data sources. Therefore, the script can be used on both. However, it was primarily developed on Sentinel-2 L1C.

The script is in general globally applicable inland and coastal zones. It is recommended to use scenes with higher illumination, low cloud coverage and no/low presence of shadow areas. It works better in flat areas than in hilly and mountainous areas. Nevertheless, false detection of water bodies in mountainous areas can be usually filtered with the script or at least visually differentiated from true water bodies, as later have nucleated (lakes, reservoirs, etc.) or thin line shape (rivers). ℹ️ GitHub

Southern Australia, part of Lake Alexandrina on the coastline (Sentinel-2 data, acquired on October 24th, 2019). Almost all water bodies are appropriately detected, from ocean and Lake Alexandria, to smaller ponds. 🌐 Sentinel Playground Temporal

Disaster Management and Prevention Algorithm

Flood Mapping with Sentinel-1

The author adapted the script to Sentinel-1 IW GRD images with VV polarization to help in visualisation of flooded areas. The visualisation allows to quickly determine the extent of the damaged areas regardless of weather conditions and to recognise the flood patterns. The algorithm works great for separating flooded areas from permanent water bodies and land areas. It can only be used with multi-temporal processing with two images before and during the flood. ℹ️ GitHub

Flood mapping in Aghghala, Iran — Sentinel-1 image during the flood on March 23rd, 2019 and a reference image before the flood on March 11th, 2019 (R=2019/03/11 and G,B=2019/03/23). To separate flooded from unflooded, a threshold is selected on the difference values between the before and during flood backscatters. The second and third image show the acquired maps with thresholds 0.05 and 0.08. Low values correspond to the less affected areas (black), and high values correspond to the more affected areas (red color). 🌐 Sentinel Playground Temporal

Land Use Algorithm

Land Use Visualisation for Sentinel-2 using Linear Discriminant Analysis

Madrid, Spain (Sentinel-2 data with applied Land Use Visualisation using LDA script, acquired on September 26th, 2019) 🌐 EO Browser

The authors of the script have used Linear Discriminant Analysis (LDA) to create a visualisation where each image channel (red, green and blue) codes the maximum information to identify respectively urban, crop and water related classes. Input class labels were taken from Spanish SIOSE land use classification.

The script for EO Browser is specifically designed to visualise Sentinel-2 13 band data in a way that facilitates differentiation of urban areas (red channel), vegetation areas (green channel) and water areas (blue channel). ℹ️ GitHub

Custom Scripts as Art

Homage to Mondrian

Flevoland province in the Netherlands 🌐 EO Browser

This is an artistic script to pay tribute to Dutch painter Piet Mondrian. It takes normalized difference vegetation index (NDVI) and paints pixels in 5 different colors depending on its value. Colors are chosen to match those in the most popular Mondrian’s paintings.

The script is universally applicable but the best artistic effects are reached in locations with repetitive and geometrically uniform landscape, for example in large agricultural fields. It can be further improved by manually adjusting limits of NDVI for each color, depending on geographic location and personal taste. ℹ️ GitHub

Vegetation and Agriculture Algorithms

Tracking Radar Vegetation Index (Agriculture Development) Change

The script analyses and compares the Radar Vegetation Index (RVI) values using all available radar images. It calculates the average RVI for the current and previous 2 months and takes the current image as the reference. ℹ️ GitHub

Agriculture fields around Yeya river, Krasnodar region, Russia (Sentinel-1 data with applied multi-temporal RVI script). 🌐 EO Browser

Soil Moisture Estimation Script

The script estimates surface soil moisture using change detection algorithm. It produces soil moisture ranges from 0 to 60% with color representation of red being 0 and blue as 60%. White color represents the masked-out area. Permanent water bodies and urban areas are masked out using backscatter intensity thresholds to minimize the number of false pixels. This masking approach is robust since it utilities long time series data.

Since we are considering 3-year of data in calculating the sensitivity of backscatter fluctuations, it is resistant to seasonal fluctuations. It is capable of masking urban and permanent water bodies to reduce false results. ℹ️ GitHub

Manitoba, Canada (Sentinel-1 data with applied multi-temporal Soil Moisture Estimation script). 🌐 Sentinel Playground Temporal

Radar Vegetation Index for Sentinel-1 (RVI4S1) SAR Data

The goal of the script is to calculate the Radar Vegetation Index for Sentinel-1 (RVI4S1) like dual-pol SAR data. It utilizes Sentinel-1 GRD products as input and calculates the RVI4S1 index for monitoring crop growth. The theoretical value of this index ranges from 0 to 1. The bare soil or pure elementary targets indicate a very low RVI4S1 index towards zero. Conversely, a fully developed crop canopy advance the index towards 1. ℹ️ GitHub

Time-lapse shows the start of the season on May 11th to high vegetative growth condition on July 22nd of summer 2019 in Manitoba province, Canada. This region is dominating by cereal crops (wheat, oats, barley), corn, canola and soybean. Throughout the growth season changes in RVI4S1 values are observed. The index changes from almost 0 to close to 1 as crop advanced. 🌐 EO Browser

Radar Vegetation Index Code for Dual Polarimetric Script

This script computes the vegetation indices over the scene using the VH and VV polarization combinations. It computes the 4 times normalized VH backscatter to compute the vegetation index. This code is based on HH ~ VV being considered for dual polarization SAR data. This index could be useful for the identification of crop phenological stages. During the growth period the randomness in SAR backscatter increases as crop canopy distribution and density change. This index directly relates the changes in those crop parameters and the randomness in the SAR backscatter. Hence, variation in the index is found depending on the growth stage. ℹ️ GitHub

The time-lapse shows Vijayawada, India region in the period from June 24th, 2019 to December 27th, 2019. During this period, rice is majorly sown over all the fields in this area. Also, the monsoon cloudy climatic condition creates hindrance in ground data collection by optical satellites. In this regard, the Sentinel-1 SAR satellite could be an alternative way to monitor the rice phenological stages. It can be seen from the representative images that the RVI for Sentinel-1 visually correlates the changes in the crop phenological stages to a great extent. 🌐 EO Browser

SAR for Deforestation Detection

The script uses the VV and VH bands of the Sentinel-1 data and transforms the cartesian space of VV and VH to polar coordinates computing the length and angle of the resulting vector and also the area of the square defined by VV and VH. The script paints in black the water and bare soil areas, and uses both the length and the angle to draw a scale for the forest (green) and soil (red), drawing a stronger green where more forest has been classified and a stronger red or black where more soil has been found. ℹ️ GitHub

Borneo (Sentinel-1 data with applied SAR for Deforestation Detection script) — image shows areas affected by palm oil deforestation. 🌐 EO Browser

Agricultural Crop Monitoring from Space

The author of the script used a time series of nine Sentinel-1 IW GRD images with VV and VH polarization in a selected timeline as an input. The output of the script gives a good view of where crops are growing well or not growing, and identifies the surrounding water bodies and urban areas. The different colors in the crop fields display the growth stage variations between the crops. The results of the script are consistent with the NDVI. ℹ️ GitHub

The acquired images during the period from April 20th, 2018 to July 17th, 2018 in the region of Ferrara, Italy. The image acquired on April 20th, 2018 was used as the master image. 🌐 EO Browser

Other Scripts

OLCI Natural Colors with Sigmoid

This script provides a natural color visualisation of Sentinel-3 OLCI with a combination of bands B08, B06, B04. A modified sigmoid function is used in the gain formula to preserve some of the cloud brightness dynamic with a more progressive saturation. TOA reflectance offsets are subtracted to red, green, blue bands to compensate for the Rayleigh diffusion. ℹ️ GitHub

The image of California acquired on January 24th, 2020 used Lambda = 7 as a compromise. Lambda value can be adjusted to lower values (e.g. 3, 4, 5) to catch more of clouds brightness dynamic. Higher values of Lambda (e.g. 8, 9, 10) will result in brighter images more adapted to dark vegetated areas. Note that in this case clouds brightness will saturate. 🌐 EO Browser

Index Visualisation

This submission to the Contest represents a universal script for visualisation of indices. It’s creating a color composite of the index value and bands used for calculating the index. It works for indices calculated as dividing an addition of two bands from the difference of two bands. ℹ️ GitHub

Liptov, Slovakia (Sentinel-2 data with applied NDVI visualisation, acquired on July 4th, 2019). 🌐 EO Browser

NDVI on L2A Vegetation and Natural Colors

This script works on Sentinel-2 L2A products, using the Vegetation class from the “Scene Classification map”, to display a color-coded NDVI on pixels classified as vegetation and natural colors of surface reflectance (red = B04, green = B03, blue = B02) otherwise (water, clouds, snow, not-vegetated land pixels). ℹ️ GitHub

The two images of forest of Compiègne, France acquired 6 months apart (early summer on July 5th, 2019 vs. early winter on January 6th, 2020) show the difference of forest NDVI depending on the season. 🌐 EO Browser

To get an impression of how easy it is to write a simple and useful script and what it takes to participate in the next Contest, we also invite you to read one of our previous blog posts, “Why join the next Sentinel Hub Custom Script Contest”. Check out also the list of some useful information on processing images using the custom scripting in EO Browser. You never know, you might just get the motivation to submit your own script in the third round of the Contest in the coming months and win some cool prizes.

Stories from the next generation satellite imagery platform

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sabina Dolenc

Sabina Dolenc

If you focus on the smallest details, you never get the big picture right. But sometimes exactly that makes everything simply beautiful. #EarthObservation

More from Medium