
Hi, all-- I have a dumb projection question. Why is it that when I do a projection, the minimum pdx is smaller than the minimum cell width in my simulation?
pf.h.get_smallest_dx() 0.0001220703125 1./pf.h.get_smallest_dx() 8192.0
Additionally, the sum of the areas is not what I expect. I expect
proj=pf.h.proj(0,'Density') (proj['pdx']*proj['pdy']).sum() 0.25
I get 0.25, instead of 1 (consistent with the above, if all the widths are down by a factor of 2.) I assumed that proj['pdx'] is the width of the zone of the projection, which I naievely expect to be the smallest cell width along any line of sight. Could one of you good people fill in what I'm misunderstanding? Thanks a ton! d.

On Fri, Apr 12, 2013 at 6:13 PM, david collins <dcollins4096@gmail.com> wrote:
Hi, all--
I have a dumb projection question.
Why is it that when I do a projection, the minimum pdx is smaller than the minimum cell width in my simulation?
pf.h.get_smallest_dx() 0.0001220703125 1./pf.h.get_smallest_dx() 8192.0
Additionally, the sum of the areas is not what I expect. I expect
proj=pf.h.proj(0,'Density') (proj['pdx']*proj['pdy']).sum() 0.25
I get 0.25, instead of 1 (consistent with the above, if all the widths are down by a factor of 2.)
I assumed that proj['pdx'] is the width of the zone of the projection, which I naievely expect to be the smallest cell width along any line of sight.
Could one of you good people fill in what I'm misunderstanding?
Sure! pdx is halfwidth, and the px values are cell centers. I think this is somewhere in the method paper, but there's no clear place to stick it in the documentation. -Matt
Thanks a ton! d.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Ah, right on. Thanks! d. On Fri, Apr 12, 2013 at 4:17 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi, all--
I have a dumb projection question.
Why is it that when I do a projection, the minimum pdx is smaller than
On Fri, Apr 12, 2013 at 6:13 PM, david collins <dcollins4096@gmail.com> wrote: the
minimum cell width in my simulation?
pf.h.get_smallest_dx() 0.0001220703125 1./pf.h.get_smallest_dx() 8192.0
Additionally, the sum of the areas is not what I expect. I expect
proj=pf.h.proj(0,'Density') (proj['pdx']*proj['pdy']).sum() 0.25
I get 0.25, instead of 1 (consistent with the above, if all the widths are down by a factor of 2.)
I assumed that proj['pdx'] is the width of the zone of the projection, which I naievely expect to be the smallest cell width along any line of sight.
Could one of you good people fill in what I'm misunderstanding?
Sure! pdx is halfwidth, and the px values are cell centers. I think this is somewhere in the method paper, but there's no clear place to stick it in the documentation.
-Matt
Thanks a ton! d.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

No prob. As a bit of an explanation, this is somewhat historical but also has a good reason. When the first plotting engine was used in yt (HippoDraw) it accepted dx's that were *half* widths, and cell-centered positions. This was so it could avoid the floating point operations during the iteration over the cells to deposit. When I implemented the pixelizer that underlies the FixedResolutionBuffer (and, actually, has largely remained unchanged since its first creation to output to matplotlib) I kept this convention, as I worried about the data source having a large array, which I did not want to duplicate, and I also worried about the floating point operations. I did some tests not that long ago, and it turns out that in worst case scenario, you can get considerable impact from doign the fp operations inside the pixelizer. So I guess it's a good decision to keep, for now. On Fri, Apr 12, 2013 at 6:32 PM, David Collins <dcollins4096@gmail.com> wrote:
Ah, right on. Thanks!
d.
On Fri, Apr 12, 2013 at 4:17 PM, Matthew Turk <matthewturk@gmail.com> wrote:
On Fri, Apr 12, 2013 at 6:13 PM, david collins <dcollins4096@gmail.com> wrote:
Hi, all--
I have a dumb projection question.
Why is it that when I do a projection, the minimum pdx is smaller than the minimum cell width in my simulation?
pf.h.get_smallest_dx() 0.0001220703125 1./pf.h.get_smallest_dx() 8192.0
Additionally, the sum of the areas is not what I expect. I expect
proj=pf.h.proj(0,'Density') (proj['pdx']*proj['pdy']).sum() 0.25
I get 0.25, instead of 1 (consistent with the above, if all the widths are down by a factor of 2.)
I assumed that proj['pdx'] is the width of the zone of the projection, which I naievely expect to be the smallest cell width along any line of sight.
Could one of you good people fill in what I'm misunderstanding?
Sure! pdx is halfwidth, and the px values are cell centers. I think this is somewhere in the method paper, but there's no clear place to stick it in the documentation.
-Matt
Thanks a ton! d.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (3)
-
david collins
-
David Collins
-
Matthew Turk