TrajectorySubset¶
- class mdcraft.core.TrajectorySubset(trajectory: Trajectory, frame_indices: slice | range | Iterable[int])[source]¶
Bases:
objectTrajectory subset.
Individual frames can be accessed through relative indexing or iteration.
- Parameters:
- trajectoryTrajectory
Full simulation trajectory.
- frame_indicesslice or array-like
Indices of frames to keep in the trajectory subset.
Methods
Gets one or more frames from the trajectory subset.
- property dt: float | None[source]¶
Time step size between timesteps in the trajectory subset. If None, the time step size is not constant across frames or could not be determined from the subset.
Reference unit: \(\mathrm{ps}\).
- get_frames(indices: int | slice | Iterable[int], /) TrajectoryFrame | list[TrajectoryFrame][source]¶
Gets one or more frames from the trajectory subset.
- Parameters:
- indicesint, slice, or array-like, positional-only
Indices of frames in the subset to get.
- Returns:
- framesTrajectoryFrame or list
Trajectory frame(s).
- property n_atoms: int¶
Number of atoms in each frame. If None, the number of atoms is not constant across frames or the trajectory subset does not contain atom data.
- property time_step: float | None[source]¶
Time step between frames in the trajectory subset. If None, the time step is not constant across frames.
Reference unit: \(\mathrm{ps}\).