Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landsat 8 and 5 download raises exception #4

Closed
MWieland opened this issue Nov 11, 2020 · 7 comments
Closed

Landsat 8 and 5 download raises exception #4

MWieland opened this issue Nov 11, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@MWieland
Copy link

When downloading Landsat 8 data using the script below the following exception is raised:

['B1.TIF', 'B2.TIF', 'B3.TIF', 'B4.TIF', 'B5.TIF', 'B6.TIF', 'B7.TIF', 'B8.TIF', 'B9.TIF', 'B10.TIF', 'B11.TIF', 'BQA.TIF', 'MTL.txt', 'ANG.txt', 'README.GTF']
Traceback (most recent call last):
  File "test.py", line 11, in <module>
    product.download(out_dir=target_dir, progressbar=True)
  File "/users/wiel_mc/Source/miniconda3/envs/proc_s2_flood/lib/python3.6/site-packages/pylandsat/download.py", line 69, in download
    download_file(url, dst_dir, progressbar=progressbar, verify=True)
  File "/users/wiel_mc/Source/miniconda3/envs/proc_s2_flood/lib/python3.6/site-packages/pylandsat/utils.py", line 79, in download_file
    raise requests.exceptions.HTTPError(str(r.status_code))
requests.exceptions.HTTPError: 404

It seems that the file "README.GTF" is missing and therefore the exception is raised. All other files are downloaded correctly. This problem is present for all Landsat 8 images (at least the ones I tried) and can also be reported for Landsat 5. Landsat 7 seems to download without exceptions. In all cases it seems that there is a mismatch between what product.available returns and what actually is available for download.

from pylandsat import Product

product_srcid = "LC08_L1TP_193027_20200712_20200722_01_T1"
target_dir = "/download"

product = Product(product_srcid)
print(product.available)
product.download(out_dir=target_dir, progressbar=True)

pylandsat 0.4, python 3.6, ubuntu 18.4

@yannforget
Copy link
Owner

Is it still an issue? I could not reproduce this error.

@MWieland
Copy link
Author

MWieland commented Mar 4, 2021

Thanks for looking into this. I just tried it again with a clean conda environment and pip install pylandsat on another machine. Running above example produces the same issue again. Anything I may miss regarding the setup?

pylandsat 0.5, python 3.7, ubuntu 20.4

@jha-vineet69
Copy link
Contributor

I got the same error while downloading Landsat-8 data in Google Colab with pylandsat-0.5.
!pylandsat download 'LC08_L1TP_089078_20191106_20191115_01_T1'
Here's the output in case you couldn't reproduce the error.
Pylandsat_issue
All the other files were downloaded correctly though.

@yannforget yannforget added the bug Something isn't working label Mar 9, 2021
@jha-vineet69
Copy link
Contributor

The error is that there is no README.GTF file for Landsat-8 data. This can be confirmed by browsing the directories in this AWS Bucket: Landsat-8 Data on AWS or GCP Bucket: Landsat-8 Data on GCP. Hope this helps in fixing the bug.

@yannforget
Copy link
Owner

Thanks! This helps

@yannforget
Copy link
Owner

Should be solved in v0.6.0. Thanks @jha-vineet69 👍

@MWieland
Copy link
Author

Just tested it with v0.6.0 - works like a charm. Many thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants