[gmx-users] Fw: last frame in trr

2010-10-04 Thread Floris Buelens
sorry for the incomplete post before, believe it or not my cat was to blame. I want to write out only the final frames from a set of trr trajectories. This was discussed here with apparently only a workaround: http://www.mail-archive.com/gmx-users@gromacs.org/msg19545.html however intuitively

Re: [gmx-users] Fw: last frame in trr

2010-10-04 Thread Tsjerk Wassenaar
Hey Floris, Here's a python script to write out the last frame from a .trr file: #PYTHON #!/usr/bin/env python import sys # Read a 32 bit unsigned int def i(x): return sum([ord(x[j])(24-j*8) for j in range(4)]) # Open the file, find the end and go back f = open(sys.argv[1],'rb') f.seek(0,2)