Skip to content

Instantly share code, notes, and snippets.

View chryss's full-sized avatar

Chris Waigl chryss

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
#!/usr/bin/env bash
#
# clip_usgs_to_shape.sh
# Clip individual band files from USGS-distributed remote-senisng images
# to extent of polygon provided in a shapefile, using the GDAL command line
# tools.
#
# Chris Waigl, 2014-04-15
#
# Input:
#!/usr/bin/env python
# encoding: utf-8
"""
evaluatehfdi_debug.py
Debugging scikit-learn Gaussian Mixture Model parameter choice.
Created by Chris Waigl on 2014-05-13.
Copyright (c) 2014 Christine F. Waigl. MIT License.
"""
import argparse
def dosomething(someinput):
pass
def main():
parser = argparse.ArgumentParser()
parser.add_argument("infilepath")
args = parser.parse_args()
import argparse
import collections
# Let's define a global dispatch table for the 8 different possible neighbors
# clockwise starting top-left: tl, t, tr, r, br, b, bl, l.
# The target index only depends on the number of rows and the start index jj
# As we won't know beforehand which functions to use for a given start index,
# we make them all dependent on both jj and n
neighbordispatch = {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
### 42 OPEN FILES:
[u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/gshhs_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/gshhs_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/riversmeta_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/gshhs_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/countriesmeta_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/riversmeta_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/gshhsmeta_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/gshhs_l.dat',
u'/Users/chris/.virtualenvs/science27/lib/python2.7/site-packages/mpl_toolkits/basemap/data/rivers_l.dat',
>>> MWtoIPA = {
u' ': u' ',
u"'": u"'",
u"'\u0259": u"'\u028c",
u',': u',',
u',\u0259': u',\u028c',
u'-': u'.',
u'\\': u'/',
u'/': u'/',
u'(': u'(',
# HTML numbered entity (hex) to unicode string
>>> entity = '&#x01ce'
>>> unichr(int(entity[3:],16))
u'\u01ce'