Sentinel-2 is a satellite constellation maintained by ESA used to monitor land variability. Use this tag for questions related to processing Sentinel-2 images & data. Add other tags of the programming language you are using, as appropriate.
Questions tagged [sentinel2]
81 questions
10
votes
1 answer
How to download a sentinel images from google earth engine using python API in tfrecord
While trying to download sentinel image for a specific location, the tif file is generated by default in drive but its not readable by openCV or PIL.Image().Below is the code for the same. If I use the file format as tfrecord. There are no Images…

Mohit Anand
- 101
- 1
- 5
6
votes
0 answers
"HTTP status 500 Internal Server Error :UnsupportedOperationException : Error creating stream from file"- SentinelAPI
I'm using SentinelAPI (from sentinelsat), to download Satellite imagery from sentinel.
The code i'm using (not fully):
from sentinelsat import SentinelAPI
api = SentinelAPI(user, password, 'https://scihub.copernicus.eu/dhus')
products =…

Alon8200
- 151
- 1
- 2
- 8
6
votes
2 answers
Export Google Earth Engine RGB Sentinel-2 Imagery to Google Drive using Python API
This post isn't a question but a solution to a problem I have been trying to solve for a while. Hopefully somebody else will find the code useful!
I wanted to export Sentinel-2 Satellite imagery…

Misc584
- 357
- 3
- 16
4
votes
0 answers
How to create rayshader time-series animation using R?
I want to create a timelapse visualization of terrain motion using rayshader packages. I found this web article which gives a useful tip by using Venµs images.
The script which in the article is…

Gokul Anand
- 177
- 12
4
votes
1 answer
How to stack Sentinel bands?
I work with many Sentinel-2 images whose 12 strips I would like to stack into a single file. My images are in envi format (img and hdr).
I tried to do the concatenation with the module rsgislib by applying the following code :
import rsgislib
from…

Axelle
- 107
- 1
- 6
3
votes
1 answer
How to correct sentinel 2 baseline v0400 offset?
I'm processing Sentinel 2 L2A data in sen2r as downloaded from googlecloud and spotted an issue: if computing NDVI from bands 4 and 8 at 10 m resolution, I get an extreme offset after January 26th as exemplified by the last 7 values in the following…

Allan
- 31
- 1
3
votes
1 answer
Plot true color Sentinel-2A imagery in Matlab
Through a combination of non-matlab/non-native tools (GDAL) as well as native tools (geoimread) I can ingest Sentinel-2A data either a indiviual bands or as an RGB image having employed gdal merge. I'm stuck at a point where using
imshow(I,…

John Chris
- 153
- 5
3
votes
4 answers
How to select only a file type with os.listdir?
after having concatenated 10 strips of the same image, I want to convert them into reflectance and therefore divide them by 10,000. Nevertheless I have two types of files in my folders, except I want to apply my code only to my.img file and not to…

Axelle
- 107
- 1
- 6
3
votes
1 answer
Load RGB image in python from ESA Sentinel-2 product and save with openCV
As from ESA snap, for a RGB image we should put Band 4 into Red Channel, Band 3 into Green Channel and Band 2 into Blue Channel. How can we read those bands with python into a numpy array so we could do whatever image processing we want and then…

Ioannis Nasios
- 8,292
- 4
- 33
- 55
2
votes
2 answers
Downscaling sentinel-2 bands to 10m using R language
I'm trying to calculate NDRE using sentinel-2 bands in R language.
The formula for NDRE = (nir-re)/(nir+re)
nir- Near InfraRed (Band8)
re - RedEdge (Band5)
My Code:
library(raster)
library(RStoolbox)
re_path <-…

Repsol Rider
- 21
- 2
2
votes
1 answer
Error ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
I am working on importing Sentinel 2 satellite images to jupyter notebook for applying raster analysis but while importing I have faced this issue:
from sentinelsat import SentinelAPI
user = 'Username'
password = 'password'
api = SentinelAPI(user,…

Ramez Saeed
- 21
- 3
2
votes
1 answer
How to use s2_mask() function in R to mask clouds in Sentinel 2 image?
I want to use the toolbox sen2r to process Sentinel 2 L2A data in R. I have already manually downloaded the images in .SAFE format.
I have used the s2_translate() to convert .SAFE format to geotif:
in_dir <- "D:/data/s2"
out_dir…

dtanon
- 173
- 1
- 2
- 14
2
votes
0 answers
Google Earth Engine Sentinel-2 Level2 set to NaN clouds
I would like to set to NaN or Null all clouds to a cut section of a Sentinel-2 MSI level 2, for one band only if possible (not all RGB) I have used the following code:
/**
* Function to mask clouds using the Sentinel-2 QA band
* @param {ee.Image}…

Gab
- 175
- 1
- 1
- 6
2
votes
0 answers
How to display individual images by each date in google earth engine?
I am new to google earth engine and not so familiar with javascript. I want to display the cleared images (B4,B3,B2 bands) of Sentinel 2 by each dates in layers (each layer represent each date). The code is shown as below, but always get error 'no…

rtyme
- 33
- 3
2
votes
0 answers
rstudio plotRGB Warning messages: 1: In .local(x, ...) : layer was changed to 1
I'm trying to plot an Sentinel2 Image in R. I want to use plotRGB to get a true color image.
My script looks like that:
library(raster)
library(sp)
library(rgdal)
library(ggplot2)
r=raster("Part1.tif")
brick_r=brick(r)
plotRGB(brick_r, r=1, g=2,…

Max
- 45
- 3