amep.reader.HOOMDReader#
- class amep.reader.HOOMDReader(directory: str, savedir: str, start: float = 0.0, stop: float = 1.0, nth: int = 1, filename: str = 'trajectory.gsd', dt: float = 1.0, e0: ndarray = [1, 0, 0], trajfile: str = 'traj.h5amep', deleteold: bool = False, verbose: bool = False)#
Bases:
BaseReaderReads hoomd-blue GSD files and writes the containing data to an hdf5 file.
- __init__(directory: str, savedir: str, start: float = 0.0, stop: float = 1.0, nth: int = 1, filename: str = 'trajectory.gsd', dt: float = 1.0, e0: ndarray = [1, 0, 0], trajfile: str = 'traj.h5amep', deleteold: bool = False, verbose: bool = False) None#
Reader for simulation data in the hoomd-blue gsd file format.
- Note: The gsd file format does not save the (physical) time.
Only the timestep is saved. By supplying the simulation timestep dt, the (physical) time will be calculated. The default for dt is 1.
- Parameters:
directory (str) – Simulation directory.
savedir (str) – Directory in which the trajectory file will be stored.
start (float, optional) – Start reading data from this fraction of the whole trajectory. The default is 0.
stop (float, optional) – Stop reading data from this fraction of the whole trajectory. The default is 1.
nth (int, optional) – Read each nth dump file. The default is None.
filename (str, optional) – File name of the gsd trajectory file. The default is ‘trajectory.gsd’.
dt (float, optional) – Timestep of the simulation. The GSD file format does only save the simulation step number but not the (physical) time. The default is 1.
e0 (np.ndarray, optional) – Orientation vector of the particles. hoomd-blue does only save rotations instead of orientations, thus an (initial) orientation vector is needed. This can, for example, be the self-propulsion direction of the particles. shape=(3,) or (N,3,). The default is [1,0,0].
trajfile (str, optional) – Name of the hdf5 trajectory file that is created when an object of this class is initialized. The default is TRAJFILENAME.
deleteold (bool, optional) – If True, an existing old h5amep trajectory file #<trajfile> will be removed. The default is False.
verbose (bool, optional) – If True, runtime information is printed. The default is False.
- Return type:
None.
Methods
__init__(directory, savedir[, start, stop, ...])Reader for simulation data in the hoomd-blue gsd file format.
Attributes
ddtThe path to the HDF5-file that contains the writers data.
nthsavedirstartThe array of simulation steps for each saved frame.
stopThe array of physical times for each saved frame.
- property filename: Path#
The path to the HDF5-file that contains the writers data.
- property steps: ndarray#
The array of simulation steps for each saved frame.
The simulation steps are also used to index the frame data in the HDF5-File.
- property times#
The array of physical times for each saved frame.