Skip to main content

TrajectoryAxisRow

Physical coordinate that one dimension of a trajectory runs along.

Usage

Source

TrajectoryAxisRow()

Examples

A relaxed scan of the H-O-O-H dihedral of hydrogen peroxide:

>>> axis = TrajectoryAxisRow(axis=0, kind="dihedral", keys=[0, 1, 2, 3])
>>> geo = GeometryRow(
...     symbols=["H", "O", "O", "H"],
...     coordinates=[[0, 0, 1], [0, 0, 0], [0, 1, 0], [1, 1, 0]],
... )
>>> axis.measure(geo)
90.0

Attributes

Name Description
axis Dimension of the trajectory’s geometry index that this axis describes.
keys Indices of the atoms defining the coordinate (2, 3, or 4 for a distance,
kind Kind of coordinate; OTHER coordinates are not measured from the geometry.
label Human-readable description (e.g. "H-O-O-H torsion").
trajectory The described TrajectoryRow.
trajectory_id Foreign key to the TrajectoryRow this axis describes.
units Units of the values along this axis (a pint unit string); on flush, defaults

axis

Dimension of the trajectory’s geometry index that this axis describes.

axis: int = Field(primary_key=True)


keys

Indices of the atoms defining the coordinate (2, 3, or 4 for a distance,

keys: list[int] | None = Field(default=None, sa_column=(Column(JSON)))

angle, or dihedral).


kind

Kind of coordinate; OTHER coordinates are not measured from the geometry.

kind: AxisKind


label

Human-readable description (e.g. "H-O-O-H torsion").

label: str | None = None


trajectory

The described TrajectoryRow.

trajectory: TrajectoryRow = Relationship(back_populates="axes")


trajectory_id

Foreign key to the TrajectoryRow this axis describes.

trajectory_id: uuid.UUID | None = _link_fk_field("trajectory.id")


units

Units of the values along this axis (a pint unit string); on flush, defaults

units: str | None = None

to Angstrom for distances, degrees for angles, and dimensionless otherwise.

Methods

Name Description
convert() Return value in units; a value without units is assumed to be in them.
measure() Measure this coordinate in geo, in units, or None for OTHER axes.

convert()

Return value in units; a value without units is assumed to be in them.

Usage

Source

convert(value)
Raises
ValueError
If value is a pint.Quantity with incompatible units.

measure()

Measure this coordinate in geo, in units, or None for OTHER axes.

Usage

Source

measure(geo)