[gmx-users] help to parse edr file using xdrlib in python

Alan alanwilter at gmail.com
Wed Aug 18 17:36:41 CEST 2010

Hi there,

I am trying to retrieve energies calculated by gmx in python code. It sounds
that I could use xdrlib if only I could understand how gmx data were packed
in the edr file.

For example, I am doing this:

import xdrlib

In: f = open('aogAAA.edr').read()
In: data = xdrlib.Unpacker(f)
In: repr(data.unpack_string())
# what?
In: repr(data.unpack_string())
Out: "'Ryckaert-Bell.'"
# hum, sounds better, but to get the type of data associated?
# a guess
In: data.unpack_float()
Out: 5.605193857299268e-45
# Ok, what that means?

Any help here would be appreciated.

Many thanks,


Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20100818/b7f81692/attachment.html>

More information about the gromacs.org_gmx-users mailing list