Skip to content

Comet

Comet data is retrieved from the IAU Minor Planet Center.

starplot.Comet dataclass

Comets can be created in three ways:

  1. get (designation/name)
  2. all (iterate through all comets available from MPC)
  3. from_json (IAU MPC JSON)

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 comet (as designated by IAU Minor Planet Center)

observer class-attribute instance-attribute

observer: Observer = None

Observer of this comet instance

distance class-attribute instance-attribute

distance: float | None = None

Distance to comet, in Astronomical units (the Earth-Sun distance of 149,597,870,700 m)

ephemeris class-attribute instance-attribute

ephemeris: str = None

Ephemeris used when retrieving this instance

geometry class-attribute instance-attribute

geometry: Point = None

Shapely Point of the comet's position. 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

from_json classmethod

from_json(
    data: dict, observer: Observer = None, ephemeris: str = "de440s.bsp"
) -> Comet

Get a comet for a specific date/time/location from an IAU MPC JSON.

Parameters:

Name Type Description Default
data dict

Dictionary of the IAU MPC JSON

required
observer Observer

Observer instance that specifies a time and location

None
ephemeris str

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

'de440s.bsp'

all classmethod

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

Iterator for getting all comets 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 comet positions (see Skyfield's documentation for details)

'de440s.bsp'
reload bool

If True, then the comet data file will be re-downloaded. Otherwise, it'll use the existing file if available.

False

get classmethod

get(
    name: str,
    observer: Observer = None,
    ephemeris: str = "de440s.bsp",
    reload: bool = False,
) -> Comet

Get a comet for a specific date/time.

Parameters:

Name Type Description Default
name str

Name of the comet you want to get (as designated by IAU Minor Planet Center)

required
observer Observer

Observer instance that specifies a time and location

None
ephemeris str

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

'de440s.bsp'
reload bool

If True, then the comet data file will be re-downloaded. Otherwise, it'll use the existing file if available.

False

trajectory

trajectory(
    date_start: datetime, date_end: datetime, step: timedelta | None = None
) -> Iterator[Comet]

Iterator for getting a trajectory of the comet.

Parameters:

Name Type Description Default
date_start datetime

Starting date/time for the trajectory (inclusive)

required
date_end datetime

End date/time for the trajectory (exclusive)

required
step timedelta | None

Time-step for the trajectory. Defaults to 1-day

None

Returns:

Type Description
Iterator[Comet]

Iterator that yields a Comet instance at each step in the date range