get_ax

mdtools.dtrj.get_ax(ax_cmp=None, ax_fr=None)[source]

Return the frame/compound axis for a discrete trajectory given its compound/frame axis.

Parameters:
  • ax_cmp ({-2, -1, 0, 1} or None, optional) – Compound axis. Either ax_cmp or ax_fr must be given.

  • ax_fr ({-2, -1, 0, 1} or None, optional) – Frame axis. Either ax_cmp or ax_fr must be given.

Returns:

  • ax_cmp (int) – The compound axis for a discrete trajectory.

  • ax_fr (int) – The frame axis for a discrete trajectory.

Raises:

numpy.exceptions.AxisError – If the given compound/frame axis is out of bounds for a discrete trajectory with two dimensions.

Notes

All returned axis indices will be positive.

Examples

>>> mdt.dtrj.get_ax(ax_cmp=0)
(0, 1)
>>> mdt.dtrj.get_ax(ax_cmp=1)
(1, 0)
>>> mdt.dtrj.get_ax(ax_cmp=-1)
(1, 0)
>>> mdt.dtrj.get_ax(ax_cmp=-2)
(0, 1)
>>> mdt.dtrj.get_ax(ax_fr=0)
(1, 0)
>>> mdt.dtrj.get_ax(ax_fr=1)
(0, 1)
>>> mdt.dtrj.get_ax(ax_fr=-1)
(0, 1)
>>> mdt.dtrj.get_ax(ax_fr=-2)
(1, 0)