Skip to content

Instantly share code, notes, and snippets.

@dfm
dfm / gist:e7fc8924c12e84de7b65
Created January 8, 2015 19:50
serving images
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import flask
import urllib
import numpy as np
from PIL import Image
# Unregularized.
MT = M.T
ivar = 1.0 / yerr ** 2
mat = np.dot(MT, M * ivar[:, None])
A = np.linalg.solve(mat, np.dot(MT, y * ivar))
# Regularized.
mat = np.dot(MT, M * ivar[:, None])
mat[np.diag_indicies_from(mat)] += reg ** 2
A = np.linalg.solve(mat, np.dot(MT, y * ivar))
# I'm still an ex-screen-user
set-option -g prefix C-a
unbind C-b
bind C-a send-prefix
# Relax!
set -sg escape-time 0
set -sg repeat-time 600
# Mouse
import os
import shlex
import pandas as pd
from subprocess import check_call, PIPE
fn = "epic.csv"
if not os.path.exists(fn):
url = ("http://exoplanetarchive.ipac.caltech.edu/cgi-bin/nstedAPI/"
"nph-nstedAPI?table=k2targets&select=*")
cmd = "wget -O {0} {1}".format(fn, url)
{
"metadata": {
"name": "",
"signature": "sha256:17a1bd88d191a1c3f6779897a9d7f9e95d4f0bfc0c3986bcc2a0116898a0a6ae"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"metadata": {
"name": "",
"signature": "sha256:0014d028e56c23b04f99fe26a4b668fbb44236cd1cf0d2a9b400d5f7fd45299c"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@dfm
dfm / code.ipynb
Created March 11, 2015 13:30
code from MPIA emcee tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfm
dfm / k2gp.ipynb
Created June 20, 2015 17:11
For Suzanne
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfm
dfm / kois.txt
Created August 1, 2015 21:18
KOIs
K05192.01
K05954.01
K01925.01
K05950.01
K03371.01
K03474.01
K00284.04
K04548.01
K03460.01
K02484.01