mars_time.MarsTimeDelta#
- class mars_time.MarsTimeDelta(year: int = 0, sol: float = 0)[source]#
A
MarsTimeDeltarepresents 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
MarsTimeCreate 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
MarsTimeDeltato or from this object results in anotherMarsTimeDelta.>>> 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
solGet the input number of sol.
solsGet the approximate number of sols that this object represents.
yearGet the input number of Mars years.