This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yes? USE "http://example.com/dap/u/token/id ! use your URL here | |
yes? show data | |
currently SET data sets: | |
1> http://localhost:8081/sandy (default) | |
name title I J K L M N | |
OCEAN_TEMPERATURE | |
Seawater temperature 1:15104 1:7936 ... 1:4 ... ... | |
INSITU.STID | |
1:590 ... ... ... ... ... | |
INSITU.LAT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "Untitled0" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydap.handlers.lib import get_handler | |
from django_wsgi import django_view | |
filepath = XXX # get this from the model somehow | |
handler = get_handler(filepath) # this is a WSGI app | |
view = django_view(handler) | |
return view(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydap.handlers.lib import get_handler | |
from django_wsgi import django_view | |
filepath = XXX # get this from the model somehow | |
handler = get_handler(filepath) # this is a WSGI app | |
view = django_view(handler) | |
return view(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydap.parsers.dds import DDSParser | |
from pydap.parsers.das import DASParser | |
from pydap.xdr import DapUnpacker | |
f = open("/path/to/file.dods") | |
content = f.read() | |
dds, xdrdata = content.split('\nData:\n', 1) | |
# build the dataset | |
dataset = DDSParser(dds).parse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
words = { word.strip(): None for word in open('/usr/share/dict/words') } | |
four = [word for word in words.keys() if len(word) == 4] | |
for left in four: | |
for right in four: | |
combined = ''.join([ left[j] + right[j] for j in range(4) ]) | |
for word in words: | |
if not combined.startswith(word): | |
continue | |
rest = combined[len(word):] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class RemoteFile(object): | |
def __init__(self, url): | |
self.url = url | |
self.position = 0 | |
def tell(self): | |
return self.position | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import urllib | |
from ftplib import FTP | |
import socket | |
from pupynere import netcdf_file | |
class FTPFile(object): | |
def __init__(self, url, buffer=4096): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# By Sirupsen @ http://sirupsen.dk | |
# | |
# Description: Very simple script to make you | |
# select a region of your screen, which will be captured, and | |
# then uploaded. The URL will then be injected into your clipboard. | |
# | |
# Dependencies: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydap.model import * | |
from pydap.handlers.lib import IterData, BaseHandler | |
class SensorData(IterData): | |
""" | |
Sensor data as a structured array like object. | |
""" | |
def gen(self): |
OlderNewer