Hi Libby,<br><br>I'm not entirely sure what is going on here.  Which changeset are you using?  I have the most recent, and I indeed see the yt.utilities.amr_utils.simple_writing method whose non-existence it is complaining about.<br>
<br>To be more precise, is the freetype_writer included in your yt/utilities/amr_utils.pyx?<br><br>[cmalone@xrb yt-hg]$ tail -1 yt/utilities/amr_utils.pyx<br>include "_amr_utils/freetype_writer.pyx"<br><br>Chris<br>
<br><div class="gmail_quote">On Wed, Jan 5, 2011 at 12:22 PM, Elizabeth Harper-Clark <span dir="ltr"><<a href="mailto:h-clark@cita.utoronto.ca">h-clark@cita.utoronto.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi guys,<br><br>I found the annotate_image option within yt.visualization.image_writer but I am missing something:<br><br><b>Script</b>:<br><br>from yt.mods import *<div class="im"><br>from matplotlib import pylab<br>import numpy as na<br>
</div>
from yt.visualization.image_writer import *<br><br>output_file = "aaWoC/%s/MovieFrame_%04i"<br><br>for i in range(0,189):<br>    print "Merging", i<br>    image1 = pylab.imread("aaWoC/%s/3D3Movie_%04i.png" % (sys.argv[-1],i))<br>

    image2 = pylab.imread("aaWoC/%s/ColourBar.png" % sys.argv[-1])<div class="im"><br><br>    new_image = na.concatenate([image1, image2], axis=1)<br></div>    bitmap = write_image(new_image,output_file % (sys.argv[-1],i ))<br>
    annotate_image(bitmap, "Test", 50, 50)<br>
    write_bitmap(bitmap, output_file % (sys.argv[-1],i))<br><br><br><b>Error</b>:<br><br>[h-clark@tpb5 my_scripts]$ python2.6 MergeImages.py GMCidresbig128a<br>yt         INFO       2011-01-05 12:18:10,296 Loading plugins from /home/h-clark/.yt/my_plugins.py<br>

/home/h-clark/YT/lib/python2.6/site-packages/matplotlib/__init__.py:833: UserWarning:  This call to matplotlib.use() has no effect<br>because the the backend has already been chosen;<br>matplotlib.use() must be called *before* pylab, matplotlib.pyplot,<br>

or matplotlib.backends is imported for the first time.<br><br>  if warn: warnings.warn(_use_error_msg)<br>Merging 0<br>yt         INFO       2011-01-05 12:18:10,473 Using only channel 1 of supplied image<br>Traceback (most recent call last):<br>

  File "MergeImages.py", line 15, in <module><br>    annotate_image(bitmap, "Test", 50, 50)<br>  File "/home/h-clark/YT/src/yt-hg/yt/visualization/image_writer.py", line 235, in annotate_image<br>

    au.simple_writing(font_path, 0, dpi, font_size, text, image, xpos, ypos)<br>AttributeError: 'module' object has no attribute 'simple_writing'<br><br><br>????<br><br>Also is there a way to change font colour? (in vol rend background is black so I want text in white!). will text_args = {'color':'w'} work?<br>

<br>Many thanks,<br><br>Libby<div><div></div><div class="h5"><br><br><br><br><br><div class="gmail_quote">On 5 January 2011 12:05, Elizabeth Harper-Clark <span dir="ltr"><<a href="mailto:h-clark@cita.utoronto.ca" target="_blank">h-clark@cita.utoronto.ca</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks Britton, <br><br>Concatenating is working :-) now to work out labels......<br><br>Thanks,<br>

<br>Libby<div><div></div><div><br><br><div class="gmail_quote">On 5 January 2011 11:29, Britton Smith <span dir="ltr"><<a href="mailto:brittonsmith@gmail.com" target="_blank">brittonsmith@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It is possible to attach a colormap to a volume render image.  I can't quite remember how to do that.  If someone else could chime in on that, that would be great.<br>


If you already have the colorbar image you want, you can concatenate two image arrays easily and then write out the new image, provided the arrays are the same size in one direction.  With pylab, you can do something like this:<br>



from matplotlib import pylab<br>import numpy as na<br>from yt.visualization.image_writer import write_bitmap<br>image1 = pylab.imread(file1)<br>image2 = pylab.imread(file2)<br>new_image = na.concatenate([image1, image2], axis=1)<br>



write_bitmap(new_image, output_file)<br><br>I believe the image_writer now supports adding text as well, so that should take care of the labels.<br><br>Britton<br><br><div class="gmail_quote"><div><div></div><div>
On Wed, Jan 5, 2011 at 10:46 AM, Elizabeth Harper-Clark <span dir="ltr"><<a href="mailto:h-clark@astro.utoronto.ca" target="_blank">h-clark@astro.utoronto.ca</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>Good morning everyone,<br><br>I was wondering how to add colorbars and text labels (e.g. with the time) to images produced through volume rendering. I am unsure of how to adapt all the usual techniques I know for projections etc. gievn the different technique for drawing the images. I am using a constant colorbar so if anyone can suggest a post-processing way of adding to created images that would work too!<br>




<br>I am using the following to create my volume rendered images:<br>    for i, snapshot in enumerate(cam.rotation(2.*na.pi, n_angles)):<br>        print "     drawing:  dump =", numb, "angle =",  i, "shot=",shott<br>




        if cam._mpi_get_rank() == 0:<br>            write_bitmap(snapshot, frame_template % (sys.argv[-1],shott))<br>            pl.draw()<br>            shott = shott+1<br><br>Many thanks,<br><br>Libby <br clear="all"><font color="#888888"><br>




-- <br>Elizabeth Harper-Clark MA MSci<br>PhD Candidate, Canadian Institute for Theoretical Astrophysics, UofT<br>Sciences and Engineering Coordinator, Teaching Assistants' Training Program, UofT<br><br><a href="http://www.astro.utoronto.ca/%7Eh-clark" target="_blank">www.astro.utoronto.ca/~h-clark</a><br>




<a href="mailto:h-clark@cita.utoronto.ca" target="_blank">h-clark@cita.utoronto.ca</a><br>Astronomy office phone: +1-416-978-5759<br>
</font><br></div></div>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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><br clear="all"><br>-- <br>Elizabeth Harper-Clark MA MSci<br></div></div>PhD Candidate, Astrophysics, UofT<div><br><br><a href="http://www.astro.utoronto.ca/%7Eh-clark" target="_blank">www.astro.utoronto.ca/~h-clark</a><br>


<a href="mailto:h-clark@cita.utoronto.ca" target="_blank">h-clark@cita.utoronto.ca</a><br></div>AIM: edphc1<br>MSN: <a href="mailto:edphc1@hotmail.com" target="_blank">edphc1@hotmail.com</a><br>Skype: eharperclark<br>Office phone: 416-978-5759<br>



</blockquote></div><br><br clear="all"><br>-- <br>Elizabeth Harper-Clark MA MSci<br>PhD Candidate, Astrophysics, UofT<br><br><a href="http://www.astro.utoronto.ca/%7Eh-clark" target="_blank">www.astro.utoronto.ca/~h-clark</a><br>

<a href="mailto:h-clark@cita.utoronto.ca" target="_blank">h-clark@cita.utoronto.ca</a><br>AIM: edphc1<br>MSN: <a href="mailto:edphc1@hotmail.com" target="_blank">edphc1@hotmail.com</a><br>Skype: eharperclark<br>Office phone: 416-978-5759<br>


</div></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>