Hi Shankar,<br><br>The image_writer was an integral part of making the movie you refer to in your email.  In brief, I made the frames for the images and colorbars separately, then grafted them together using another script.  I have pasted an example of a script I used to make the colorbar portion of the frames here:<br>
<a href="http://paste.enzotools.org/show/1580/">http://paste.enzotools.org/show/1580/</a><br>I then used the script below to attach the colorbar image to the volume render frame.<br><a href="http://paste.enzotools.org/show/1581/">http://paste.enzotools.org/show/1581/</a><br>
Note the line in this script:<br>cmap = cmap[1:,:,:]<br>I am chopping off one pixel from the colorbar image so that it has the same dimension as the rendering image on the side that they are being attached.  If you look at the script, the images are just arrays that are being concatenated so you have to make sure that your image dimension work.<br>
<br>I hope this helps.<br><br>Britton<br><br>p.s. - Thanks again to Matt and Sam who made all of that possible!<br><br><div class="gmail_quote">On Sun, Apr 17, 2011 at 1:01 PM, Agarwal, Shankar <span dir="ltr"><<a href="mailto:sagarwal@ku.edu">sagarwal@ku.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I recently made some volume rendered images using the following script (along the lines of Britton's <a href="http://paste.enzotools.org/show/1472/" target="_blank">http://paste.enzotools.org/show/1472/</a>). Basically, it loops over all the redshifts, creating a snapshot - each snapshot rotated a bit using the YT-camera object. I wanted to know how can I add a colorbar (something as in <a href="http://vimeo.com/17100442" target="_blank">http://vimeo.com/17100442</a>)? Also, I would like to display a few cosmology variables like:<br>

<br>
    pf['CosmologyCurrentRedshift']<br>
    pf['CosmologyOmegaBaryonNow']<br>
<br>
My attempts with the image_writer are a disaster. I found that Libby had the same question a few months back, where she had a separate colorbar image and she joined 2 images. Please let me know how to modify the following script.<br>

<br>
Regards<br>
Shankar<br>
<br>
<br>
my_script.py<br>
-----------------<br>
<br>
from yt.mods import *<br>
import yt.visualization.volume_rendering.api as vr<br>
<br>
output_dir = 'movie'<br>
c = [0.5]*3 # Center<br>
L = [1.0,1.0,1.0] # Viewpoint<br>
W = na.sqrt(4.0) # Width<br>
N = 1024 # Pixels<br>
up = [0.,0.,1.] # Set the north vector<br>
n_colors = 3<br>
angle = 4 * na.pi / 360.0<br>
<br>
for n in range(0,112): # each n is a unique redshift dump<br>
 fin = 'lp7/seed1/RD%04i/RedshiftOutput%04i' % (n,n)  # parameter file to load<br>
 pf = load(fin) # load data<br>
 dd = pf.h.all_data()<br>
 min, max = na.log10(dd.quantities["Extrema"]("Density")[0])<br>
 print min, max<br>
<br>
 fout = "%s/%04i.png" % (output_dir,n)<br>
<br>
 width = 0.3 * (max - min) / float(n_colors)<br>
 alpha = na.logspace(-3.5, -1, n_colors)<br>
<br>
 tf = vr.ColorTransferFunction((min-3, max+1))<br>
 tf.add_layers(n_colors,w=width, alpha=alpha, min=min, max=max, col_bounds=(min,max), colormap='gist_ncar')<br>
<br>
 cam = vr.Camera(c, L, W, (N,N), fields=['Density'], transfer_function=tf, pf=pf, use_kd=True, l_max=None,<br>
                 north_vector=up, tree_type='domain',no_ghost=True, steady_north=True)<br>
<br>
 cam.rotate((n * angle))<br>
 cam.snapshot(fout)<br>
 del cam<br>
 del tf<br>
 del alpha<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>
</blockquote></div><br>