Skip to content

Commit 2ed9e48

Browse files
author
Scisco
committed
Merge pull request #86 from developmentseed/fix/issue-73
download band 8 when pansharpen fixes #73
2 parents 9efe8ea + eb0c7fc commit 2ed9e48

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

landsat/landsat.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,11 @@ def main(args):
277277
elif args.subs == 'download':
278278
d = Downloader(download_dir=args.dest)
279279
try:
280-
downloaded = d.download(args.scenes, convert_to_integer_list(args.bands))
280+
bands = convert_to_integer_list(args.bands)
281+
if args.pansharpen:
282+
bands.append(8)
283+
284+
downloaded = d.download(args.scenes, bands)
281285

282286
if args.process:
283287
force_unzip = True if args.force_unzip else False

landsat/tests/test_landsat.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ def test_download_process_continuous(self, mock_downloader, mock_process):
112112
mock_process.assert_called_with('path/to/folder/LC80010092014051LGN00', '432', False, False, True)
113113
self.assertEquals(output, ["Image Processing Completed", 0])
114114

115+
# Call with pansharpen
116+
args = ['download', 'LC80010092015051LGN00', 'LC80010092014051LGN00', '-b', '432', '-d',
117+
self.mock_path, '-p', '--pansharpen']
118+
output = landsat.main(self.parser.parse_args(args))
119+
mock_downloader.assert_called_with(['LC80010092015051LGN00', 'LC80010092014051LGN00'], ['4', '3', '2', 8])
120+
mock_process.assert_called_with('path/to/folder/LC80010092014051LGN00', '432', False, True, False)
121+
self.assertEquals(output, ["Image Processing Completed", 0])
122+
115123
@mock.patch('landsat.landsat.Uploader')
116124
@mock.patch('landsat.landsat.process_image')
117125
@mock.patch('landsat.landsat.Downloader.download')

0 commit comments

Comments
 (0)