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.
Our distinguished jury of seven remote sensing experts and Earth observation enthusiasts judged the submissions and awarded first three prizes to:
- “Ulyssys Water Quality Viewer (UWQV)” created by András Zlinszky and Gergely Padányi-Gulyás,
- “SAR-Ice: a Sea Ice RGB composite” by Martin Raspaud and Mikhail Itkin,
- “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, suspended sediment concentration visualisation and chlorophyll concentration visualisation. ℹ️ 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.
🏆 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
🏆 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
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.
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
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
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
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
Use of WIW with Landsat sensors can be used to collect long-term data (back to 1984) for monitoring wetland evolution. ℹ️ GitHub
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
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
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
Land Use Algorithm
Land Use Visualisation for Sentinel-2 using Linear Discriminant Analysis
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
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
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
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
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
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
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
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
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
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
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.