From 5a778dd4f151c4e8c73f0f83e0298dc91d222593 Mon Sep 17 00:00:00 2001 From: Jonas Solvsteen Date: Wed, 28 Jun 2017 11:38:08 +0200 Subject: [PATCH 1/2] Use Landsat Collection 1 dataset --- landsat/downloader.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/landsat/downloader.py b/landsat/downloader.py index c10f8cc..94c20c8 100644 --- a/landsat/downloader.py +++ b/landsat/downloader.py @@ -96,12 +96,14 @@ def usgs_eros(self, scene, path): error_text = error_tree.find("SOAP-ENV:Body/SOAP-ENV:Fault/faultstring", api.NAMESPACES).text raise USGSInventoryAccessMissing(error_text) - download_url = api.download('LANDSAT_8', 'EE', [scene], api_key=api_key) - if download_url: - self.output('Source: USGS EarthExplorer', normal=True, arrow=True) - return self.fetch(download_url[0], path) + response = api.download('LANDSAT_8_C1', 'EE', [scene], api_key=api_key) + try: + download_url = response['data'][0] + except IndexError: + raise RemoteFileDoesntExist('%s is not available on AWS S3, Google or USGS Earth Explorer' % scene) + self.output('Source: USGS EarthExplorer', normal=True, arrow=True) + return self.fetch(download_url, path) - raise RemoteFileDoesntExist('%s is not available on AWS S3, Google or USGS Earth Explorer' % scene) raise RemoteFileDoesntExist('%s is not available on AWS S3 or Google Storage' % scene) def google_storage(self, scene, path): From 85d6a933edab68973b5b439d98855433687e7102 Mon Sep 17 00:00:00 2001 From: Jonas Solvsteen Date: Wed, 28 Jun 2017 11:42:55 +0200 Subject: [PATCH 2/2] update USGS to >=0.2.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7a40899..d3b906b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -usgs==0.1.9 +usgs>=0.2.0 requests==2.7.0 python-dateutil==2.5.1 numpy==1.10.4