[yt-users] ProjectionTransferFunction with Camera

Munier Azzam Salem msalem at astro.columbia.edu
Wed Jan 29 07:13:35 PST 2014


Hey Guys,

     I'm trying to get simple projections, but using the Camera interface,
to allow skewed perspectives. I've tried simply allowing the camera to use
the default ProjectionTransferFunction, in lieu of prettier color transfer
functions ... this seems to yield an all-black image. I've also tried
explicitly setting it's bounds (both with log and non-log limits). This
doesn't seem to help. I see this issue came up about a year ago
here<http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2013-January/003285.html>
.

       My script's included below. I'm tempted to just tweak my inputs to
the color trasnfer function to mimic a simple projection.

         thanks!
             Munier

My script:

*from yt.mods import **
*import yt.visualization.volume_rendering.api as vr*
*from yt.visualization.volume_rendering.transfer_functions import
ProjectionTransferFunction as PTF*

*pf = load("DD0179/DD0179")*
*field = 'Density'*
*use_log = True*

*# Find the bounds in log space of for your field*
*dd = pf.h.all_data()*
*limits = np.array(dd.quantities["Extrema"](field)[0]) * pf.units['cm']*

*#if use_log:*
*#    limits = np.log(limits)*

*# Set up the camera parameters: center, looking direction, width,
resolution*
*c = np.array([.333]*3)*
*L = np.array([1.0, 1.0, 1.0])*
*W = 0.3 / pf["unitary"]*
*N = 1028*

*# Create a camera object*
*cam = vr.Camera(c, L, W, (N,N), transfer_function=PTF(limits),pf=pf)*
*im = cam.snapshot('density.png')*

-- 
Munier A. Salem // 845.489.6450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140129/082c8baa/attachment.htm>


More information about the yt-users mailing list