sentinelhub.aws.request

Data request interface for downloading satellite data from AWS

class sentinelhub.aws.request.AwsProductRequest(*args, **kwargs)[source]

Bases: _BaseAwsDataRequest[AwsProduct]

AWS Service request class for an ESA product.

Parameters
  • 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.

create_request()[source]

An abstract method for logic of creating download requests

Return type

None

class sentinelhub.aws.request.AwsTileRequest(*args, **kwargs)[source]

Bases: _BaseAwsDataRequest[AwsTile]

AWS Service request class for an ESA tile.

Parameters
  • 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.

create_request()[source]

An abstract method for logic of creating download requests

Return type

None

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 or tile must be specified.

Parameters
  • product_id (Optional[str]) – original ESA product identification string. Default is None

  • tile (Optional[Tuple[str, str]]) – 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 (Union[None, str, List[str]]) – list of bands to download. If None all bands will be downloaded. Default is None

  • data_collection (Optional[DataCollection]) – 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 or tile must be specified.

Parameters
  • product_id (Optional[str]) – original ESA product identification string. Default is None

  • tile (Optional[Tuple[str, str]]) – 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 (Optional[List[str]]) – list of bands to download. If None all bands will be downloaded. Default is None

  • data_collection (Optional[DataCollection]) – In case of tile request the collection of satellite data has to be specified.

Returns

Nested dictionaries representing .SAFE structure.

Return type

None