Václav Šmilauer wrote:
about a year ago I developed for my own purposes a routine for averaging
irregularly-sampled data using gaussian average. I would like to
contribute it to matplotlib, after a clean-up, if there is interest.
This sounds like a nice thing to have, but I am wondering whether it should go into scipy instead of mpl. On the other hand, I do see the rationale for simply putting it in mpl so it can be used for contouring etc. without adding an external dependency.
First it stores all data points in a (regular) grid. One can ask for
value at arbitrary point within the grid range: based on stDev
parameter, all data points within some distance (user-settable) are
weighted using the normal distribution function and then the average is
returned. Storing data in grid avoids searching all data points every
time, only those within certain grid-range will be used.
It would be relatively easy to extend to another distribution types
(lines 120-130), such as elliptic-normal distribution, with different
stDev in each direction.
This sounds a lot like "optimal interpolation". Comments? Certainly, in many fields it is essential to be able to specify different std for x and y.
The code is here:
I should be able to convert it to accept numpy arrays, wrap using Python
API instead of boost::python and write some documentation. Let me know
if matplotlib-devel list would be more appropriate for this discussion.
matplotlib-users is fine for checking for interest; it may make sense to move more technical discussion to -devel. But I will ignore that for now.
Is wrapping with cython a reasonable option? I don't think we have any cython in mpl at present, but it seems to me like the way to go for many things, especially new things. It is readable, flexible, and promises to make the eventual transition to Python 3.1 painless for the components that use it. I realize it is C-oriented, not C++ oriented, but my understanding is that the wrapping of C++ is still reasonable in many cases. (I have not tried it.)
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now!
Matplotlib-users mailing list