sentinel-hub / sentinelhub-py

Download and process satellite imagery in Python using Sentinel Hub services.
http://sentinelhub-py.readthedocs.io/en/latest/
MIT License
798 stars 243 forks source link

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

Closed datalass1 closed 6 months ago

datalass1 commented 6 months ago

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.

datalass1 commented 6 months ago

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): https://github.com/sentinel-hub/sentinelhub-py/commit/29737dcc854c40f75f1ee073e48485542cbd72c4

Is there anything to replace the data_request AWSProductRequest function?

zigaLuksic commented 6 months ago

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

zigaLuksic commented 6 months ago

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

datalass1 commented 6 months ago

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