Gabriel-Desharnais / Modis-python-suite

Python module to download modis data
MIT License
10 stars 6 forks source link

Unable to download from NSIDC #4

Closed timstevens1 closed 7 years ago

timstevens1 commented 7 years ago

I wrote this script to download snow data from the NSIDC:

import modisSuite

username = ""
password = ""
product = "MOD10A2.006"
tiles = ["h20v02"]
start_date = "2011-01-01"
d = 20
folder = "../test_data"

doo = modisSuite.downloader(product, username, password, date=start_date, delta=d, tuiles=tiles, output=folder)
for x, y in doo.telechargerTout():
    print(x, y)

I then recieved this error:

/usr/bin/python2.7 /home/tim/Documents/Research/arctic-browning/scripts/snow.py
Traceback (most recent call last):
  File "/home/tim/Documents/Research/arctic-browning/scripts/snow.py", line 11, in <module>
    doo = modisSuite.downloader(product, username, password, date=start_date, delta=d, tuiles=tiles, output=folder)
  File "build/bdist.linux-x86_64/egg/modisSuite/Downloader.py", line 41, in __init__
  File "build/bdist.linux-x86_64/egg/modisSuite/Downloader.py", line 139, in authentification
  File "build/bdist.linux-x86_64/egg/modisSuite/Downloader.py", line 138, in authentificationNSIDC
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 480, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 454, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 388, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 293, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 353, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '>\n<!--[if lt IE 7]><html class=': No schema supplied. Perhaps you meant http://>
<!--[if lt IE 7]><html class=?

Process finished with exit code 1

Has anyone experienced this issue before?

Gabriel-Desharnais commented 7 years ago

Hi, It can happen for different reasons

Try:

  1. Go to https://urs.earthdata.nasa.gov/ and create a count if not created and login
  2. In the section My applications approve the applications LP DAAC Data Pool and NSIDC_DATAPOOL_OPS
  3. Try again.

Tell me if it works.

I shall

timstevens1 commented 7 years ago

I approved the applications and the script worked. Thank you

Gabriel-Desharnais commented 7 years ago

If there is anything else I'll be glad to help you