aws_safe

Module for creating .SAFE structure with data from AWS

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

Bases: sentinelhub.aws.AwsProduct

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

Parameters:
  • product_id (str) – ESA ID of the product
  • tile_list (list(str) or None) – list of tile names
  • parent_folder (str) – location of the directory where the fetched data will be saved.
  • bands (list(str) or None) – List of Sentinel-2 bands for request. If parameter is set to None all bands will be used.
  • metafiles (list(str) or None) – 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.
get_requests()[source]

Creates product structure and returns list of files for download

Returns:list of download requests
Return type:list(download.DownloadRequest)
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((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 :rtype: str

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

Bases: sentinelhub.aws.AwsTile

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

Initialization parameters are inherited from parent class

get_requests()[source]

Creates tile structure and returns list of files for download.

Returns:list of download requests for
Return type:list(download.DownloadRequest)
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 or 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: '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 :rtype: str