From: Curtis C. <cu...@hi...> - 2004-10-01 03:29:35
|
> We are trying to adapt the C contour program that is used by gist > (and can be found in the contour routine used by xplt in scipy). > It would be best to look at the source for the precise description > of the algorithm it uses (note though that gist apparently uses > two different pieces of contour code for its contour tasks. The > one we are looking to adapt, mainly because it appears much easier > to isolate from the gist environment is the gcntr.c version). > I would be amazed if one could find a pure Python algorithm to do > contouring that was fast enough. Our current plan is to use these > C routines to generate the contour segments, and do the plotting > from within Python (as well as any contour labeling). > > If you have expertise in this area you may be able to do it better > and faster than we can. Currently it is being worked on part time > so we aren't able to do it as fast as we would like. I'm hoping that we > will have at least a basic version (e.g., no labeling) in a couple > weeks. > > If you want me to send or point you to the source code we are > using as the basis, let me know. Hi again, Yes, I had the thought that using C for the algorithm would be easier as well. There are actually some very well-written marching squares contouring algorithms in C already out there. I will try to find such an implementation and point you to it or send you the source code. The second half is just the drawing, which should be implemented in matplotlib using the line collections class. Since vector plotting is not that hard, I will try to get that working first. Then, someone can take my source code and adapt it easily to the contouring problem, once an effective and sufficiently high-performance algorithm implementation can be found. Cheers, Curtis |