[yt-users] Rendering non-cubical volumes
Nathan Goldbaum
nathan12343 at gmail.com
Tue Jun 4 12:10:32 PDT 2013
Hi Chris,
You can set the aspect ratio of your volume via the bbox keyword for
load_uniform_grid. See the example in load_uniform_grid's docstrings:
bbox : array_like (xdim:zdim, LE:RE), optional
Size of computational domain in units sim_unit_to_cm
>>> arr = np.random.random((128, 128, 129))
>>> data = dict(Density = arr)
>>> bbox = np.array([[0., 1.0], [-1.5, 1.5], [1.0, 2.5]])
>>> pf = load_uniform_grid(data, arr.shape, 3.08e24, bbox=bbox, nprocs=12)
I'm not sure whether the volume renderer will use non-cubic voxels, but
this should be an easy thing to modify and double check on your end.
Cheers,
Nathan
On Tue, Jun 4, 2013 at 11:59 AM, Chris Beaumont <cnb4ster at gmail.com> wrote:
> Hi,
>
> I'm new to yt and this list, so I apologize if this question has been
> answered before.
>
> I'm trying to render a non-cubical volume (observational data: see an
> early attempt at https://vimeo.com/67421373). If I supply a scalar
> "resolution" to Camera.__init__, the output is a square, even though the
> input data is ~2x wider than it is tall. If I supply a tuple of values, I
> can manually stretch the image but, as you can tell from the movie, I want
> to spin around the volume. I don't think that messing with resolution will
> help me in this case, since the projected aspect ratio of the plot changes
> at each rotation step.
>
> I did find an old thread similar to this (
> http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2012-July/002793.html),
> but the recipe there seem specific to axis-aligned slices, and not generic
> rotations.
>
> Is there a natural way to force yt to render pixels with the "right"
> aspect ratio?
>
>
> Thanks,
> Chris
>
>
> --
> ************************************
> Chris Beaumont
> Graduate Student
> Institute for Astronomy
> University of Hawaii at Manoa
> 2680 Woodlawn Drive
> Honolulu, HI 96822
> www.ifa.hawaii.edu/~beaumont
> ************************************
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130604/2a85e7a6/attachment.html>
More information about the yt-users
mailing list