From: Alan W. I. <ir...@be...> - 2002-05-09 02:45:32
|
This is mostly addressed to Geoffrey since the coordinate wrapping code is due to his efforts I believe. I would appreciate his comments in case I have misinterpreted something. I believe the code that wraps angular (or other coordinate) values for plcont, plshade, etc. in plmodules.c, tclAPI.c, and javabind.c has a nasty bug that I am currently trying to fix. Let's take the python definition of plshade in plmodules.c as an example. The problem is the wrap code extends xg2 and yg2 appropriately and makes the corresponding changes to cgrid2, but no corresponding change is made to grid (which carries the z information). Thus, the current implementation of the python wrap code has inconsistent z, xg2, and yg2 values, and the same is true of the plcont code. From my quick check I believe exactly the same problems occur for tcl as implemented in tclAPI.c. I believe the reason why this problem has not been seen before is the current x09.tcl, x16.tcl, and xw09.py, xw16.py, and x09.java (x16.java is not written yet) don't actually test coordinate wrapping that well. The problem is that the example theta values range from 0 to 2 pi, the last point is already essentially equal to the first point, and the wrapping has already occurred before you ask for additional wrapping that is implemented (incorrectly I believe) in the plmodules.c, tclAPI.c, and javabind.c front ends. For my local copy of xw16.py I reduced the maximum index by one so that the last t (the theta coordinate) value was 2 pi - delta t. Setting wrap = 2 should fill in the equivalent of t=0 (or 2 pi) for the last value. However, the result did not look good, and certainly was not equivalent to the C front end result which uses the full t range from 0 to 2 pi without any additional wrapping. I also tried wrap = 1 (just in case I misinterpreted the order of the x and y coordinates) and that produced a segfault. Further investigation showed the problem in plmodules.c, tclAPI.c, and javabind.c that I have discussed. Alan email: ir...@be... phone: 250-727-2902 FAX: 250-721-7715 snail-mail: Dr. Alan W. Irwin Department of Physics and Astronomy, University of Victoria, P.O. Box 3055, Victoria, British Columbia, Canada, V8W 3P6 __________________________ Linux-powered astrophysics __________________________ |