Skip to content

Commit

Permalink
Merge pull request #86 from developmentseed/fix/issue-73
Browse files Browse the repository at this point in the history
download band 8 when pansharpen fixes #73
  • Loading branch information
Scisco committed May 29, 2015
2 parents 9efe8ea + eb0c7fc commit 2ed9e48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion landsat/landsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ def main(args):
elif args.subs == 'download':
d = Downloader(download_dir=args.dest)
try:
downloaded = d.download(args.scenes, convert_to_integer_list(args.bands))
bands = convert_to_integer_list(args.bands)
if args.pansharpen:
bands.append(8)

downloaded = d.download(args.scenes, bands)

if args.process:
force_unzip = True if args.force_unzip else False
Expand Down
8 changes: 8 additions & 0 deletions landsat/tests/test_landsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ def test_download_process_continuous(self, mock_downloader, mock_process):
mock_process.assert_called_with('path/to/folder/LC80010092014051LGN00', '432', False, False, True)
self.assertEquals(output, ["Image Processing Completed", 0])

# Call with pansharpen
args = ['download', 'LC80010092015051LGN00', 'LC80010092014051LGN00', '-b', '432', '-d',
self.mock_path, '-p', '--pansharpen']
output = landsat.main(self.parser.parse_args(args))
mock_downloader.assert_called_with(['LC80010092015051LGN00', 'LC80010092014051LGN00'], ['4', '3', '2', 8])
mock_process.assert_called_with('path/to/folder/LC80010092014051LGN00', '432', False, True, False)
self.assertEquals(output, ["Image Processing Completed", 0])

@mock.patch('landsat.landsat.Uploader')
@mock.patch('landsat.landsat.process_image')
@mock.patch('landsat.landsat.Downloader.download')
Expand Down

0 comments on commit 2ed9e48

Please sign in to comment.