mars_time.MarsTimeDelta#

class mars_time.MarsTimeDelta(year: int = 0, sol: float = 0)[source]#

A MarsTimeDelta represents a generic change in time on Mars.

Parameters:
  • year (int) – Some amount of Mars years.

  • sol (float) – Some amount of sols.

Raises:
  • TypeError – Raised if either of the inputs are a type that cannot be cast to a numeric data type.

  • ValueError – Raised if either input cannot be converted to its prefered type.

See also

MarsTime

Create new Mars times from these time deltas.

Notes

Objects of this type are immutable.

Examples

Create an instance of this class.

>>> import mars_time
>>> mars_time.MarsTimeDelta(year=1, sol=50)
MarsTimeDelta(year=1, sol=50.00)

Adding or subtracting a MarsTimeDelta to or from this object results in another MarsTimeDelta.

>>> mtd = mars_time.MarsTimeDelta(year=1, sol=50) + mars_time.MarsTimeDelta(sol=700)
>>> mtd
MarsTimeDelta(year=1, sol=750.00)

Methods

__init__([year, sol])

Attributes

sol

Get the input number of sol.

sols

Get the approximate number of sols that this object represents.

year

Get the input number of Mars years.