sentinelhub.aws.request
Data request interface for downloading satellite data from AWS
- class sentinelhub.aws.request.AwsProductRequest(product_id, *, tile_list=None, **kwargs)[source]
Bases:
_BaseAwsDataRequest
[AwsProduct
]AWS Service request class for an ESA product.
- Parameters:
product_id – original ESA product identification string (e.g.
'S2A_MSIL1C_20170414T003551_N0204_R016_T54HVH_20170414T003551'
)tile_list – list of tiles inside the product to be downloaded. If parameter is set to None all tiles inside the product will be downloaded.
bands – List of Sentinel-2 bands for request. If None all bands will be obtained
metafiles – list of additional metafiles available on AWS (e.g.
['metadata', 'tileInfo', 'preview/B01', 'TCI']
)safe_format – flag that determines the structure of saved data. If True it will be saved in .SAFE format defined by ESA. If False it will be saved in the same structure as the structure at AWS.
data_folder – location of the directory where the fetched data will be saved.
config – A custom instance of config class to override parameters from the saved configuration.
- class sentinelhub.aws.request.AwsTileRequest(*, data_collection, tile=None, time=None, aws_index=None, **kwargs)[source]
Bases:
_BaseAwsDataRequest
[AwsTile
]AWS Service request class for an ESA tile.
- Parameters:
data_collection – A collection of requested AWS data. Supported collections are Sentinel-2 L1C and Sentinel-2 L2A.
tile – tile name (e.g.
'T10UEV'
)time – tile sensing time in ISO8601 format
aws_index – there exist Sentinel-2 tiles with the same tile and time parameter. Therefore, each tile on AWS also has an index which is visible in their url path. If aws_index is set to None the class will try to find the index automatically. If there will be multiple choices it will choose the lowest index and inform the user.
bands – List of Sentinel-2 bands for request. If None all bands will be obtained
metafiles – list of additional metafiles available on AWS (e.g.
['metadata', 'tileInfo', 'preview/B01', 'TCI']
)safe_format – flag that determines the structure of saved data. If True it will be saved in .SAFE format defined by ESA. If False it will be saved in the same structure as the structure at AWS.
data_folder – location of the directory where the fetched data will be saved.
config – A custom instance of config class to override parameters from the saved configuration.
- sentinelhub.aws.request.get_safe_format(product_id=None, tile=None, entire_product=False, bands=None, data_collection=None)[source]
Returns .SAFE format structure in form of nested dictionaries. Either
product_id
ortile
must be specified.- Parameters:
product_id (str | None) – original ESA product identification string. Default is None
tile (Tuple[str, str] | None) – tuple containing tile name and sensing time/date. Default is None
entire_product (bool) – in case tile is specified this flag determines if it will be place inside a .SAFE structure of the product. Default is False
bands (None | str | List[str]) – list of bands to download. If None all bands will be downloaded. Default is None
data_collection (DataCollection | None) – In case of tile request the collection of satellite data has to be specified.
- Returns:
Nested dictionaries representing .SAFE structure.
- Return type:
dict
- sentinelhub.aws.request.download_safe_format(product_id=None, tile=None, folder='.', redownload=False, entire_product=False, bands=None, data_collection=None)[source]
Downloads .SAFE format structure in form of nested dictionaries. Either
product_id
ortile
must be specified.- Parameters:
product_id (str | None) – original ESA product identification string. Default is None
tile (Tuple[str, str] | None) – tuple containing tile name and sensing time/date. Default is None
folder (str) – location of the directory where the fetched data will be saved. Default is
'.'
redownload (bool) – if True, download again the requested data even though it’s already saved to disk. If False, do not download if data is already available on disk. Default is False
entire_product (bool) – in case tile is specified this flag determines if it will be place inside a .SAFE structure of the product. Default is False
bands (List[str] | None) – list of bands to download. If None all bands will be downloaded. Default is None
data_collection (DataCollection | None) – In case of tile request the collection of satellite data has to be specified.
- Returns:
Nested dictionaries representing .SAFE structure.
- Return type:
None