4 Formats

Adding a new file type is simple. The new type has to be added to the file formats.py (in the root directory of the distribution) in form of a class that has the exact name of the new type. The class posseses two methods read and write. The method read opens a file and reads the data. It must initialize at least the five variables tnow,label,pos,vel and mass. Other variables can be set with the instruction : self.master.newvar=newval in order to be used inside the Nbody object. The method write is used to write data on a file with a specific format. See the existing classes for examples.

See About this document... for information on suggesting changes.