sentinel-hub/sentinelhub-py

[HELP] AWSProductRequest to download SAFE files no longer in the codebase?

datalass1 opened this issue · 4 comments

I have not used SentinelHub for a while, and so the code I have (version 3.3.1) for downloading Sentinel-2 level-1C SAFE files is:

from sentinelhub import AwsProductRequest


def download_sentinel_2_imagery(s2_1c_dir: Path, product_id: str):
    """Download Sentinel-2 Level-1C .SAFE products from Amazon Web Services."""

    product_request = AwsProductRequest(product_id=product_id, safe_format=True,
                                        data_folder=s2_1c_dir)
    product_request.save_data()

Where the product_id is in this format S2A_MSIL1C_2023T**_N****_R***_T****_2023T** (asterisks in place of actual values)

What function has sentinelhub replaced AwsProductRequest with in the most recent version 3.10?

Many thanks in advance for help.

There was an example for download of Sentinel-2 SAFE files:
https://github.com/sentinel-hub/sentinelhub-py/blob/4753c158b84855b2727de6eb391208f299f28c96/examples/aws_request.ipynb

But this was removed in November 2023 (so quite recently): 29737dc

Is there anything to replace the data_request AWSProductRequest function?

Hi @datalass1,
the aws module is no longer actively maintained, hence the removal of the example.
However the code is still there, but i cannot guarantee for how long (currently there are no plans to remove it in the near future, but that could change). But now you need to import things more directly via from sentinelhub.aws import AWSProductRequest.

You will also get some deprecation warnings, but you can ignore those if this is what you need

You can also check out how to access the data through the Copernicus Data Space Ecosystem

hello @zigaLuksic, I have amended all my code now to use CDSE, the blog was perfect with python code examples to use. Many thanks!