Skip to content

Planet

starplot.Planet dataclass

Planet model.

ra instance-attribute

ra: float

Right Ascension, in degrees (0 to 360)

dec instance-attribute

dec: float

Declination, in degrees (-90 to 90)

constellation_id class-attribute instance-attribute

constellation_id: str | None = None

Three-letter IAU id of the constellation that contains this object

healpix_index class-attribute instance-attribute

healpix_index: int = None

HEALPix pixel index of this object's RA/DEC

name class-attribute instance-attribute

name: str = None

Name of the planet:

  • Mercury
  • Venus
  • Mars
  • Jupiter
  • Saturn
  • Uranus
  • Neptune
  • Pluto

dt class-attribute instance-attribute

dt: datetime = None

Date/time of planet's position

apparent_size class-attribute instance-attribute

apparent_size: float = 0

Apparent diameter (degrees)

geometry class-attribute instance-attribute

geometry: Polygon = None

Shapely Polygon of the planet's extent. Right ascension coordinates are in degrees (0...360).

create_optic

create_optic(*args, **kwargs)

Creates an optic plot with this object at the center

Parameters:

Name Type Description Default
*args

args passed through to OpticPlot()

()
**kwargs

kwargs passed through to OpticPlot()

{}

Returns:

Name Type Description
OpticPlot

new instance of a OpticPlot

create_map

create_map(height_degrees: float, width_degrees: float, *args, **kwargs)

Creates a map plot with this object at the center

Parameters:

Name Type Description Default
height_degrees float

Height of the map (degrees)

required
width_degrees float

Width of the map (degrees)

required
*args

args passed through to MapPlot()

()
**kwargs

kwargs passed through to MapPlot()

{}

Returns:

Name Type Description
MapPlot

new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object, or None if no constellation is found.

populate_constellation_id

populate_constellation_id()

Populates the constellation_id field based on the location of this object

all classmethod

all(
    observer: Observer = None, ephemeris: str = "de440s.bsp"
) -> Iterator[Planet]

Iterator for getting all planets at a specific date/time and observing location.

Parameters:

Name Type Description Default
observer Observer

Observer instance that specifies a time and location

None
ephemeris str

Ephemeris to use for calculating planet positions (see Skyfield's documentation for details)

'de440s.bsp'

get classmethod

get(
    name: str, observer: Observer = None, ephemeris: str = "de440s.bsp"
) -> Planet

Get a planet for a specific date/time.

Parameters:

Name Type Description Default
name str

Name of the planet you want to get (see Planet.name for options). Case insensitive.

required
observer Observer

Observer instance that specifies a time and location

None
ephemeris str

Ephemeris to use for calculating planet positions (see Skyfield's documentation for details)

'de440s.bsp'