<div dir="ltr">Hi Noel,<div><br></div><div>My guess is that your density field spans several orders of magnitude in value, and that the transfer function is being set up in linear space, causing all sorts of havoc. I think you added the following before the tf = ColorTransferFuctiont((mi,ma)) call:</div>
<div><br></div><div>mi, ma = np.log10(mi), np.log10(ma)</div><div>pf.h</div><div>pf.field_info['density'].take_log=True</div><div><br></div><div>and use tf = ColorTransferFuctiont((mi-1,ma+1))</div><div><br></div>
<div>then use:</div><div><span style="font-family:arial,sans-serif;font-size:13px">tf.add_layers(4, colormap="hsv", col_bounds=[mi,ma])</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">This will pad the TF with a bit extra space on the lower/upper bounds. When you add the layers, the col_bounds keyword will restrict the gaussians of emission to be within the range mi to ma. </span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">Please let us know whether or not that works.</font></div><div><font face="arial, sans-serif"><br></font></div>
<div><font face="arial, sans-serif">Best,</font></div><div><font face="arial, sans-serif">Sam</font></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Thu, Jun 27, 2013 at 3:26 PM, Noel Scudder <span dir="ltr"><<a href="mailto:noel.scudder@stonybrook.edu" target="_blank">noel.scudder@stonybrook.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Hello,</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">I'm new to yt, and am having some trouble volume rendering my Castro simulation data (3D).</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">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. </div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">When I run the following script, I get an image that is either all black or all white, depending on which field I use.</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Does anyone see anything wrong with my script?:</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> from yt.mods import *</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
pf = load("plt_derr_perr_grav_00020")</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> field = "density"</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
dd = pf.h.all_data()</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> mi, ma = dd.quantities["Extrema"](field)[0]</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> tf = ColorTransferFunction((mi, ma))</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> c = [5.0e9, 5.0e9, 5.0e9]</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
L = [1., 1., 1.]</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> W = pf.domain_right_edge - pf.domain_left_edge</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Nvec = 512</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> cam = pf.h.camera(c, L, W, (Nvec,Nvec), transfer_function = tf, fields=[field], pf=pf)</div>
<div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> </div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
tf.add_layers(4, colormap="hsv")</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> cam.snapshot("v1.png")</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Any advice would be greatly appreciated.</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<br></div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Best,</div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
Noel Scudder</div>
<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></blockquote></div><br></div>