def saturn(self) -> CelestialObject: return makeObject( ObjectType.PLANET, "Saturn", self._ephemerides["saturn barycenter"], symbol="\u2644", )
def mars(self) -> CelestialObject: return makeObject( ObjectType.PLANET, "Mars", self._ephemerides["mars barycenter"], symbol="\u2642", )
def jupiter(self) -> CelestialObject: return makeObject( ObjectType.PLANET, "Jupiter", self._ephemerides["jupiter barycenter"], symbol="\u2643", )
def neptune(self) -> CelestialObject: return makeObject( ObjectType.PLANET, "Neptune", self._ephemerides["neptune barycenter"], symbol="\u2646", )
def sun(self) -> CelestialObject: return makeObject( ObjectType.STAR, "The Sun", self._ephemerides["sun"], symbol="\u2609", )
def uranus(self) -> CelestialObject: return makeObject( ObjectType.PLANET, "Uranus", self._ephemerides["uranus barycenter"], symbol="\u2645", )
def pluto(self) -> CelestialObject: # Still in the JPL planet ephemerides! return makeObject( ObjectType.MINOR_PLANET, "Pluto", self._ephemerides["pluto barycenter"], symbol="\u2647", )
def comet(self, designation: str) -> CelestialObject: """Look up a comet by its designation, e.g. 1P/Halley""" # NB: mpc.comet_orbit returns an orbit centered on the Sun, so we need to offset it! row = self._comets.loc[designation] return makeObject( type=ObjectType.COMET, name=designation[designation.find("/") + 1:], position=self.sun.position + mpc.comet_orbit(row, self.timescale, GM_SUN), dataFrame=row, )
def minorPlanet(self, designation: str, symbol: Optional[str] = None) -> CelestialObject: """Look up a minor planet by its designation, e.g. (2060) Chiron""" data = self._minorPlanets.loc[designation] shortName = designation[designation.find(") ") + 2:] return makeObject( type=ObjectType.MINOR_PLANET, name=shortName, position=self.sun.position + mpc.mpcorb_orbit(data, self.timescale, GM_SUN), dataFrame=data, symbol=symbol, )
def star(self, ref: Union[str, int], culture: Optional[str] = None) -> CelestialObject: """Fetch a star by its name or Hipparcos catalogue number. Args: ref: Either the string common name, or the int catalogue number, e.g. 87937 for Barnard's Star. culture: If given, use as a hint to understand the common name. """ number = ref if isinstance(ref, int) else self.starNumber(ref) data = self._stars.loc[number] names = self._starNames.allNames(number) primaryName = (ref if isinstance(ref, str) else names["western"] if "western" in names else names["hip"]) star = Star.from_dataframe(data) return makeObject( type=ObjectType.STAR, name=primaryName, position=star, dataFrame=data, names=names, )
def earth(self) -> CelestialObject: return makeObject(ObjectType.PLANET, "Earth", self._ephemerides["earth"], symbol="\u2641")
def venus(self) -> CelestialObject: return makeObject(ObjectType.PLANET, "Venus", self._ephemerides["venus"], symbol="\u2640")
def mercury(self) -> CelestialObject: return makeObject(ObjectType.PLANET, "Mercury", self._ephemerides["mercury"], symbol="\u263f")
def moon(self) -> CelestialObject: return makeObject(ObjectType.MOON, "The Moon", self._ephemerides["moon"], symbol="\u263D")