<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">I actually found the code from P.Thevenaz is better than Scipy. T<SPAN style="RIGHT: auto">here is published information about its implementation and performance. It's explained how to use it for images, and finally P.Thevenaz answers to technical questions by email. The implementation is very nice, mirror conditions and </SPAN></SPAN><SPAN style="RIGHT: auto">Bsplines with order 2 to 9</SPAN><SPAN style="RIGHT: auto">. It should also be faster because all in pure C. </SPAN><SPAN style="RIGHT: auto">I like Scipy and I am using several Scipy modules for my library (ndimage, fftpack) but Bspline has a central role so I am concerned about it. </SPAN><SPAN style="RIGHT: auto">Using ctypes is a very strong advantage of Python; I also re-coded the median calculation in C and
gained several orders of magnitude wrt computation time.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN><SPAN style="RIGHT: auto"><VAR id=yui-ie-cursor></VAR>Jerome</SPAN></div>
<div style="RIGHT: auto"> </div>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="RIGHT: auto" dir=ltr><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr contentEditable=false readonly="true"></DIV><B><SPAN style="FONT-WEIGHT: bold">De :</SPAN></B> Erik Bray <embray@stsci.edu><BR><B><SPAN style="FONT-WEIGHT: bold">À :</SPAN></B> astropy@scipy.org <BR><B><SPAN style="FONT-WEIGHT: bold">Envoyé le :</SPAN></B> Jeudi 16 février 2012 21h34<BR><B><SPAN style="FONT-WEIGHT: bold">Objet :</SPAN></B> Re: [AstroPy] Re : strange error with ctypes<BR></FONT></DIV><BR>On 02/16/2012 02:47 PM, Jerome Caron wrote:<BR>> Dear James,<BR>>>I believe it could cause an error if either the pointer Line has been<BR>>>changed, so you are trying to free the wrong memory, or something has<BR>>>inadvertently
overwritten the memory you're trying to free<BR>> Thanks for the suggestion ! You're right, this could be a possibility. I<BR>> checked carefully the code, but the only instructions with Line are<BR>> assignments and arithmetic operations with Line[i], i varying from 0 to<BR>> Width-1. There is not a single operation with the pointer itself. So I<BR>> don't see what could be wrong...<BR>> This piece of code in my dll is a third party library<BR>> (<A href="http://bigwww.epfl.ch/thevenaz/interpolation/" target=_blank>http://bigwww.epfl.ch/thevenaz/interpolation/</A>). The code is nicely<BR>> written, and it's clear than the author knows what he's doing.<BR>> I am a bit puzzled, I am sure if there was such error there would be an<BR>> exception thrown by the dll. But there's no exception: Python reports an<BR>> error in the dll, and the dll does not see any error. It looks like<BR>> Python and C++ do not understand each
other. Might this be something<BR>> wrong with my Python code, a bad usage of ctypes ??<BR>> Jerome<BR><BR>Forgive my asking, since I know this wasn't really your question. But is <BR>there some reason not to use SciPy's interpolation?<BR><BR>Erik<BR>_______________________________________________<BR>AstroPy mailing list<BR><A href="mailto:AstroPy@scipy.org" ymailto="mailto:AstroPy@scipy.org">AstroPy@scipy.org</A><BR><A href="http://mail.scipy.org/mailman/listinfo/astropy" target=_blank>http://mail.scipy.org/mailman/listinfo/astropy</A><BR><BR><BR></DIV></DIV></div></body></html>