<div dir="ltr">Hi Henry,<div><br></div><div style>Welcome to yt!  </div><div style><br></div><div style>Thanks for bringing this up.  I've had some code lying around uncommitted for quite some time that allows for this type of annotation of the grids/domains, and this has motivated me to revive it and push it along.  I currently have a pull request open to incorporate these changes, and they will likely be accepted soon (<a href="https://bitbucket.org/yt_analysis/yt/pull-request/406/draw-domain-boundary-and-first-pass-at/diff">https://bitbucket.org/yt_analysis/yt/pull-request/406/draw-domain-boundary-and-first-pass-at/diff</a>).</div>

<div style><br></div><div style>Once it is accepted, you should be able to update (to the development brach), and do:</div><div style><span style="font-family:arial,sans-serif;font-size:13px">im = cam.snapshot("volume_rendered%</span><span style="font-family:arial,sans-serif;font-size:13px">s.png" % num)</span><br>

</div><div style><span style="font-family:arial,sans-serif;font-size:13px">cam.draw_domain(im)</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">write_bitmap(im, 'volume_rendered%s_with_domain.png" % num)</span></div>

<div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Once the functionality is added, I will send an email to the users list announcing it as a feature and asking for folks to test it out.  </span></div>

<div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Best,</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Sam</span></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 22, 2013 at 6:29 AM, henry wasker <span dir="ltr"><<a href="mailto:henry.wasker@gmail.com" target="_blank">henry.wasker@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br><br>I am new to yt and I am interesting in plotting a volume rendering with output file from enzo cosmology simulation.<br>

<br><span lang="en"><span>For the time being</span></span>, I get to plot a box ; here's the result :<br>

<br><a href="http://imgur.com/dPwSQEh" target="_blank">http://imgur.com/dPwSQEh</a><br><br>I would like now to plot borders of this box too like on this image :<br><br><a href="http://imgur.com/bJ25I0l" target="_blank">http://imgur.com/bJ25I0l</a><br>


<br>
Here's the yt script I use :<br><br>------------------------------------------------------------------------------------------------------------<br><br>from yt.mods import *<br>from yt.utilities.amr_kdtree.api import AMRKDTree<br>



from time import time<br>import matplotlib.colorbar as cb<br><br># Load up your dataset<br>num='70'<br>pf = load('RD00'+num+'/RedshiftOutput00'+num)<br>c = [0.5]*3 # Center<br>L = [1.0,1.0,1.0] # Viewpoint<br>



W = na.sqrt(3) # Width<br>N = 768 # Pixels (512^2)<br>up = [0.,0.,1.]<br># Get density min, max<br># These might take a long time, so I'd suggest hand-coding mi, ma so<br># that you don't have to find the maxima and minima each time you<br>



# test. Note that mi, ma, should be a log value since we are<br># rendering the log of density.<br>mi, ma = pf.h.all_data().quantities['Extrema']('Density')[0]<br>mi, ma = na.log10(mi), na.log10(ma)<br>print mi, ma<br>



#mi, ma = -31.0, -26.0<br># Construct transfer function, pad the TF space by a bit so that<br># gaussians sampling the data range don't hit the edge.<br>tf = ColorTransferFunction((mi-10, ma+10), nbins=1024)<br># Sample transfer function with 20 gaussians. Use col_bounds keyword<br>



# to restrict color mapping to true data range.<br>tf.add_layers(20, w=0.001,<br>        col_bounds=(mi,ma),colormap='jet')<br># Create the camera object<br>cam = pf.h.camera(c, L, W, (N,N), transfer_function=tf, north_vector=up,<br>



        no_ghost=True)<br>cam.snapshot("volume_rendered%s.png" % num, clip_ratio=8.0)<br><br>------------------------------------------------------------------------------------------------------------<br><br>Is there an option for 'camera" or "snapshot" which allows to add the borders for this box ?<br>



<br>Any help would be really appreciated.<br><br><br><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></blockquote></div><br></div>