Skip to content

Commit 660a2fe

Browse files
author
Scisco
committed
download and process multiple scenes resolves #81 #84
1 parent de7bf82 commit 660a2fe

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

landsat/landsat.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,17 @@ def main(args):
269269
elif args.subs == 'download':
270270
d = Downloader(download_dir=args.dest)
271271
try:
272-
if d.download(args.scenes, convert_to_integer_list(args.bands)):
273-
if args.process:
272+
downloaded = d.download(args.scenes, convert_to_integer_list(args.bands))
273+
274+
if args.process:
275+
for scene, src in downloaded.iteritems():
274276
if args.dest:
275-
path = join(args.dest, args.scenes[0])
277+
path = join(args.dest, scene)
276278
else:
277-
path = join(settings.DOWNLOAD_DIR, args.scenes[0])
279+
path = join(settings.DOWNLOAD_DIR, scene)
278280

279281
# Keep using Google if the image is before 2015
280-
if (int(args.scenes[0][12]) < 5 or not args.bands):
282+
if src == 'google':
281283
path = path + '.tar.bz'
282284

283285
stored = process_image(path, args.bands, False, args.pansharpen)
@@ -291,9 +293,11 @@ def main(args):
291293
return ["Connection timeout. Probably the region parameter is incorrect", 1]
292294
u.run(args.bucket, get_file(stored), stored)
293295

294-
return ["The output is stored at %s" % stored]
295-
else:
296-
return ['Download Completed', 0]
296+
v.output("The output is stored at %s" % stored, normal=True, arrow=True)
297+
298+
return ['Image Processing Completed', 0]
299+
else:
300+
return ['Download Completed', 0]
297301
except IncorrectSceneId:
298302
return ['The SceneID provided was incorrect', 1]
299303

0 commit comments

Comments
 (0)