[yt-users] error on volume rendering on zoom-in simulation

Sam Skillman samskillman at gmail.com
Wed Sep 4 10:13:13 PDT 2013


Hi Mohammad,

I think you need to add values to the transfer function, as is done in the
cookbook:
http://yt-project.org/doc/cookbook/simple_plots.html#simple-volume-rendering

You can use tf.add_layers, or any of the other tf modifier:
http://yt-project.org/doc/api/generated/yt.visualization.volume_rendering.transfer_functions.ColorTransferFunction.html#yt.visualization.volume_rendering.transfer_functions.ColorTransferFunction


On Wed, Sep 4, 2013 at 10:04 AM, mohammad safarzadeh <mtsafarzadeh at gmail.com
> wrote:

> Hi,
> I am trying to do VR on a halo in my zoom-in region which is a dark matter
> only sim, but I get a black image when I try this:
>
> L=[1,1,1]
>
> W=1/pf["Mpc"]
>
> n [16]: mi,ma=region.quantities["Extrema"]("particle_density")[0]
>
>
> In [17]: mi
>
> Out[17]: 0.0
>
>
> In [18]: ma
>
> Out[18]: 4.5282895435060503e-24
>
>
> In [21]: np.log10(ma)
>
> Out[21]: -23.344065811694637
>
>
> mi=-24
>
> ma=np.log10(ma)
>
> tf = ColorTransferFunction((mi,ma))
>
> cam=region.pf.h.camera(c, L, W, Npixels,
> tf,fields=["particle_density"],log_fields=True)
>
>
> ImageArray([[[ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.],
>
>         ...,
>
>         [ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.]],
>
>
>        [[ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.],
>
>         ...,
>
>         [ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.],
>
>         [ 0.,  0.,  0.,  1.]],….
>
>
> what is the mistake that I am doing?
>
>
> -Regards,
>
> Mohammad
>
> _______________________________________________
> 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/20130904/1ec6e7fb/attachment.html>


More information about the yt-users mailing list