pub struct NetcdfTrajectoryBuilder {
pub title: String,
pub application: String,
pub frames: Vec<TrajectoryFrame>,
pub use_angstroms: bool,
}Expand description
Fluent builder for writing NetCDF-convention trajectories.
Fields§
§title: StringTitle / description of the trajectory.
application: StringApplication name that produced this trajectory.
frames: Vec<TrajectoryFrame>Frames in insertion order.
use_angstroms: boolWhether positions are stored in Å (true) or nm (false).
Implementations§
Source§impl NetcdfTrajectoryBuilder
impl NetcdfTrajectoryBuilder
Sourcepub fn with_title(self, title: &str) -> Self
pub fn with_title(self, title: &str) -> Self
Set the trajectory title.
Sourcepub fn with_application(self, app: &str) -> Self
pub fn with_application(self, app: &str) -> Self
Set the application name.
Sourcepub fn in_angstroms(self) -> Self
pub fn in_angstroms(self) -> Self
Use Å as the position unit.
Sourcepub fn in_nanometres(self) -> Self
pub fn in_nanometres(self) -> Self
Use nm as the position unit.
Sourcepub fn add_frame(&mut self, frame: TrajectoryFrame)
pub fn add_frame(&mut self, frame: TrajectoryFrame)
Append a frame to the trajectory.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Number of frames stored.
Sourcepub fn rmsd_series(&self) -> Vec<f64>
pub fn rmsd_series(&self) -> Vec<f64>
Compute the RMSD trajectory (each frame vs. frame 0).
Sourcepub fn write_cdl<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn write_cdl<W: Write>(&self, writer: &mut W) -> Result<()>
Write a minimal CDL representation to a writer.
Sourcepub fn time_series(&self) -> Vec<f64>
pub fn time_series(&self) -> Vec<f64>
Extract the time series (ps) of all frames.
Sourcepub fn com_trajectory(&self) -> Vec<[f64; 3]>
pub fn com_trajectory(&self) -> Vec<[f64; 3]>
Compute per-frame centre-of-mass trajectories.
Sourcepub fn frame(&self, idx: usize) -> &TrajectoryFrame
pub fn frame(&self, idx: usize) -> &TrajectoryFrame
Get frame at a specific index (panics if out of range).
Trait Implementations§
Source§impl Clone for NetcdfTrajectoryBuilder
impl Clone for NetcdfTrajectoryBuilder
Source§fn clone(&self) -> NetcdfTrajectoryBuilder
fn clone(&self) -> NetcdfTrajectoryBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetcdfTrajectoryBuilder
impl Debug for NetcdfTrajectoryBuilder
Source§impl Default for NetcdfTrajectoryBuilder
impl Default for NetcdfTrajectoryBuilder
Source§fn default() -> NetcdfTrajectoryBuilder
fn default() -> NetcdfTrajectoryBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NetcdfTrajectoryBuilder
impl RefUnwindSafe for NetcdfTrajectoryBuilder
impl Send for NetcdfTrajectoryBuilder
impl Sync for NetcdfTrajectoryBuilder
impl Unpin for NetcdfTrajectoryBuilder
impl UnsafeUnpin for NetcdfTrajectoryBuilder
impl UnwindSafe for NetcdfTrajectoryBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.