[yt-users] Data over y-axis of x position

Matthew Turk matthewturk at gmail.com
Sun Mar 28 19:36:50 PDT 2010


Hi Nicholas,

You might give a go at using the orthogonal ray object.  This accepts
an axis along which it is shot and a coordinate in the other two axes
at which it's placed before being shot.  The interface would be
something like:

pf = load(...)

# y-axis is 1 ...
ray = pf.h.ortho_ray(1, (0.5, 0.5))

The "ray" object can then access data fields, like Density and
Temperature, which can also be plotted:

import pylab
pylab.plot(ray["y"], ray["Density"])
pylab.savefig("%s_y_rho.png" % pf)

The tuple above, (0.5, 0.5), is specifying the coordinates along the
other two axes.  The mechanism for coordinating these with "x" "y" and
"z" is a bit backwards -- you can see which axis corresponds to which
by looking at lagos.x_dict and lagos.y_dict: lagos.x_dict[1] says
which axis corresponds to the first value above and lagos.y_dict[1]
says which is the second value, so you can be sure what the x and z
coordinates are.

If that doesn't work, or you have any more trouble, let us know!

-Matt

On Sun, Mar 28, 2010 at 7:28 PM, Nicholas Earl <earlnich at msu.edu> wrote:
> Hey YT community,
>
> I was wondering if anyone had any sort of starting notion for a problem that
> I face. I've done slices of a wave progressing in the x-y plane (the wave
> front moves in the x-direction, from x = 0), what I want to do is take the
> data from one specific x-value (i.e. a strip running the bounds of y at some
> position x). I wanted to be able to plot the data -- for instance, density
> -- (ideally, for my situation, it should be some sort of sinusoidal plot)
> with density as the y axis and y position as the x-axis.
>
> Is there anyway I could form this using YT?
>
> Thanks for all your time and effort!
> Nicholas Earl
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>



More information about the yt-users mailing list