Skip to content

Commit

Permalink
Upadtes to the notebook examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecampbell committed Dec 11, 2013
1 parent e05f49e commit 487cf27
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 171 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
*.swp
*.pyc
build/
.ipynb_checkpoints
.ipynb*
240 changes: 145 additions & 95 deletions notebooks/Glider 001 Example.ipynb

Large diffs are not rendered by default.

102 changes: 28 additions & 74 deletions notebooks/VEL3D.ipynb

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions ooitk/session.py
Expand Up @@ -91,10 +91,15 @@ def __init__(self, erddap_url):
self.cache = None
self.nc = None

def open(self):
def open(self, constraints=None):
tmpfile = os.path.join(gettempdir(), self.data_product_id)
chunk_size = 4096
r = requests.get(self.nc_url)
if constraints:
const_str = '&'.join(constraints)
url = self.nc_url + '&' + const_str
r = requests.get(url)
else:
r = requests.get(self.nc_url)
with open(tmpfile, 'wb') as f:
for chunk in r.iter_content(chunk_size):
f.write(chunk)
Expand Down

0 comments on commit 487cf27

Please sign in to comment.