-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
82 lines (73 loc) · 2.72 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import fire
import os
import SentinelDownloader
os.system('rm -r $HOME/dhusget_tmp')
class sentineldownloader(object):
"""Class for Fire CLI operation."""
def download_manifests(
self,
start_date,
end_date,
pipeline_name,
manifests_dir,
platformname,
product,
geom_wkt,
verbose,
processingmode,
username,
password
):
dates = SentinelDownloader.utils.GetDateRange(
start = start_date,
end = end_date
)
geom = SentinelDownloader.utils.WKTtoGDF(geom_wkt)
SentinelDownloader.download.download_manifests(
pipeline_name = pipeline_name,
manifests_dir = manifests_dir,
platformname = platformname,
product = product,
dates = dates,
geom = geom,
verbose = True,
processingmode = 'NT',
username = username,
password = password
)
def download_data(
self,
pipeline_name,
manifests_dir,
downloads_dir,
username,
password,
semaphore = 5,
attempts_limit = 30
):
"""_summary_
Args:
pipeline_name (_type_): _description_
manifests_dir (_type_): _description_
downloads_dir (_type_): _description_
username (_type_): _description_
password (_type_): _description_
semaphore (int, optional): _description_. Defaults to 5.
attempts_limit (int, optional): _description_. Defaults to 30.
"""
SentinelDownloader.download.download_data(
pipeline_name = pipeline_name,
manifests_dir = manifests_dir,
downloads_dir = downloads_dir,
semaphore = semaphore,
username = username,
password = password,
attempts_limit = attempts_limit
)
def config_run(
self,
config_path
):
SentinelDownloader.download.config_run(config_path)
if __name__ == '__main__':
fire.Fire(sentineldownloader)