mdtraj.formats.NetCDFTrajectoryFile¶
- 
class mdtraj.formats.NetCDFTrajectoryFile(filename, mode='r', force_overwrite=True)¶
- Interface for reading and writing to AMBER NetCDF files. This is a file-like object, that supports both reading or writing depending on the mode flag. It implements the context manager protocol, so you can also use it with the python ‘with’ statement. - Parameters
- filenamepath-like
- The name of the file to open 
- mode{‘r’, ‘w’}, default=’r’
- The mode in which to open the file. Valid options are ‘r’ and ‘w’ for ‘read’ and ‘write’, respectively. 
- force_overwritebool, default=False
- In write mode, if a file named filename already exists, clobber it and overwrite it. 
 
- Attributes
- n_atoms
- n_frames
 
 - Methods - close()- Close the NetCDF file handle - flush()- Write all buffered data in the to the disk file. - read([n_frames, stride, atom_indices])- Read data from a molecular dynamics trajectory in the AMBER NetCDF format. - read_as_traj(topology[, n_frames, stride, …])- Read a trajectory from a NetCDF file - seek(offset[, whence])- Move to a new file position - tell()- Current file position - write(coordinates[, time, cell_lengths, …])- Write one or more frames of a molecular dynamics trajectory to disk in the AMBER NetCDF format. - 
__init__(filename, mode='r', force_overwrite=True)¶
- Initialize self. See help(type(self)) for accurate signature. 
 - Methods - __init__(filename[, mode, force_overwrite])- Initialize self. - close()- Close the NetCDF file handle - flush()- Write all buffered data in the to the disk file. - read([n_frames, stride, atom_indices])- Read data from a molecular dynamics trajectory in the AMBER NetCDF format. - read_as_traj(topology[, n_frames, stride, …])- Read a trajectory from a NetCDF file - seek(offset[, whence])- Move to a new file position - tell()- Current file position - write(coordinates[, time, cell_lengths, …])- Write one or more frames of a molecular dynamics trajectory to disk in the AMBER NetCDF format. - Attributes - distance_unit- n_atoms- n_frames