[yt-users] Blank images for simple volume rendering

Noel Scudder noel.scudder at stonybrook.edu
Thu Jun 27 13:26:49 PDT 2013


Hello,

I'm new to yt, and am having some trouble volume rendering my Castro
simulation data (3D).
The simulation is of two stars orbiting the center of the domain, the
domain being defined by defined by [0.0, 0.0, 0.0], [1.e10, 1.e10, 1.e10],
in cgs.
When I run the following script, I get an image that is either all black or
all white, depending on which field I use.
Does anyone see anything wrong with my script?:

  from yt.mods import *
  pf = load("plt_derr_perr_grav_00020")
  field = "density"
  dd = pf.h.all_data()
  mi, ma = dd.quantities["Extrema"](field)[0]

  tf = ColorTransferFunction((mi, ma))

  c = [5.0e9, 5.0e9, 5.0e9]
  L = [1., 1., 1.]
  W = pf.domain_right_edge - pf.domain_left_edge
  Nvec = 512
  cam = pf.h.camera(c, L, W, (Nvec,Nvec), transfer_function = tf,
fields=[field], pf=pf)

  tf.add_layers(4, colormap="hsv")
  cam.snapshot("v1.png")

Any advice would be greatly appreciated.

Best,
Noel Scudder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130627/ca00dd9c/attachment.htm>


More information about the yt-users mailing list