Skip to content

Conversation

espdev
Copy link
Owner

@espdev espdev commented Dec 30, 2019

This function might be used in procedural code as useful shortcut for all supported data smoothing cases.

The example:

import numpy as np
from csaps import csaps

x = np.linspace(-5., 5., 25)
y = np.exp(-(x/2.5)**2) + (np.random.rand(25) - 0.2) * 0.3
xi = np.linspace(-5., 5., 150)

# Smooth data with smoothing factor 0.85, return smoothed values
yi = csaps(x, y, xi, smooth=0.85)

# Smooth data and compute smoothing factor automatically, return smoothed values and computed smoothing factor
yi, smooth = csaps(x, y, xi)

# Do not evaluate the spline, only compute it, return smoothing spline representation object
sp = csaps(x, y, smooth=0.98)

@espdev espdev merged commit a921056 into master Jan 1, 2020
@espdev espdev deleted the csaps-shortcut branch January 1, 2020 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant