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
2
votes
2 answers
How to calculate Tasseled Cap Transformation for Sentinel-2 images (from GEE) with different resolution of bands in R?
I downloaded Sentinel-2 stack from the Google Earth Engine. For the export I used resolution (scale: 10), while some bands there should have resolution 20 m (SWIR) or 60 m(e.g. Cirrus):
Export.image.toDrive({
image: exportImgSentinel,
…

Maksym Matsala
- 57
- 9
2
votes
0 answers
Issues - Extracting satellite image using sentinelsat
I am using the below code to extract satellite image using sentinelsat
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date
api = SentinelAPI('userid', 'password',…

Subramanian
- 67
- 1
- 10
2
votes
1 answer
Resampling with gdalwarp results in IndentationError: unexpected indent
I work with Sentinel2 images and I'm trying to resample them.
I tried the following code:
import os, fnmatch
INPUT_FOLDER = "/d/afavro/Bureau/test_resampling/original"
OUTPUT_FOLDER = "/d/afavro/Bureau/test_resampling/resampling_10m"
def…

Axelle
- 107
- 1
- 6
2
votes
1 answer
Google Earth Engine Python API: Map function over image collection with a list of bands
I have been using the code by Sam Murphy for atmospheric correction of Sentinel-2 images in Google Earth Engine. All goes well and it runs very fast for a single image. What I would like to do is map the following code over an image…

Visithuru
- 21
- 1
- 7
1
vote
0 answers
mean pixel values over several years with sentinel 2 NDVI
I have images over 6 years of NDVI, NDWI, NDMI, MNDWI, SSI, IB and IB2 done with Sentinel 2.
I'd like to have the mean value of each pixel over those years for each month and export it to be able to open it in QGis.
For now my code looks like this…

sam
- 47
- 4
1
vote
0 answers
Incomplete image coverage of Area of Interest (AOI) in Earth Engine using Jupyter Notebook
I am working on analyzing satellite imagery in Earth Engine for an
Area of Interest (AOI) specified by a shapefile polygon using python 3
on a jupyter notebook. However, the satellite images retrieved using
the COPERNICUS/S2 image collection only…

kojo justine
- 103
- 1
- 12
1
vote
1 answer
Change number of bands in rasterio
I'm working with some TIFF images, and I want to add another band to an existing image.
Here's the code that I use to read the image:
# Read the image
image = rasterio.open('input.tiff')
with rasterio.open("input.tiff", 'r+') as src:
crs =…

Salvatore Danilo Palumbo
- 117
- 1
- 9
1
vote
1 answer
Crop TIFF using JPG mask
I'm currently working on cloud removals from satellite data (I'm pretty new).
This is the image I'm working on (TIFF)
And this is the mask, where black pixels represent clouds (JPG)
I'm trying to remove the clouds from the TIFF, using the mask to…

Salvatore Danilo Palumbo
- 117
- 1
- 9
1
vote
0 answers
How to Solve "ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))"
I want to download sentinel-2 imagery for a research, using sentinelsat. However, I keep receiving ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe')). How do I solve this and get the data?
Here's my approach:
import…

Akpakli Edudzi
- 39
- 4
1
vote
0 answers
Problems with the Sentinel.jl package of Julia
Following the example given in the README of the github repository of this package (https://github.com/mhudecheck/Sentinel.jl), the saveList() function creates the /.img_cache folder but then it prints a "false" value, but it stays as if it was in…
1
vote
3 answers
Read Sentinel-2 bands into R retrieves high values
When I directly read into R the jp2 band files I get unusual high values compared to when I read the files in SNAP (version 9). To read the bands into R I use terra package (you can also use raster package) and the values range from 0 to 18000 more…

candelas762
- 137
- 3
1
vote
2 answers
Sentinel-2 Enhanced Vegetation Index
I am using Sentinel-2 data to calculate the NDVI and the Enhanced Vegetation Index (EVI):
NDVI <- (B8 - B4) / (B8 + B4)
## Works great
EVI <- 2.5*(B8-B4)/((B8+6*B4-7.5*B2)+1)
## Wonky
B8, B4, and B2 are RasterLayers of the Sentinel 2 bands (B8 =…

Mark Thompson
- 163
- 9
1
vote
0 answers
How do you import sentinel - 2 data in Earth engine
This is the code i have so far.
var roi = ee.FeatureCollection(polygon);
Map.addLayer(roi, {}, 'Turkey');
//Load Sentinel data
var image = ee.ImageCollection("COPERNICUS/S2_SR")
filterDate('2019-04-01', '2019-04-10')
//Remove cloud…

Tharini
- 11
- 1
1
vote
2 answers
How can I retrieve specific information from a XML file using python?
I am working with Sentinel-2 Images, and I want to retrieve the Cloud_Coverage_Assessment from the XML file. I need to do this with Python.
Does anyone have any idea how to do this? I think I have to use the xml.etree.ElementTree but I'm not sure…

Niek
- 51
- 8
1
vote
0 answers
Why sentinel-2 bands contain values around 25000?
I am trying to process .jp2 files using Python. Data came from sentinel-2 as it is written in MTD_MSIL1C.xml file.
When I read files using rasterio library I receive numpy arrays with values greater than 20k.
img = rasterio.open('some_band.jp2',…

Казыбек Аскарбек
- 31
- 2