sentinelhub.aws.data_safe

Module for creating .SAFE structure with data collected from AWS

class sentinelhub.aws.data_safe.SafeProduct(product_id, tile_list=None, **kwargs)[source]

Bases: AwsProduct

Class implementing transformation of Sentinel-2 satellite products from AWS into .SAFE structure

Parameters:
  • product_id – ESA ID of the product

  • tile_list – list of tile names

  • parent_folder – location of the directory where the fetched data will be saved.

  • bands – List of Sentinel-2 bands for request. If parameter is set to None all bands will be used.

  • metafiles – List of additional metafiles available on AWS (e.g. ['metadata', 'tileInfo', 'preview/B01', 'TCI']). If parameter is set to None the list will be set automatically.

  • config – A custom instance of config class to override parameters from the saved configuration.

get_requests()[source]

Creates product structure and returns list of files for download

Returns:

list of download requests

Return type:

Tuple[List[DownloadRequest], List[str]]

get_safe_struct()[source]

Describes a structure inside tile folder of ESA product .SAFE structure

Returns:

nested dictionaries representing .SAFE structure

Return type:

dict

get_main_folder()[source]
Returns:

name of main folder

Return type:

str

get_datastrip_list()[source]
Returns:

list of datastrips folder names and urls from productInfo.json file

Return type:

List[Tuple[str, str]]

get_datastrip_name(datastrip)[source]
Parameters:

datastrip (str) – name of datastrip

Returns:

name of datastrip folder

Return type:

str

get_datastrip_metadata_name(datastrip_folder)[source]
Parameters:

datastrip_folder (str) – name of datastrip folder

Returns:

name of datastrip metadata file

Return type:

str

get_product_metadata_name()[source]
Returns:

name of product metadata file

Return type:

str

get_report_name()[source]
Returns:

name of the report file of L2A products

Return type:

str

get_report_time()[source]

Returns time when the L2A processing started and reports was created. :return: String in a form YYYYMMDDTHHMMSS

Return type:

str

class sentinelhub.aws.data_safe.SafeTile(*args, **kwargs)[source]

Bases: AwsTile

Class implementing transformation of Sentinel-2 satellite tiles from AWS into .SAFE structure

Initialization parameters are inherited from parent class

Parameters:
  • args (Any) –

  • kwargs (Any) –

get_requests()[source]

Creates tile structure and returns list of files for download.

Returns:

list of download requests for

Return type:

Tuple[List[DownloadRequest], List[str]]

get_safe_struct()[source]

Describes a structure inside tile folder of ESA product .SAFE structure.

Returns:

nested dictionaries representing .SAFE structure

Return type:

dict

get_tile_id()[source]

Creates ESA tile ID

Returns:

ESA tile ID

Return type:

str

get_sensing_time()[source]
Returns:

Exact tile sensing time

Return type:

str

get_datastrip_time()[source]
Returns:

Exact datastrip time

Return type:

str

get_datatake_time()[source]
Returns:

Exact time of datatake

Return type:

str

get_main_folder()[source]
Returns:

name of tile folder

Return type:

str

get_tile_metadata_name()[source]
Returns:

name of tile metadata file

Return type:

str

get_aux_data_name()[source]
Returns:

name of auxiliary data file

Return type:

str

get_img_name(band, resolution=None)[source]
Parameters:
  • band (str) – band name

  • resolution (str | None) – Specifies the resolution in case of Sentinel-2 L2A products

Returns:

name of band image file

Return type:

str

get_qi_name(qi_type, band='B00', data_format=MimeType.GML)[source]
Parameters:
  • qi_type (str) – type of quality indicator

  • band (str) – band name

  • data_format (MimeType) – format of the file

Returns:

name of gml file

Return type:

str

get_preview_name()[source]

Returns .SAFE name of full resolution L1C preview :return: name of preview file

Return type:

str