Skip to content

Instantly share code, notes, and snippets.

View thriveth's full-sized avatar

T. Emil Rivera-Thorsen thriveth

View GitHub Profile
@thriveth
thriveth / error_interpolation.py
Last active August 17, 2022 11:15 — forked from kgullikson88/error_interpolation.py
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