From: Norbert Nemec <Norbert.N<emec.list@gm...>  20060331 13:03:36

Nice work, Halldor! I've spent a bit of time on data interpolation recently, but this Stineman interpolation method beats everything I came up with in quality and simplicity. I took the freedom of going over your code and putting in all the experience I gathered before working with Python on data interpolation and related issues. See attached what I came up with. Compared with your version this is heavily modified: * The core change was to get rid of the explicit loop in the interpolation routine. The method now fully exploits the power of numpy. * The interface of the interpolation routine is changed. Intention was to move yp to the back and make it optional. If it is not given, the "slopes" routine is called automatically. * The "slopes" routine is changed in its core. Instead of a circular interpolation (which is problematic if the aspect ratio between the x and the yaxis is not known) it now uses a parabola interpolation to estimate the slope at inner points. For most curves where the original gave reasonable results, this new version should give something similar. It should, however, also cover many cases where the original "slopes" routine would have produced garbage. * The slopes at the endpoints are now also extrapolated in a much simpler manner. The intent of the original version was not clear to me, but it would definitely caused problems in several corner cases. If you could privately send my a scan of the original paper, I would be very grateful. I believe, it would be quite some gain for the matplotlib library to have this algorithm incorporated. As far as I can see, it should indeed be very robust for producing nice looking interpolations. One should, however, warn against its use in scientific context: Interpolation is always a way of making data look nicer than it actually was measured... Greetings, Norbert 