[SciPy-User] newbie help: splprep to get spline interpolation of 2d signal : ValueError from code but not in command line example
Fri Sep 30 15:08:41 CDT 2011
Thanks Pauli for your email. Repeated experimentation made me gloss over
the two different functions ..splrep for spline-represent is what I needed
to use as you pointed out.
I could get my spline interpolation to work just great with splrep once I
used only every 10th point or so since the data had a high frequency
component which was not usefull to the analysis. I handled the spline
calculation by using only every 10th point.
Thanks for your help
My code that worked
xvals = 
yvals = 
for vals in mega_data_dict[well_id]:
window = int(window)
xcalc = linspace(min(xvals),max(xvals),len(xvals))
ycalc = interpolate.splev(xcalc,tck)
my_derivative = interpolate.splev(xcalc,tck,der=3)
# print xcalc(xs.index(max(my_derivative)))
ax = host_subplot(111,axes_class=AA.Axes)
par1 = ax.twinx()
par2 = ax.twinx()
offset = 60
new_fixed_axis = par2.get_grid_helper().new_fixed_axis
On Thu, Sep 29, 2011 at 5:34 PM, Pauli Virtanen <firstname.lastname@example.org> wrote:
> On 29.09.2011 23:24, hari jayaram wrote:
> > x = linspace(20,81,2339)
> > y = sin(x)
> > tck = interpolate.splrep(x, y)
> > tck = interpolate.splprep(x=ys)
> Note that there are two functions: `splrep` and `splprep`, and they do
> somewhat different things (read the docs for each to find out more).
> You probably intendeded to write `splrep(xs, ys)` in the latter case.
> Pauli Virtanen
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User