This all sounds exciting, and I'm definitely making headway in terms of progress on the screen, but I keep getting hung up at a ValueError: shape mismatch: objects cannot be broadcast to a single shape after this line:

    vcd = grid.get_vertex_centered_data(field).astype('float64')
  File "/Users/earln/yt-i386/src/yt-trunk-svn/yt/lagos/", line 445, in get_vertex_centered_data
    na.add(new_field, cf[1: ,1: ,1: ], new_field)

Not quite sure wherein this would lie. Any possible ideas?


On Tue, Mar 30, 2010 at 2:20 PM, Matthew Turk <> wrote:
Hi Nicholas,

Yup, the cookbook applies to 1.6, but we've changed things a bit in
the trunk so as to enable parallel volume rendering -- and to make
some things nicer.  For instance, you can now sample colormaps,
automatically add layers, etc etc.  We're also just about ready to
roll out multivariate volume rendering, including planck functions and

Anyway, I'm sorry that it's not working right now for you!  To use the
script, we just need to get rid of direct_ray_cast, which we can
replace with:

vp = pf.h.volume_rendering(L, W, c, Nvec, tf)

At this point, we can get the image as vp.image:

to_plot = na.clip(vp.image, vp.image.min(), 0.8 * vp.image.max())
to_plot = (to_plot - to_plot.min()) / (to_plot.max() - to_plot.min())

(we still have to normalize, unfortunately -- we're working on that
for the future.)

And we now also provide a saving function:

vr.plot_rgb(to_plot, "%s" % pf)

I've uploaded a new version of the cookbook recipe here:

which you can download with " --download=404".  One thing
you might consider is that sometimes it's easier to just
"add_layers(N)" on the transfer function, optionally supplying the
name of a colormap (defaults to gist_stern) so that yt will add onion
layers to your image at even intervals.  I've uploaded an example of
that here:

Anyway, sorry for the trouble, but I hope that the annoyance is worth
the new advantages!


On Tue, Mar 30, 2010 at 11:07 AM, Nicholas M. Earl <> wrote:
> Hey again YT community,
> I was hoping to get some heading on using the simple volume rending script
> that is written up in the YT cookbook, but it seems that direct_ray_casting
> isn't a part of yt extensions anymore? Is there something to substitute
> this? I see that in the software sample script, there is a referencing of
> VolumeRendering, can I use this?
> Thanks for your time and effort!
> Nicholas Earl
> _______________________________________________
> yt-users mailing list
yt-users mailing list