18.11.2012 Views

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ASE</strong> <strong>Manual</strong>, <strong>Release</strong> 3.6.1.2828<br />

are convenience functions, giving the number of atoms in the two molecules constituting a dimer and the relative<br />

intermolecular distance in a dimer (relative to the ‘1.0’ separation, and in Angstrom), respectively.<br />

7.25 Trajectory files<br />

The io.trajectory module defines Trajectory objects, that is objects storing the temporal evolution of a<br />

simulation. A Trajectory file contains one or more Atoms objects, usually to be interpreted as a time series,<br />

although that is not a requirement.<br />

The io.trajectory module currently defines two kinds of Trajectory files, the PickleTrajectory and the<br />

BundleTrajectory. PickleTrajectory is the recommended Trajectory format, BundleTrajectory is only intended<br />

for large molecular dynamics simulations (large meaning millions of atoms).<br />

In the future, other kinds of Trajectories may be defined, with similar Python interface but with different underlying<br />

file formats.<br />

7.25.1 PickleTrajectory<br />

The PickleTrajectory has the interface<br />

class ase.io.trajectory.PickleTrajectory(filename, mode=’r’, atoms=None, master=None,<br />

backup=True)<br />

Reads/writes Atoms objects into a .traj file.<br />

A PickleTrajectory can be created in read, write or append mode.<br />

Parameters:<br />

filename: The name of the parameter file. Should end in .traj.<br />

mode=’r’: The mode.<br />

‘r’ is read mode, the file should already exist, and no atoms argument should be specified.<br />

‘w’ is write mode. If the file already exists, is it renamed by appending .bak to the file name. The<br />

atoms argument specifies the Atoms object to be written to the file, if not given it must instead be given<br />

as an argument to the write() method.<br />

‘a’ is append mode. It acts a write mode, except that data is appended to a preexisting file.<br />

atoms=None: The Atoms object to be written in write or append mode.<br />

master=None: Controls which process does the actual writing. The default is that process number 0 does<br />

this. If this argument is given, processes where it is True will write.<br />

backup=True: Use backup=False to disable renaming of an existing file.<br />

close()<br />

Close the trajectory file.<br />

open(filename, mode)<br />

Opens the file.<br />

For internal use only.<br />

post_write_attach(function, interval=1, *args, **kwargs)<br />

Attach a function to be called after writing ends.<br />

function: The function or callable object to be called.<br />

interval: How often the function is called. Default: every time (1).<br />

All other arguments are stored, and passed to the function.<br />

7.25. Trajectory files 169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!