Skip to content

Instantly share code, notes, and snippets.

View kgullikson88's full-sized avatar

Kevin Gullikson kgullikson88

View GitHub Profile
from __future__ import print_function
from bs4 import BeautifulSoup
from pymarkovchain import MarkovChain
import logging
import re
import sys
import os
import time
import numpy as np
@kgullikson88
kgullikson88 / error_interpolation.py
Last active August 29, 2015 14:25
Interpolation with error propagation
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline as spline
class ErrorPropagationSpline(object):
"""
Does a spline fit, but returns both the spline value and associated uncertainty.
"""
def __init__(self, x, y, yerr, N=1000, *args, **kwargs):
"""
See docstring for InterpolatedUnivariateSpline
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline
cimport numpy as np
cimport cython
from libc.math cimport sqrt
from astropy import constants, units
from scipy.signal import fftconvolve
import warnings
DTYPE = np.float64