Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 83f370d

Browse files
added documentation, converted print statements to function calls
1 parent f341dfa commit 83f370d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

sentinel_api/sentinel_api.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ def search(self, platform, min_overlap=0, download_dir=None, start_date=None, en
147147
'ingestionDate') (Default: beginPosition)
148148
**keywords: Further OpenSearch arguments can be passed to the query according to the ESA Data Hub Handbook
149149
(please see https://scihub.copernicus.eu/twiki/do/view/SciHubUserGuide/3FullTextSearch#Search_Keywords)
150+
missing under this link:
151+
- slicenumber: the graticule along an orbit; particularly important for interferometric applications
152+
to identify overlapping scene pairs
150153
151154
Mandatory args:
152155
platform
@@ -200,15 +203,15 @@ def search(self, platform, min_overlap=0, download_dir=None, start_date=None, en
200203
if len(subscenes) < 100:
201204
break
202205

203-
print '%s scenes after initial search' % len(scenes)
206+
print('%s scenes after initial search' % len(scenes))
204207
if len(scenes) > 0:
205208
scenes = self._filter_existing(scenes)
206209
scenes = self._filter_overlap(scenes, geom, min_overlap)
207-
print '%s scenes after filtering before merging' % len(scenes)
210+
print('%s scenes after filtering before merging' % len(scenes))
208211
self.__scenes = self._merge_scenes(self.__scenes, scenes)
209212

210213
print('===========================================================')
211-
print '%s total scenes after merging' % len(self.__scenes)
214+
print('%s total scenes after merging' % len(self.__scenes))
212215
print('===========================================================')
213216

214217
def get_scenes(self):
@@ -221,7 +224,7 @@ def print_scenes(self):
221224
def sorter(x): return re.findall('[0-9T]{15}', x)[0]
222225

223226
titles = sorted([x['title'] for x in self.__scenes], key=sorter)
224-
print '\n'.join(titles)
227+
print('\n'.join(titles))
225228

226229
def write_results(self, file_type, filename, output=False):
227230
"""Write results to disk in different kind of formats
@@ -271,16 +274,16 @@ def download_all(self, download_dir=None):
271274
try:
272275
response = requests.get(url, auth=(self.__esa_username, self.__esa_password), stream=True)
273276
except requests.exceptions.ConnectionError:
274-
print 'Connection Error'
277+
print('Connection Error')
275278
continue
276279
if 'Content-Length' not in response.headers:
277-
print 'Content-Length not found'
278-
print url
280+
print('Content-Length not found')
281+
print(url)
279282
continue
280283
size = int(response.headers['Content-Length'].strip())
281284
if size < 1000000:
282-
print 'The found scene is to small: %s (%s)' % (scene['title'], size)
283-
print url
285+
print('The found scene is to small: %s (%s)' % (scene['title'], size))
286+
print(url)
284287
continue
285288

286289
print('Size of the scene: %s MB' % (size / 1024 / 1024)) # show in MegaBytes
@@ -305,7 +308,7 @@ def download_all(self, download_dir=None):
305308
sys.exit(0)
306309

307310
# Check if file is valid
308-
print "Check if file is valid: "
311+
print("Check if file is valid: ")
309312
valid = self._is_valid(path)
310313

311314
if not valid:

0 commit comments

Comments
 (0)