Download multiple images with command line

Hi, so far I was able to download only one L1C products from tile info with the command line per time with the following example code:
$ sentinelhub.aws --tile 29SNC 2019-2-24 -e
I was wondering is it possible to download multiple images at the same time. The products I would like to download have the same tile info but different dates.

Thank you in advance!

Giulia

Hi @giuliasent,

The command line interface of sentinelhub-py only supports downloading one Sentinel-2 product per command. To automatically download multiple products I suggest checking examples of Python code from this notebook: https://sentinelhub-py.readthedocs.io/en/latest/examples/aws_request.html

In first step you can use sentinelhub.WebFeatureService or sentinelhub.get_area_info to get a list of all dates for specific tile. Then in the second step you can use sentinelhub.AwsTileRequest to download each product.

Thank you for your answer. I was already trying with the Python code, but in the AwsTileRequest I can’t find the way to input a list of dates because it returns me the error: ValueError: Time must be in format YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS

AwsTileRequest can only work with a single date and provides data for only a single Sentinel-2 tile. Therefore you will have to iterate over acquisition dates and for each one initialize and execute AwsTileRequest class.

1 Like

Hi maleksandrov,

According to your answer to giuliasent, AwsTileRequest can only work with a single date. Would it be the same for AwsProductRequest?
So I´m trying to apply the examples in Accessing satellite data from AWS — Sentinel Hub 3.9.0 documentation.

Firstly, I´ve applied the example given in Searching for available data by tile:
Capture1
Secondly, I´ve applied the example given in Download data into .SAFE structure
and I have got this error: AttributeError: ‘list’ object has no attribute ‘lstrip’.
I think it is because each tile in the list is equal to 0. So, I don´t know if I´m following the correct way. Could you help me with that?
Otherwise, according to your suggestion, Could you give me an example about how iterate over acquisition dates?
Thanks.

Marce

Hi,

Could anyone help me or give me any idea about my questions?

Thanks in advance.

Marce

Hi @marcepereira,

Both AwsTileRequest and AwsProductRequest classes can download data for a single Sentinel-2 tile or product. Therefore you’ll have to use a for-loop to initialize multiple instances of a class, one for each tile.

Similar answer for the second question - you cannot pass a list of tiles to AwsTileRequest, only a single tile at once. Also, the tile has to be specified with parameters tile, time and aws_index, where aws_index is optional. In the documentation please check the example and class parameters definitions.