[yt-users] questions on projection

Semyeong Oh semyeongoh at gmail.com
Mon Aug 19 21:22:03 PDT 2013


Hi all,

I'm new to yt. I have questions about making projections of certain region,
and inspecting the data returned.

I made a cube as follows:

import pylab as pl

center = [0.5, 0.5, 0.5]
halfwidth = 0.005
cube = pf.h.region(center, center-pl.ones(3)*halfwidth,
center+pl.ones(3)*halfwidth, ['Density'])

print min(cube['x']), max(cube['x'])
0.494873046875 0.505126953125

When I print cube['x'].shape, I get (10728,).
I tried to make a projection of this cube along z-axis as follows:

proj2 = pf.h.proj(2, 'Density', center=center, source=cube)

But I could not understand what is returned.

print min(proj2['p
x']), max(proj2['py']), proj2['px'].shape
0.00390625 0.99609375 (19648,)

print proj2['Density']
[ 0.  0.  0. ...,  0.  0.  0.]

My questions are:
1. What exactly is returned in proj2? Why does it span from 0. to 1. when I
specified source=cube?

2. I also tried 'data_source=cube' instead of 'source=cube'. It did not
raise any error, and returned
something different: array of same shape, but with different data values.
Is this keyword also used
for projection object? Is there a consistent difference between the two
keywords in yt?

3. I could not find documentation on some fields like 'px', 'py' that seem
to be generated for certain data containers
(e.g., 't' for ray objects). Is there an exhaustive list of such fields in
the documentation?

Thanks in advance.

Semyeong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130820/59a9cf1d/attachment.htm>


More information about the yt-users mailing list