Skip to content

Instantly share code, notes, and snippets.

View Tillsten's full-sized avatar

Till Stensitzki Tillsten

  • Universität Potsdam
  • Berlin, Germany
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Tillsten
Tillsten / advanced version.py
Last active August 29, 2015 14:07
most basic proof of concept for using cassowary with mpl.
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 30 14:20:54 2014
@author: tillsten
"""
import cassowary # can be installed via pip, pure python.
import matplotlib.pyplot as plt
import matplotlib.textpath
{
"metadata": {
"name": "SVD on data with a peak-shift"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@Tillsten
Tillsten / compartment_model.py
Last active December 12, 2015 08:39
Solving compartment models analytical and build a cython function from the solution.
# -*- coding: utf-8 -*-
"""
This modul build a kinetic matrix from given transtions between
compartments.
"""
import sympy, cython
import numpy as np
class Transition(object):
@Tillsten
Tillsten / stacked_steamgraph_mpl.py
Created November 9, 2012 19:54
Steamgraph in mpl
import numpy as np
import random as r
import matplotlib.pyplot as plt
def layers(n, m):
'function to generate some data'
def bump(a):
x = 1 / (.1 + r.random())
y = 2 * r.random() - .5
z = 10 / (.1+ r.random())
for i in range(m):
@Tillsten
Tillsten / exp_sum_pymc.py
Created October 29, 2012 02:56
Fit to an expontial sum in pymc
# Make test data
t=np.linspace(0,20,200)
decays = np.array([2.3,9])
x=np.linspace(-1,1, 32)
amp1 = 10*np.exp(-(x+0.5)**2/0.3)
amp2 = -8*np.exp(-(x-0.5)**2/0.4)
amps=np.column_stack((amp1,amp2))
d=amps.dot(np.exp(-t/decays[:,None]))
#Add Noise