Skip to main content

My goal is to download sentinel data of a given area, specified by KML file. I want to use sentinelhub request to do this, But I have two problems:


  1. Is there a way to get a picture with the least cloud coverage? I don’t want to create a mosaick, just get the picture with the least CC in given time interval;

  2. Often I obtain a result like this:


Is there a way to specify the sentinelhub request so that all the tiles in the picture will come from the same date?


My code:


        request = SentinelHubRequest(
evalscript=script,
input_data=a
SentinelHubRequest.input_data(
data_collection=self.data_collectionsnself.satellite],
time_interval=(date_1, date_2),
maxcc=0.3
#mosaicking_order='leastCC'

)
],
responses=s
SentinelHubRequest.output_response('default', MimeType.TIFF)
],
bbox=betsiboka_bbox,
config=self.config
)
print(request)
return request

`

while the evalscript for true color image is:


//VERSION=3

function setup() {
return {
input: :{
bands: :"B02", "B03", "B04"]
}],
output: {
bands: 3
}
};
}

function evaluatePixel(sample) {
return nsample.B04, sample.B03, sample.B02];
}

Hi Weronika,


Thanks for your questions, I’ll answer them in two parts for you:


  1. This result is fully expected as you are not looking to create a mosaic. Unfortunately clouds will almost always appear in multispectral acquisitions. In your result, the least cloudy acquisition in the tile on the right is much cloudier than the least cloudy acquisition in the tile on the left.

To improve this there are two parameters you can adjust:


  • Increase your time period - if you have a narrow time range then there are less acquisitions that can be requested. Therefore, if you have use a 3 month time period over a 2 week time period you are more likely to return a less cloudy acquisition (this is a general rule of thumb, not a guarantee. Some parts of the world are much cloudier than others).

  • You can also specify a maximum cloud coverage as you already have done in your request so that the cloudiest acquisitions are excluded from your returns.

I would recommend reading the Sentinel-2 L2A documentation to understand how the percentage is calculated.


  1. To answer your second question on how to ensure that all the tiles in your return are from the same date, simply make your start and end date are the same. You can use Catalog API to make sure that there are acquisitions in your AOI on the date you specify too.


SentinelHubRequest.input_data(
data_collection=DataCollection.SENTINEL2_L2A,
time_interval=('2021-09-19', '2021-09-19'),
)


If you have any further questions, please let us know and we’ll be happy to help 🙂


Reply