[SciPy-User] Bivariate Spline Surface Fitting

Peter Combs peter.combs@berkeley....
Fri Nov 27 04:42:51 CST 2009

On Nov 26, 2009, at 4:30 PM, David Baddeley wrote:

> Hi Peter,
> would that be localization microscopy data by any chance? Which method are you using? 

Indeed it is!  The lab I'm working in does a lot of FIONA (Fluorescence Imaging with One Nanometer Accuracy), although the data I'm using is a couple steps removed from the usual assays that are done. 

On Nov 26, 2009, at 8:03 PM, josef.pktd@gmail.com wrote:
> knots should only specify the point of x and y not all grid points, I
> added an s to play with the border values following the example in the
> tests. most of it just trial and error, since I don't have a good
> example of what I should get as a result

Thanks, that pretty much did it, I think.  I'm still playing with the number of knots to see what gives reasonable results.  Taking it up to 75 brings my error down to under 4 nm, which is starting to get to the limit of what we could do in one channel anyways.  

> with the following knots, it finishes without warning and errors, and
> I get some numbers back that might be reasonable.

Now I'm getting this warning, but given that the results are very usable, I'm not too worried: 
The coefficients of the spline returned have been computed as the
minimal norm least-squares solution of a (numerically) rank deficient
system (deficiency=92). If deficiency is large, the results may be
inaccurate. Deficiency may strongly depend on the value of eps.

I think it's saying that there are some grid squares that don't have enough points to calculate a fit, is that right?  I'm pretty sure these are at the edge of the mesh, and shouldn't be a big problem.

>  s = 1.1
>  yknots = np.linspace(ymin+s,ymax-s,10)
>  xknots = np.linspace(xmin+s,xmax-s,10)
> Some good examples for the use of the different options in the spline
> classes would be nice.

Yeah.  I think once I get things mostly figured out I'll try and condense what I have into an example or two.  My problem is that I still don't *really* understand the difference between all these different kinds of splines, so I'll probably want someone to make sure I'm not going totally off the deep end.

Peter Combs

More information about the SciPy-User mailing list