Here I provide some code snippets, which will guide you to the right direction. First thing though, is to set up your python environment with the credentials. You can apply for a free trial, if you don’t have it. Here you can find a tutorial to set up your virtual environment.
Then, import the required libraries:
from sentinelhub import CRS, BBox, Geometry, DataCollection, SHConfig, SentinelHubCatalog
You can define the bounding box or load a Geojson with the selected area of your analysis. In this example, we’ll use a bounding box:
catalog = catalog = SentinelHubCatalog(config=config)
bbox = BBox(bbox=[12.44693, 41.870072, 12.541001, 41.917096], crs=CRS.WGS84)
search_iterator = catalog.search(
DataCollection.SENTINEL2_L2A,
bbox=bbox,
time=('2022-01-01', '2022-10-31'),
)
results = list(search_iterator)
As an output you’ll have a JSON file from which you can extract only the ‘id’ of the scenes:
id_list = [i['id'] for i in results]
After that, you can easily extract the tiles of your interest. You can check this link with information about naming convention for Sentinel 2 images.
Let’s say, you want to extract the ‘T32TQM’ tiles:
T32TQM_tiles = [i for i in id_list if 'T32TQM' in i]
So, we output the tiles that we wanted to keep. Of course, you can improve the code as you wish.
Hope you find this useful.
Lucia