[Yt-svn] yt-commit r1707 - trunk/yt/raven

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Thu Apr 29 08:15:48 PDT 2010


Author: mturk
Date: Thu Apr 29 08:15:47 2010
New Revision: 1707
URL: http://yt.enzotools.org/changeset/1707

Log:
Fixing a very, very stupid mistake on my part.  I had previously "optimized"
the antialiasing calculations by checking if the overlap values were < 0.0.
However, because I moved the multiplication of the data value into the
calculation of one of the overlap values, this resulted in discarding all
points where the data value was negative.  This is now fixed.  Thanks to
Jean-Claude Passy for picking this up.



Modified:
   trunk/yt/raven/_MPL.c

Modified: trunk/yt/raven/_MPL.c
==============================================================================
--- trunk/yt/raven/_MPL.c	(original)
+++ trunk/yt/raven/_MPL.c	Thu Apr 29 08:15:47 2010
@@ -170,14 +170,15 @@
         for (i=lr;i<rr;i++) {
           lypx = px_dy * i + y_min;
           rypx = px_dy * (i+1) + y_min;
-          overlap2 = dsp*((min(rypx, ysp+dysp) - max(lypx, (ysp-dysp)))*ipx_dy);
+          overlap2 = ((min(rypx, ysp+dysp) - max(lypx, (ysp-dysp)))*ipx_dy);
           for (j=lc;j<rc;j++) {
             lxpx = px_dx * j + x_min;
             rxpx = px_dx * (j+1) + x_min;
             overlap1 = ((min(rxpx, xsp+dxsp) - max(lxpx, (xsp-dxsp)))*ipx_dx);
             if (overlap1 < 0.0 || overlap2 < 0.0) continue;
             if (antialias == 1)
-              *(npy_float64*) PyArray_GETPTR2(my_array, j, i) += overlap1*overlap2;
+              *(npy_float64*) PyArray_GETPTR2(my_array, j, i) +=
+                    (dsp*overlap1)*overlap2);
             else *(npy_float64*) PyArray_GETPTR2(my_array, j, i) = dsp;
           }
         }



More information about the yt-svn mailing list