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:<br>
<br>    vcd = grid.get_vertex_centered_data(field).astype('float64')<br>  File "/Users/earln/yt-i386/src/yt-trunk-svn/yt/lagos/BaseGridType.py", line 445, in get_vertex_centered_data<br>    na.add(new_field, cf[1: ,1: ,1: ], new_field)<br>
<br>Not quite sure wherein this would lie. Any possible ideas?<br><br>Thanks!<br>Nick<br><br><div class="gmail_quote">On Tue, Mar 30, 2010 at 2:20 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Nicholas,<br>
<br>
Yup, the cookbook applies to 1.6, but we've changed things a bit in<br>
the trunk so as to enable parallel volume rendering -- and to make<br>
some things nicer.  For instance, you can now sample colormaps,<br>
automatically add layers, etc etc.  We're also just about ready to<br>
roll out multivariate volume rendering, including planck functions and<br>
scattering.<br>
<br>
Anyway, I'm sorry that it's not working right now for you!  To use the<br>
script, we just need to get rid of direct_ray_cast, which we can<br>
replace with:<br>
<br>
vp = pf.h.volume_rendering(L, W, c, Nvec, tf)<br>
vp.ray_cast()<br>
<br>
At this point, we can get the image as vp.image:<br>
<br>
to_plot = na.clip(vp.image, vp.image.min(), 0.8 * vp.image.max())<br>
to_plot = (to_plot - to_plot.min()) / (to_plot.max() - to_plot.min())<br>
<br>
(we still have to normalize, unfortunately -- we're working on that<br>
for the future.)<br>
<br>
And we now also provide a saving function:<br>
<br>
vr.plot_rgb(to_plot, "%s" % pf)<br>
<br>
I've uploaded a new version of the cookbook recipe here:<br>
<br>
<a href="http://paste.enzotools.org/show/404/" target="_blank">http://paste.enzotools.org/show/404/</a><br>
<br>
which you can download with "yt_lodgeit.py --download=404".  One thing<br>
you might consider is that sometimes it's easier to just<br>
"add_layers(N)" on the transfer function, optionally supplying the<br>
name of a colormap (defaults to gist_stern) so that yt will add onion<br>
layers to your image at even intervals.  I've uploaded an example of<br>
that here:<br>
<br>
<a href="http://paste.enzotools.org/show/405/" target="_blank">http://paste.enzotools.org/show/405/</a><br>
<br>
Anyway, sorry for the trouble, but I hope that the annoyance is worth<br>
the new advantages!<br>
<br>
-Matt<br>
<div><div></div><div class="h5"><br>
On Tue, Mar 30, 2010 at 11:07 AM, Nicholas M. Earl <<a href="mailto:earlnich@msu.edu">earlnich@msu.edu</a>> wrote:<br>
> Hey again YT community,<br>
><br>
> I was hoping to get some heading on using the simple volume rending script<br>
> that is written up in the YT cookbook, but it seems that direct_ray_casting<br>
> isn't a part of yt extensions anymore? Is there something to substitute<br>
> this? I see that in the software sample script, there is a referencing of<br>
> VolumeRendering, can I use this?<br>
><br>
> Thanks for your time and effort!<br>
> Nicholas Earl<br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br>
</div></div></blockquote></div><br>