Created
June 30, 2025 13:50
-
-
Save hevgyrt/be7156a6cd90f4ff2be3cd0e6f55a1e7 to your computer and use it in GitHub Desktop.
How to extract metadata for all Sentinel-2 L2A datasets over a specific tile using CDSETool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from cdsetool.query import query_features | |
| from datetime import date, datetime | |
| from cdsetool.query import describe_collection | |
| search_terms = describe_collection("Sentinel2").keys() | |
| print(search_terms) | |
| date_from = date(2015, 1, 1) | |
| date_to = datetime.now() | |
| tile_ids = ["32VNM"] | |
| for tile_id in tile_ids: | |
| features = query_features("Sentinel2", | |
| {"tileId": tile_id, | |
| "startDate": date_from, | |
| "completionDate": date_to, | |
| "processingLevel":"S2MSI2A" | |
| }, | |
| ) | |
| print(features) | |
| output = list(features) | |
| titles = [output[i]['properties']['title'] for i in range(len(output))] | |
| with open('s2_L2A_32VNM_products.txt','w') as outfile: | |
| for tit in titles: | |
| outfile.write(tit + '\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment