hapsira.bodies

Bodies of the Solar System.

Contains some predefined bodies of the Solar System:

  • Sun (☉)

  • Earth (♁)

  • Moon (☾)

  • Mercury (☿)

  • Venus (♀)

  • Mars (♂)

  • Jupiter (♃)

  • Saturn (♄)

  • Uranus (⛢)

  • Neptune (♆)

  • Pluto (♇)

  • Phobos

  • Deimos

  • Europa

  • Ganyemede

  • Enceladus

  • Titan

  • Titania

  • Triton

  • Charon

and a way to define new bodies (Body class).

Data references can be found in constants

Module Contents

Classes

Body

Built-in immutable sequence.

SolarSystemPlanet

Built-in immutable sequence.

Attributes

Sun

Mercury

Venus

Earth

Mars

Jupiter

Saturn

Uranus

Neptune

Pluto

Moon

Phobos

Deimoms

Europa

Ganymede

Enceladus

Titan

Titania

Triton

Charon

class hapsira.bodies.Body

Bases: namedtuple('_Body', ['parent', 'k', 'name', 'symbol', 'R', 'R_polar', 'R_mean', 'rotational_period', 'J2', 'J3', 'mass', 'mean_a'])

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

If the argument is a tuple, the return value is the same object.

property angular_velocity
__slots__ = ()
__str__()

Return str(self).

__reduce__()

Helper for pickle.

__repr__()

Return repr(self).

classmethod from_parameters(parent, k, name, symbol, R, **kwargs)
classmethod from_relative(reference, parent, k, name, symbol=None, R=0, **kwargs)
__add__()

Return self+value.

__contains__()

Return key in self.

__delattr__()

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__()

Return self==value.

__format__()

Default object formatter.

__ge__()

Return self>=value.

__getattribute__()

Return getattr(self, name).

__getitem__()

Return self[key].

__getnewargs__()
__gt__()

Return self>value.

__hash__()

Return hash(self).

__iter__()

Implement iter(self).

__le__()

Return self<=value.

__len__()

Return len(self).

__lt__()

Return self<value.

__mul__()

Return self*value.

__ne__()

Return self!=value.

__reduce_ex__()

Helper for pickle.

__rmul__()

Return value*self.

__setattr__()

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

count()

Return number of occurrences of value.

index()

Return first index of value.

Raises ValueError if the value is not present.

class hapsira.bodies.SolarSystemPlanet

Bases: Body

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.

If the argument is a tuple, the return value is the same object.

property angular_velocity
__slots__ = ()
plot(epoch=None, label=None, plane=Planes.EARTH_ECLIPTIC, backend=None)

Plots the body orbit.

Parameters:
  • epoch (astropy.time.Time, optional) – Epoch of current position.

  • label (str, optional) – Label for the orbit, defaults to empty.

  • plane (Planes) – Reference plane of the coordinates.

  • backend (OrbitPlotterBackend) – An instance of OrbitPlotterBackend for rendendering the scene.

__str__()

Return str(self).

__reduce__()

Helper for pickle.

__repr__()

Return repr(self).

classmethod from_parameters(parent, k, name, symbol, R, **kwargs)
classmethod from_relative(reference, parent, k, name, symbol=None, R=0, **kwargs)
__add__()

Return self+value.

__contains__()

Return key in self.

__delattr__()

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__()

Return self==value.

__format__()

Default object formatter.

__ge__()

Return self>=value.

__getattribute__()

Return getattr(self, name).

__getitem__()

Return self[key].

__getnewargs__()
__gt__()

Return self>value.

__hash__()

Return hash(self).

__iter__()

Implement iter(self).

__le__()

Return self<=value.

__len__()

Return len(self).

__lt__()

Return self<value.

__mul__()

Return self*value.

__ne__()

Return self!=value.

__reduce_ex__()

Helper for pickle.

__rmul__()

Return value*self.

__setattr__()

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

count()

Return number of occurrences of value.

index()

Return first index of value.

Raises ValueError if the value is not present.

hapsira.bodies.Sun
hapsira.bodies.Mercury
hapsira.bodies.Venus
hapsira.bodies.Earth
hapsira.bodies.Mars
hapsira.bodies.Jupiter
hapsira.bodies.Saturn
hapsira.bodies.Uranus
hapsira.bodies.Neptune
hapsira.bodies.Pluto
hapsira.bodies.Moon
hapsira.bodies.Phobos
hapsira.bodies.Deimoms
hapsira.bodies.Europa
hapsira.bodies.Ganymede
hapsira.bodies.Enceladus
hapsira.bodies.Titan
hapsira.bodies.Titania
hapsira.bodies.Triton
hapsira.bodies.Charon