|
From: <pl...@pi...> - 2007-08-01 18:37:40
|
On Tue, 31 Jul 2007 23:28:01 +0200, Paul <ps...@dr...> wrote: >> This will almost certainly need to be done outside gnuplot by >> preprocessing the data. Catmull-Romm spline would probably be a good >> choice to interpolate your example contour at 175mm > > Hello, > > Do you know of a good software application in linux which will do th= is > preprocessing? > > Sorry I dont recall your data. If it's regular in x,y intervals you coul= d = possibly try presenting it as a bitmap to gimp. I've toyed with this idea a couple of times but never done it. Your z coordinate would be the "colour" as a greyscale. You could then = scale up the image using "cubic" which uses catmull-rom algorithm. This = = would effectively interpolate without affecting your existing points as = = long as you use and integer multiple of the number of points. One word of warning, the splines tend to over shoot if the data has shar= p = changes in direction within the range of it's four anchors. Like any = interpolation, it is fiction. You need to insure that the results make = sense. If you cannot do it with gimp you could probably process your data using= = awk . The spline fit is very simple and fast to execute /* Catmull-Rom spline - not bad * basic intro http://www.mvps.org/directx/articles/catmull/ * This formula will calculate an interpolated point between pt1 and p= t2 * dx=3D0 returns pt1; dx=3D1 returns pt2 */ static inline gdouble cubic_spline_fit (gdouble dx, gint pt0, gint pt1, gint pt2, gint pt3) { return (gdouble) ((( ( - pt0 + 3 * pt1 - 3 * pt2 + pt3 ) * dx + ( 2 * pt0 - 5 * pt1 + 4 * pt2 - pt3 ) ) * dx + ( - pt0 + pt2 ) ) * dx + (pt1 + pt1) ) / 2.0; } This is cut from the Gimp GPL source code in /app/paint-funcs/scale-func= s.c Please let me know how you get on . I'm curious to know if the technique= = works. ;) > > > > ----------------------------------------------------------------------= --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser= . > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |