custom-scripts

A repository of custom scripts that can be used with Sentinel-Hub services.

Collection of custom scripts

Custom Scripts Repository

This repository contains a collection of custom scripts for Sentinel Hub, which can be fed to the services via the URL.

Scripts are organised by sensors supported on Sentinel Hub:

You are invited to publish your own scripts - see howto.

Relevant reading

Sentinel-1

The Sentinel-1 imagery is provided by two polar-orbiting satellites, operating day and night performing C-band synthetic aperture radar imaging, enabling them to acquire imagery regardless of the weather. Main applications are for monitoring sea ice, oil spills, marine winds, waves & currents, land-use change, land deformation among others, and to respond to emergencies such as floods and earthquakes. The identical satellites orbit Earth 180° apart and at an altitude of almost 700 km, offering a global revisit time of 6-12 days depending on the area (check observation scenario). Sentinel-1’s radar can operate in four modes. The spatial resolution depends on the mode: approx. 5 m x 20 m for IW mode and approx. 20 m x 40 m for EW mode. See Copernicus services for more details.

Vegetation in agriculture algorithms

Disaster management and prevention algorithms

Urban planning algorithm

Marine and other water bodies environment algorithms

Other available scripts

Other multi-temporal scripts

Sentinel-2

Dedicated to supplying data for Copernicus services, Sentinel-2 carries a multispectral imager with a swath of 290 km. The imager provides a versatile set of 13 spectral bands spanning from the visible and near infrared to the shortwave infrared, featuring four spectral bands at 10 m, six bands at 20 m and three bands at 60 m spatial resolution. As indices primarily deal with combining various band reflectances, the table of 13 bands is given here for reference (see here for details). The names of the Sentinel-2 bands at your disposal are B01, B02, B03, B04, B05, B06, B07, B08, B8A, B09, B10, B11 and B12.

Remote sensing indices

Cloud detection algorithms

Snow and glaciers algorithms

Disaster management and prevention algorithms

Land use/cover classification algorithms

Vegetation algorithms

Agriculture and forestry algorithms

Marine and other water bodies environment algorithms

Urban planning algorithms

Other multi-temporal scripts

Other available scripts and indices

Scripts including machine learning techniques (eo-learn)

Sentinel-3

Sentinel-3 is a low Earth-orbit moderate size satellite compatible with small launchers including VEGA and ROCKOT. The main objective of the mission is to measure sea surface topography, sea and land surface temperature, and ocean and land surface color with high accuracy and reliability to support ocean forecasting systems, environmental monitoring and climate monitoring. Ocean and Land Colour Instrument (OLCI) provides a set of 21 bands ranging from the visible to the near infrared light (400 nm < λ< 1 020 nm). The Sentinel-3 provides imagery in 300 m spatial resolution. Sentinel-3 OLCI instrument ensures continuity of the ENVISAT MERIS.

Sentinel-3 OLCI

Enhanced true color scripts

Remote sensing indices

Sentinel-3 SLSTR

Sentinel-5P

Sentinel-5P provides atmospheric measurements, relating to air quality, climate forcing, ozone and UV radiation with high spatio-temporal resolution. Its data is used for monitoring of concentrations of carbon monoxide (CO), nitrogen dioxide (NO2) and ozone (O3) in air as well as for monitoring of UV aerosol index (AER_AI) and different geophysical parameters of clouds (CLOUD). EO Browser serves level 2 geophysical products. The TROPOspheric Monitoring Instrument (TROPOMI) on board of the satellite operates in the ultraviolet to shortwave infrared range with 7 different spectral bands: UV-1 (270-300nm), UV-2 (300-370nm), VIS (370-500nm), NIR-1 (685-710nm), NIR-2 (755-773nm), SWIR-1 (1590-1675nm) and SWIR-3 (2305-2385nm). Its spatial resolution is below 8km for wavelengths above 300nm and below 50km for wavelength below 300nm. It covers almost the whole globe (95 % coverage for latitudes in the interval [-7°, 7°]).

Available scripts

Landsat 8

The Landsat program is the longest running enterprise for acquisition of satellite imagery of Earth, running from 1972. The most recent, Landsat 8, was launched on February 11, 2013. Landsat-8 data has 11 spectral bands with spatial resolutions ranging from 15 to 60 meters. The names of the Landsat-8 bands at your disposal are B01, B02, B03, B04, B05, B06, B07, B08, B09, B10 and B11.

Remote sensing indices

Other available scripts

Landsat 5 and 7

Landsat 7 and the retired Landsat 5 orbit’s are sun-synchronous, with near-polar orbits, flying at an altitude of 705 km (438 mi). Landsat 5 long outlived its original three-year design life. Developed by NASA and launched in 1984, Landsat 5 has orbited the planet over 150,000 times while transmitting over 2.5 million images land surface images around the world. The Landsat 7 satellite still orbits the the Earth in a sun-synchronous, near-polar orbit, at an altitude of 705 km (438 mi). The satellites are multispectra, providing visible, near infrared, mid infrared and thermal bands.

For more on Landsat 5, including its available bands, read here and for Landsat 7, read here..

MODIS

The Moderate Resolution Imaging Spectroradiometer (MODIS) MCD43A4 version 6 on Sentinel Hub is hosted at Amazon Web Services (AWS). Dataset is updated daily and provides the 500 meter Nadir Bidirectional reflectance distribution function Adjusted Reflectance (NBAR) data of MODIS “land” bands 1-7: B01, B02, B03, B04, B05, B06 and B07.

Remote sensing indices

DEM

DEM (digital elevation model) is a 3D representation of the terrain’s surface created from terrain elevation data. It can be used for terrain analysis and orthorectification, which helps improve the accuracy of satellite imagery. With DEM, you are able to measure and analyze your area of interest or integrate data into a 3D application as a terrain data source. Sentinel Hub is using MapZen’s DEM, available through Amazon Web Services (AWS) in US. This dataset is based on SRTM30 (30 m resolution) but is in several places improved with local datasets. It is static and does not depend on the date (the values are updating as MapZen is improving the dataset). Read the blog post on how to explore the DEM dataset and see our API documentation for details.

PlanetScope (Commercial)

PlanetScope satellite constellation consists of more than 130 small satellites called Doves. The satellites are launched in groups, which constantly improves mission’s characteristics such as revisit times, spatial and spectral resolutions. PlanetScope data complements Sentinel-2 with better spatial resolution (3m) and almost global daily coverage. It is an excellent source for vegetation monitoring. For more information on PlanetScope, visit our documentation page.

The spectral bands of PlanetScope data are the following:

B1 - Blue, resolution 3m

B2 - Green, resolution 3m

B3 - Red, resolution 3m

B4 - Near Infrared, resolution 3m

Airbus Pleiades (Commercial)

Pléiades constelation is composed of two twin satellites orbiting the Earth 180° apart. The satellites deliver the incredible global 0.5 m spectral resolution imagery. Pleiades’ satellites share the orbit with SPOT satellites, which makes it possible to combine the data form both sources. The Pléiades data with its high spatial resolution is suitable for a wide range of remote sensing applications such as vegetation monitoring, precise mapping, as well as risk and disaster management. To learn more about Pleiades, visit our documentation page.

The spectral bands of Pleiades data are the following:

B0 - Blue (430-550 nm, resolution 2m)

B1 - Green (490-610 nm, resolution 2m)

B2 - Red (600-720 nm), resolution 2m

B3 - Near Infrared (750-950 nm), resolution 2m

PAN - Panchromatic (480-830 nm), resolution 0.5m

Pleiades’s RGB bands are in 2 meter spatial resolution. To take advantage of the 0.5 m PAN band, the pansharpening process is required.

Airbus SPOT (Commercial)

SPOT 6/7 is a satellite constellation providing very high-resolution optical imagery and is owned by Airbus. It is composed of two twin satellites orbiting the Earth 180° apart. The satellites deliver 1.5 m optical imagery and offer a daily revisit capability to any point on the globe. SPOT 6/7 data with its high spatial resolution is suitable for a range of remote sensing applications such as vegetation monitoring, precise mapping, risk and disaster management. To learn more about SPOT, visit our documentation page.

The spectral bands of SPOT data are the following:

B0 - Blue (454-519 nm, resolution 6m)

B1 - Green (527-587 nm, resolution 6m)

B2 - Red (624-694 nm), resolution 6m

B3 - Near Infrared (756-880 nm), resolution 6m

PAN - Panchromatic (455-744 nm), resolution 1.5m

SPOT’s RGB bands are in 6 meter spatial resolution. To take advantage of the 1.5 m PAN band, the pansharpening process is required.

Note: Because Pleiades and SPOT bands are very similar in wavelengths, the same custom scripts are used for both constellations.

Data fusion

The combination of multiple remote sensing data sources can provide invaluable information that would not be obtained with a single sensor alone. Observation-level or pixel-based fusion combines pixels from different sources to form an image containing new information (more information). Two widely used examples of pixel-based fusion are pan-sharpening and the fusion of radar and multispectral optical images. On the one hand, pan-sharpening consists of blending a high-resolution panchromatic image with a lower resolution multispectral image to obtain a high-resolution multispectral image. On the other hand, the combination of radar and optical imagery provides images with increased spectral resolution that can mitigate the drawbacks of each product (such as cloud cover for optical images), but also provide increased temporal resolution with more frequent overpasses.

Available scripts

Copernicus services

CORINE Land Cover

In 1985 the ‘Coordination of Information on the Environment’ (CORINE) programme was initiated by the European Commission. It aimed at collecting environmental information on high priority topics for the European Union (air, water, soil, land cover, coastal erosion, biotopes, etc.). Since 1994, the established databases and programmes are managed by the European Environment Agency (EEA). The CORINE Land Cover (CLC) inventory is a vector-based dataset that consists of 44 land cover and land use classes.

CORINE Land Cover data is available in our public collections.

Available scripts

Global Land Cover

Global Land Cover products at 100 m resolution are delivered annually by The Copernicus Global Land Service (CGLS). The most recent collection 3 (version 3.0.1) of 100 m Land Cover products for the years 2015 - 2019 were generated from the PROBA-V 100 m and 300 m satellite observations and several other ancillary datasets, with global coverage. Global Land Cover products are generated from 3 years input data in three modes: base reference, consolidated or near real time mode. As from 2020, (2019-conso and 2020-nrt products) are planned to be generated from the combination of Sentinel-1 and Sentinel-2 satellite observations following end of PROBA-V operations. The Global Land Cover data contains one main land cover discrete classification map and several other additional layers. For more information on Global land cover products, see the product User Manual.

Global Land Cover data is available in our public collections

Available scripts

Global Surface Water

The Global Surface Water dataset was developed by the European Commission’s Joint Research Centre (JRC) within the framework of the Copernicus Programme. It is derived from Landsat 5, 7 and 8 imagery and shows various aspects of the spatio-temporal distribution of surface water between 1984 and 2020 (with annual revisions) at the global scale in six different layers.

  1. Occurrence - Intra- and inter-annual frequency of surface water presence in the entire time range.
  2. Occurrence Change Intensity - Changes in water occurrence between two epochs, the first ranging from 1984 to 1999 and the second covering 2000 to 2020.
  3. Seasonality - Intra-annual distribution of surface water in the selected review year.
  4. Recurrence - Inter-annual variability of surface water presence in a defined water period within the entire time range.
  5. Transitions - Visualises changes in the three surface water classes (1) not water, (2) seasonal water, and (3) permanent water between the first and last year in the entire time period.
  6. Extent - Maximum extent of surface water bodies in the entire time range.

Global Surface Water data is available in our public collections.

Please check the official Global Surface Water website for more details. Detailed information on the processing methodology for the included layers can be found in the Data Users Guide and Pekel et al. (2016) as the associated scientific publication.

Available scripts

Water Bodies

The Global Water Bodies product shows the surface extent covered by inland water on permanent, seasonal or occasional basis. The product available here is the Water Bodies 100m Version 1 collection which is derived from Sentinel-2 level 1C data, starting from October 2020 after the end of the PROBA-V mission and is delivered as a monthly composite product at 100m resolution. The Water Bodies product contains one main water Bodies detection layer (WB) and one Quality layer (QUAL) that provides information on the seasonal dynamics of the detected water bodies. Water Bodies detection layer (WB) shows water bodies detected using the Modified Normalized Difference Water Index (MNDWI) derived from Sentinel-2 Level 1C data. The Quality layer (QUAL) is generated from water body occurrence statistics computed from previous monthly Water Bodies products.The occurrence statistics is ranked from low occurrence to permanent occurrence. More information about the data can be obtained from the Water Bodies product page.

Water Bodies 100m data is available in our public collections

Available scripts

Adding new custom scripts

Have a look at the template and follow the procedure described there.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.