Hi,<br><br>I just added also trr and noticed that :<br>- trr read_trr doesn&#39;t return exdrENDOFFILE but exdrINT when all frames have been read<br>- there is no function to test whether the trr has forces/velocities.<br>

<br>I&#39;m happy to do both but I&#39;m not quite sure what the best approach is.<br><br>For the EOF: Should we check the fread in xdrstdio_getlong for EOF or is it ok to assume when the first read of the header is not OK, that it is EOF?<br>

For the test: Should we add an additional function which returns whether the file contains forces/velocities?<br><br>Roland<br><br><div class="gmail_quote">On Fri, Mar 27, 2009 at 5:17 PM, Roland Schulz <span dir="ltr">&lt;<a href="mailto:roland@utk.edu">roland@utk.edu</a>&gt;</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,<br><br>I wrote a small python wrapper around the new libxdr. <br>Nothing has to be compile. It just uses the library. <br>

It requires libxdr as shared library (the library has to be in the LD_PATH) and it requires ctypes (part of python 2.5 seperate available for older python)<br>
<br>With it one can print the 1st x-coordinates of each frame by:<br>from xdrfile import *<br>x=xdrfile(&quot;test.xtc&quot;)<br>for f in x:<br>  print f.x[0][0]<br><br>(all possible errors are raised as python IO exceptions)<br>


<br>Can I commit it to cvs to the src folder? It would not generate any dependencies. I wouldn&#39;t add it to the Makefile.<br><br>attached is the wrapper and the test routine.<br><br>It could be extended (I don&#39;t use numpy yet and it can&#39;t do trr yet). But I think it is already useful like it is.<br>


<br>Roland<br><font color="#888888"><br clear="all"><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov" target="_blank">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309<br>