Skip to content

Commit

Permalink
#40 and #24: I discovered that a valid uri to an opendap stream retur…
Browse files Browse the repository at this point in the history
…ned html 400 error although netCDF4.Dataset works fine. If request.status!=200, I therefore try to open with netCDF4.Dataset. If that works, no error is raised..
  • Loading branch information
mortenwh committed Jul 25, 2019
1 parent 6154d81 commit 86ae519
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion geospaas/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
''' Utility functions to perform common operations '''
import os
from netCDF4 import Dataset

try:
import urllib3 as urllibN
Expand Down Expand Up @@ -63,7 +64,8 @@ def validate_uri(uri):
else:
request = urllibN.PoolManager().request('GET', uri)
if not request.status==200:
raise ConnectionError(uri)
ds = Dataset(uri)
#raise ConnectionError(uri)

def nansat_filename(uri):
# Check if data should be read as stream or as file? Or just:
Expand Down

0 comments on commit 86ae519

Please sign in to comment.