diff --git a/scenes/dates.py b/scenes/dates.py index 7cbe206ba923e266237547d4c0eb29e1382c629f..22cdf07e93ba5957638ab740f0d45fff765ea18b 100644 --- a/scenes/dates.py +++ b/scenes/dates.py @@ -10,7 +10,8 @@ MAXDATE = datetime.datetime.strptime("3000-01-01", "%Y-%m-%d") def get_timestamp(dt): - """Converts datetime.datetime into a timestamp (in seconds) + """ + Converts datetime.datetime into a timestamp (in seconds) Args: dt: datetime.datetime instance diff --git a/scenes/download.py b/scenes/download.py index 2b9aaafbdce1999981f7ea7dea3137ec312d12f2..1b8f68837e4797b987bc49ee8c52905b966110b7 100644 --- a/scenes/download.py +++ b/scenes/download.py @@ -14,7 +14,8 @@ from scenes import dates def compute_md5(fname): - """Compute md5sum of a file + """ + Compute md5sum of a file Args: fname: file name @@ -28,7 +29,8 @@ def compute_md5(fname): def is_file_complete(filename, md5sum): - """Tell if a file is complete + """ + Tell if a file is complete Args: filename: path of the file @@ -44,7 +46,8 @@ def is_file_complete(filename, md5sum): def curl_url(url, postdata, verbose=False, out_file=None, header=None): - """Use PyCurl to make some requests + """ + Use PyCurl to make some requests Args: url: url @@ -174,7 +177,8 @@ class TheiaDownloader: return token def _query(self, dict_query): - """Search products + """ + Search products Return a dict with the following structure TILE_NAME @@ -214,7 +218,8 @@ class TheiaDownloader: return tiles_dict def _download_tiles_and_dates(self, tiles_dict, download_dir): - """Download a product. + """ + Download a product. Updates the "tiles_dict" with the filename of the downloaded files @@ -255,7 +260,8 @@ class TheiaDownloader: return tiles_dict def download_in_range(self, bbox_wgs84, dates_range, download_dir=None, level="LEVEL3A"): - """Download all images within spatial and temporal ranges + """ + Download all images within spatial and temporal ranges Args: bbox_wgs84: bounding box (WGS84) @@ -287,7 +293,8 @@ class TheiaDownloader: return search_results def download_closest(self, bbox_wgs84, acq_date, download_dir=None, level="LEVEL3A"): - """Query Theia catalog, download_closest the files + """ + Query Theia catalog, download_closest the files Args: bbox_wgs84: bounding box (WGS84) diff --git a/scenes/raster.py b/scenes/raster.py index ba00ac0a7574013dbeb02c18c0168a9f5a50b1cc..0c4c1685d497bd16ba86525a5e383120e572fec9 100644 --- a/scenes/raster.py +++ b/scenes/raster.py @@ -62,7 +62,8 @@ def get_extent_wgs84(gdal_ds): def get_epsg_extent_bbox(filename): - """Returns (epsg, extent_wgs84) from a raster file that GDAL can open. + """ + Returns (epsg, extent_wgs84) from a raster file that GDAL can open. Args: filename: file name diff --git a/scenes/sentinel.py b/scenes/sentinel.py index 051f75566d38aa7c9e507a67cfb3a34cc9629082..342b0ad7076023e5a5eb78c152866a4c22728a46 100644 --- a/scenes/sentinel.py +++ b/scenes/sentinel.py @@ -55,7 +55,8 @@ class Sentinel23ASource(Sentinel2Source): """Sentinel-2 level 3A source class""" def flg_msk_drilled(self, keep_flags_values=(3, 4), nodata=-10000): - """Return the source drilled from the FLG mask + """ + Return the source drilled from the FLG mask Args: keep_flags_values: flags values to keep (Default value = (3, 4)). Can be: @@ -168,7 +169,8 @@ class Sentinel2SceneBase(Scene): super().__init__(acquisition_date=acquisition_date, bbox_wgs84=bbox_wgs84, epsg=epsg) def get_file(self, endswith): - """Return the specified file. + """ + Return the specified file. Args: endswith: filtered extension @@ -188,7 +190,8 @@ class Sentinel2SceneBase(Scene): return filtered_files_list[0] def get_band(self, suffix1, suffix2): - """Return the file path for the specified band. + """ + Return the file path for the specified band. Args: suffix1: suffix 1, e.g. "FRE" @@ -204,7 +207,8 @@ class Sentinel2SceneBase(Scene): return self.get_file(endswith="_{}_{}.tif".format(suffix1, suffix2)) def get_metadata(self): - """Get metadata + """ + Get metadata Returns: metadata: dict @@ -228,7 +232,8 @@ class Sentinel2SceneBase(Scene): class Sentinel22AScene(Sentinel2SceneBase): - """Sentinel-2 level 2A scene class. + """ + Sentinel-2 level 2A scene class. The class carries all the metadata from the root_scene, and can be used to retrieve its imagery. @@ -249,7 +254,8 @@ class Sentinel22AScene(Sentinel2SceneBase): self.edg_r2_msk_file = self.get_file("_EDG_R2.tif") def get_imagery(self): # pylint: disable=arguments-differ - """ Get imagery + """ + Get imagery Returns: Imagery instance @@ -258,7 +264,8 @@ class Sentinel22AScene(Sentinel2SceneBase): return Sentinel22AImagery(self) def get_metadata(self): - """ Get metadatas + """ + Get metadata Returns: metadata: dict @@ -293,7 +300,8 @@ class Sentinel23AScene(Sentinel2SceneBase): self.flg_r2_msk_file = self.get_file("_FLG_R2.tif") def get_imagery(self): # pylint: disable=arguments-differ - """ Get imagery + """ + Get imagery Returns: Imagery instance @@ -302,7 +310,8 @@ class Sentinel23AScene(Sentinel2SceneBase): return Sentinel23AImagery(self) def get_metadata(self): - """ Get metadatas + """ + Get metadata Returns: metadata: dict diff --git a/scenes/spot.py b/scenes/spot.py index 1369da234be222c17884727958624f8d70c1e4c3..573f2c06c3c3e999b5b3cd0d3c34f59f92d607b3 100644 --- a/scenes/spot.py +++ b/scenes/spot.py @@ -300,7 +300,7 @@ class Spot67Scene(Scene): def get_metadata(self): """ - Get metadatas + Get metadata Returns: metadata: dict