Skip to content

Models

Starplot has models to represent an observer and some of the objects you can plot, including stars, DSOs, planets, the Sun, and the Moon. These models are used for many things in Starplot:

  • Defining an observing time and location
  • Selecting objects to plot (via the where kwarg) (see docs)
  • Creating callables to calculate size/color/alpha values (see docs)
  • Keeping track of plotted objects (via ObjectList)
  • Getting the position of an object at a specific time (via get())
  • Getting a list of objects that meet a series of conditions (via find())

starplot.Observer

Represents an observer at a specific time and place.

Example:

obs = Observer(
    dt=datetime(2025, 10, 13, 21, 0, 0, tzinfo=ZoneInfo('US/Pacific')),
    lat=33.363484,
    lon=-116.836394,
)

dt class-attribute instance-attribute

dt: AwareDatetime = Field(default_factory=lambda: now(utc))

Date and time of observation (must be timezone-aware).

Defaults to current time in UTC.

lat class-attribute instance-attribute

lat: float = Field(default=0, ge=-90, le=90)

Latitude of observer location

lon class-attribute instance-attribute

lon: float = Field(default=0, ge=-180, le=180)

Longitude of observer location

lst cached property

lst: float

Read-only Property

Local sidereal time (in degrees)

timescale cached property

timescale: Timescale

Read-only Property

Timescale instance of the specified datetime (used by Skyfield)

Sky Objects

starplot.Star

Star 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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

magnitude instance-attribute

magnitude: float

Magnitude

bv class-attribute instance-attribute

bv: Optional[float] = None

B-V Color Index, if available

hip class-attribute instance-attribute

hip: Optional[int] = None

Hipparcos Catalog ID, if available

tyc class-attribute instance-attribute

tyc: Optional[str] = None

Tycho ID, if available

ccdm class-attribute instance-attribute

ccdm: Optional[str] = None

CCDM Component Identifier (if applicable)

name class-attribute instance-attribute

name: Optional[str] = None

Name, if available

bayer class-attribute instance-attribute

bayer: Optional[str] = None

Bayer designation, if available

flamsteed class-attribute instance-attribute

flamsteed: Optional[int] = None

Flamsteed number, if available

geometry class-attribute instance-attribute

geometry: ShapelyPoint = None

Shapely Point of the star'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:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object

get classmethod

get(
    catalog: StarCatalog = BIG_SKY_MAG11, sql: str = None, **kwargs
) -> Union[Star, None]

Get a Star, by matching its attributes as specified in **kwargs

Example:

sirius = Star.get(name="Sirius")

Parameters:

  • catalog (StarCatalog, default: BIG_SKY_MAG11 ) –

    The catalog of stars to use: "big-sky-mag11", or "big-sky" -- see StarCatalog for details

  • sql (str, default: None ) –

    SQL query for selecting star (table name is "_")

  • **kwargs

    Attributes on the star you want to match

Raises: ValueError if more than one star is matched

Returns:

  • Union[Star, None]

    Star instance if there's exactly one match or None if there are zero matches

find classmethod

find(
    where: list = None, sql: str = None, catalog: StarCatalog = BIG_SKY_MAG11
) -> list[Star]

Find Stars

Parameters:

  • where (list, default: None ) –

    A list of expressions that determine which stars to find. See Selecting Objects for details.

  • sql (str, default: None ) –

    SQL query for selecting stars (table name is "_")

  • catalog (StarCatalog, default: BIG_SKY_MAG11 ) –

    The catalog of stars to use: "big-sky-mag11", or "big-sky" -- see StarCatalog for details

Returns:

  • list[Star]

    List of Stars that match all where expressions

get_label classmethod

get_label(star) -> str

Default function for determining the plotted label for a Star.

Returns:

  • str

    The star's name

starplot.Constellation

Constellation 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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

iau_id class-attribute instance-attribute

iau_id: str = None

International Astronomical Union (IAU) three-letter designation, all lowercase.

Important: Starplot treats Serpens as two separate constellations to make them easier to work with programatically. Serpens Caput has the iau_id of ser1 and Serpens Cauda is ser2

name class-attribute instance-attribute

name: str = None

Name of constellation

star_hip_ids class-attribute instance-attribute

star_hip_ids: list[int] = None

List of HIP ids for stars that are part of the lines for this constellation.

boundary class-attribute instance-attribute

boundary: ShapelyPolygon | ShapelyMultiPolygon = None

Shapely Polygon of the constellation's boundary. 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:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

get classmethod

get(sql: str = None, **kwargs) -> Constellation

Get a Constellation, by matching its attributes.

Example:

hercules = Constellation.get(name="Hercules")

Parameters:

  • sql (str, default: None ) –

    SQL query for selecting constellation (table name is "_")

  • **kwargs

    Attributes on the constellation you want to match

Raises: ValueError if more than one constellation is matched

find classmethod

find(where: list = None, sql: str = None) -> list[Constellation]

Find Constellations

Parameters:

  • where (list, default: None ) –

    A list of expressions that determine which constellations to find. See Selecting Objects for details.

  • sql (str, default: None ) –

    SQL query for selecting constellations (table name is "_")

Returns:

  • list[Constellation]

    List of Constellations that match all where expressions

constellation

constellation()

Not applicable to Constellation model, raises NotImplementedError

get_label classmethod

get_label(constellation)

Default function for determining the plotted label for a constellation

Returns the uppercase name of the constellation.

starplot.DSO

Deep Sky Object (DSO) model. An instance of this model is passed to any callables you define when plotting DSOs. So, you can use any attributes of this model in your callables. Note that some may be null.

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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

name instance-attribute

name: str

Name of the DSO (as specified in OpenNGC)

type instance-attribute

type: DsoType

Type of DSO

common_names class-attribute instance-attribute

common_names: list[str] = None

List of common names for the DSO (e.g. 'Andromeda Galaxy' for M31)

Note: this field is parsed into a list of strings after querying DSOs, so if you want to query on this field, you should treat it as a comma-separated list.

magnitude class-attribute instance-attribute

magnitude: Optional[float] = None

Magnitude (if available)

maj_ax class-attribute instance-attribute

maj_ax: Optional[float] = None

Major axis of the DSO, in arcmin (if available)

min_ax class-attribute instance-attribute

min_ax: Optional[float] = None

Minor axis of the DSO, in arcmin (if available)

angle class-attribute instance-attribute

angle: Optional[float] = None

Angle of the DSO, in degrees (if available)

size class-attribute instance-attribute

size: Optional[float] = None

Size of the DSO calculated as the area of the minimum bounding rectangle of the DSO, in degrees squared (if available)

m class-attribute instance-attribute

m: Optional[str] = None

Messier number. Note that this field is a string, to be consistent with the other identifier fields (ngc and ic).

ngc class-attribute instance-attribute

ngc: Optional[str] = None

New General Catalogue (NGC) identifier. Note that this field is a string, to support objects like '3537 NED01'.

ic class-attribute instance-attribute

ic: Optional[str] = None

Index Catalogue (IC) identifier. Note that this field is a string, to support objects like '4974 NED01'.

geometry class-attribute instance-attribute

geometry: ShapelyPolygon | ShapelyMultiPolygon = None

Shapely Polygon of the DSO'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:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object

get classmethod

get(sql: str = None, **kwargs) -> DSO

Get a DSO, by matching its attributes.

Example:

d = DSO.get(m=13)

Parameters:

  • sql (str, default: None ) –

    SQL query for selecting DSO (table name is "_")

  • **kwargs

    Attributes on the DSO you want to match

Raises: ValueError if more than one DSO is matched

find classmethod

find(where: list = None, sql: str = None) -> list[DSO]

Find DSOs

Parameters:

  • where (list, default: None ) –

    A list of expressions that determine which DSOs to find. See Selecting Objects for details.

  • sql (str, default: None ) –

    SQL query for selecting DSOs (table name is "_")

Returns:

  • list[DSO]

    List of DSOs that match all where expressions

get_label classmethod

get_label(dso) -> str

Default function for determining the plotted label for a DSO.

Returns:

  1. "M13" if DSO is a Messier object
  2. "6456" if DSO is an NGC object
  3. "IC1920" if DSO is an IC object
  4. Empty string otherwise

starplot.models.dso.DsoType

Type of deep sky object (DSO), as designated in OpenNGC

ASSOCIATION_OF_STARS class-attribute instance-attribute

ASSOCIATION_OF_STARS = '*Ass'

Association of stars

DARK_NEBULA class-attribute instance-attribute

DARK_NEBULA = 'DrkN'

Dark nebula

DOUBLE_STAR class-attribute instance-attribute

DOUBLE_STAR = '**'

Double star or multiple star system

DUPLICATE_RECORD class-attribute instance-attribute

DUPLICATE_RECORD = 'Dup'

Duplicate record of another object

EMISSION_NEBULA class-attribute instance-attribute

EMISSION_NEBULA = 'EmN'

Emission Nebula

GALAXY class-attribute instance-attribute

GALAXY = 'G'

Galaxy

GALAXY_PAIR class-attribute instance-attribute

GALAXY_PAIR = 'GPair'

Group of two galaxies

GALAXY_TRIPLET class-attribute instance-attribute

GALAXY_TRIPLET = 'GTrpl'

Group of three galaxies

GLOBULAR_CLUSTER class-attribute instance-attribute

GLOBULAR_CLUSTER = 'GCl'

Globular cluster of stars

GROUP_OF_GALAXIES class-attribute instance-attribute

GROUP_OF_GALAXIES = 'GGroup'

Group of more than three galaxies

HII_IONIZED_REGION class-attribute instance-attribute

HII_IONIZED_REGION = 'HII'

Hydrogen ionized region

NEBULA class-attribute instance-attribute

NEBULA = 'Neb'

Nebula

NONEXISTENT class-attribute instance-attribute

NONEXISTENT = 'NonEx'

Non-existant object

NOVA_STAR class-attribute instance-attribute

NOVA_STAR = 'Nova'

Nova star

OPEN_CLUSTER class-attribute instance-attribute

OPEN_CLUSTER = 'OCl'

Open cluster of stars

PLANETARY_NEBULA class-attribute instance-attribute

PLANETARY_NEBULA = 'PN'

Planetary nebula

REFLECTION_NEBULA class-attribute instance-attribute

REFLECTION_NEBULA = 'RfN'

Reflection nebula

STAR class-attribute instance-attribute

STAR = '*'

Star

STAR_CLUSTER_NEBULA class-attribute instance-attribute

STAR_CLUSTER_NEBULA = 'Cl+N'

Star cluster with nebulosity

SUPERNOVA_REMNANT class-attribute instance-attribute

SUPERNOVA_REMNANT = 'SNR'

Supernova remnant

UNKNOWN class-attribute instance-attribute

UNKNOWN = 'Other'

Unknown type of object

starplot.Planet

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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

name instance-attribute

name: str

Name of the planet:

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

dt instance-attribute

dt: datetime

Date/time of planet's position

apparent_size instance-attribute

apparent_size: float

Apparent size (degrees)

geometry class-attribute instance-attribute

geometry: ShapelyPolygon = 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:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object

all classmethod

all(
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
) -> Iterator[Planet]

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

Parameters:

  • dt (datetime, default: None ) –

    Datetime you want the planets for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the planet's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

get classmethod

get(
    name: str,
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
) -> Planet

Get a planet for a specific date/time.

Parameters:

  • name (str) –

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

  • dt (datetime, default: None ) –

    Datetime you want the planet for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the planet's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

starplot.Sun

Sun 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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

name class-attribute instance-attribute

name: str = 'Sun'

Name of the Sun

dt instance-attribute

dt: datetime

Date/time of Sun's position

apparent_size instance-attribute

apparent_size: float

Apparent size (degrees)

geometry class-attribute instance-attribute

geometry: ShapelyPolygon = None

Shapely Polygon of the Sun'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:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object

get classmethod

get(
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
) -> Sun

Get the Sun for a specific date/time and observing location.

Parameters:

  • dt (datetime, default: None ) –

    Datetime you want the Sun for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the Sun's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

starplot.Moon

Moon model. Only used for Earth's moon right now, but will potentially represent other planets' moons in future versions.

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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

name class-attribute instance-attribute

name: str = 'Moon'

Name of the moon

dt instance-attribute

dt: datetime

Date/time of moon's position

apparent_size instance-attribute

apparent_size: float

Apparent size in the sky (degrees)

phase_angle instance-attribute

phase_angle: float

Angle of the moon from the Sun (degrees)

phase_description instance-attribute

phase_description: str

Description of the moon's phase. The Moon will be considered New/Full/Quarter if it's within 12 hours of that precise phase.

illumination instance-attribute

illumination: float

Percent of illumination (0 to 1)

geometry class-attribute instance-attribute

geometry: ShapelyPolygon = None

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

create_optic

create_optic(*args, **kwargs)

Creates an optic plot with this object at the center

Parameters:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object

get classmethod

get(
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
) -> Moon

Get the Moon for a specific date/time and observing location.

Parameters:

  • dt (datetime, default: None ) –

    Datetime you want the moon for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the Moon's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

starplot.Comet

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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

name instance-attribute

name: str

Name of the comet (as designated by IAU Minor Planet Center)

dt instance-attribute

dt: datetime

Date/time of comet's position

lat class-attribute instance-attribute

lat: float | None = None

Latitude of observing location

lon class-attribute instance-attribute

lon: float | None = None

Longitude of observing location

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: ShapelyPoint = 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:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object

from_json classmethod

from_json(
    data: dict,
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
) -> Comet

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

Parameters:

  • data (dict) –

    Dictionary of the IAU MPC JSON

  • dt (datetime, default: None ) –

    Datetime you want the comet for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the comet's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

all classmethod

all(
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
    reload: bool = False,
) -> Iterator[Comet]

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

Parameters:

  • dt (datetime, default: None ) –

    Datetime you want the comets for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the comet's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

  • reload (bool, default: False ) –

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

get classmethod

get(
    name: str,
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
    reload: bool = False,
) -> Comet

Get a comet for a specific date/time.

Parameters:

  • name (str) –

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

  • dt (datetime, default: None ) –

    Datetime you want the comet for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the comet's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

  • reload (bool, default: False ) –

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

trajectory

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

Iterator for getting a trajectory of the comet.

Parameters:

  • date_start (datetime) –

    Starting date/time for the trajectory (inclusive)

  • date_end (datetime) –

    End date/time for the trajectory (exclusive)

  • step (timedelta, default: None ) –

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

Returns:

  • Iterator[Comet]

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

starplot.Satellite

Satellites can be created in two ways:

  1. from_tle (two-line element set)
  2. from_json (CelesTrak 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 property

constellation_id: str | None

Identifier of the constellation that contains this object. The ID is the three-letter (all lowercase) abbreviation from the International Astronomical Union (IAU).

name instance-attribute

name: str

Name of the satellite

dt instance-attribute

dt: datetime

Date/time of satellite's position

lat class-attribute instance-attribute

lat: float | None = None

Latitude of observing location

lon class-attribute instance-attribute

lon: float | None = None

Longitude of observing location

distance class-attribute instance-attribute

distance: float | None = None

Distance to satellite, 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: ShapelyPoint = None

Shapely Point of the satellite'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:

Returns:

create_map

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

Creates a map plot with this object at the center

Parameters:

  • height_degrees (float) –

    Height of the map (degrees)

  • width_degrees (float) –

    Width of the map (degrees)

  • *args

    args passed through to MapPlot()

  • **kwargs

    kwargs passed through to MapPlot()

Returns:

  • MapPlot

    new instance of a MapPlot

constellation

constellation()

Returns an instance of the Constellation that contains this object

from_json classmethod

from_json(
    data: dict,
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
) -> Satellite

Get a satellite for a specific date/time/location from a CelesTrak JSON.

Parameters:

  • data (dict) –

    Dictionary of the CelesTrak JSON

  • dt (datetime, default: None ) –

    Datetime you want the satellite for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the satellite's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

from_tle classmethod

from_tle(
    name: str,
    line1: str,
    line2: str,
    dt: datetime = None,
    lat: float = None,
    lon: float = None,
    ephemeris: str = "de421_2001.bsp",
) -> Satellite

Get a satellite for a specific date/time/location from a two-line element set (TLE).

Parameters:

  • name (str) –

    Name of the satellite

  • line1 (str) –

    Line 1 of the two-line element set (TLE)

  • line2 (str) –

    Line 2 of the two-line element set (TLE)

  • dt (datetime, default: None ) –

    Datetime you want the satellite for (must be timezone aware!). Defaults to current UTC time.

  • lat (float, default: None ) –

    Latitude of observing location. If you set this (and longitude), then the satellite's apparent RA/DEC will be calculated.

  • lon (float, default: None ) –

    Longitude of observing location

  • ephemeris (str, default: 'de421_2001.bsp' ) –

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

trajectory

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

Iterator for getting a trajectory of the satellite.

Parameters:

  • date_start (datetime) –

    Starting date/time for the trajectory (inclusive)

  • date_end (datetime) –

    End date/time for the trajectory (exclusive)

  • step (timedelta, default: None ) –

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

Returns:

  • Iterator[Satellite]

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

starplot.ObjectList

Lists of objects that have been plotted. An instance of this model is returned by a plot's objects property.

stars class-attribute instance-attribute

stars: list[Star] = []

Stars

constellations class-attribute instance-attribute

constellations: list[Constellation] = []

Constellations

dsos class-attribute instance-attribute

dsos: list[DSO] = []

Deep Sky Objects (DSOs)

planets class-attribute instance-attribute

planets: list[Planet] = []

Planets

moon class-attribute instance-attribute

moon: Moon = None

Moon

sun class-attribute instance-attribute

sun: Sun = None

Sun

Optics

starplot.models.Optic

Abstract class for defining Optics.

starplot.models.Binoculars

Creates a new Binoculars optic

Parameters:

  • magnification

    Magnification of the binoculars

  • fov

    Apparent field of view (FOV) of the binoculars in degrees. This isn't always easy to find for binoculars, so if you can't find it in your binocular's specs, then try using 60.

Returns:

  • Binoculars

    A new instance of a Binoculars optic

fov instance-attribute

fov: float

Apparent field of view of the binoculars

magnification instance-attribute

magnification: float

Magnification of the binoculars

true_fov property

true_fov: float

True field of view of binoculars

starplot.models.Scope

Creates a new generic Scope optic.

Use this class to create custom scope optics or use it as a generic optic that does NOT apply any transforms to the view.

See subclasses of this optic for more specific use cases:

  • Refractor - automatically inverts the view (i.e. assumes a star diagonal is used)

  • Reflector - automatically rotates the view so it's upside-down

Parameters:

  • focal_length

    Focal length (mm) of the telescope

  • eyepiece_focal_length

    Focal length (mm) of the eyepiece

  • eyepiece_fov

    Field of view (degrees) of the eyepiece

Returns:

  • Scope

    A new instance of a Scope optic

eyepiece_focal_length instance-attribute

eyepiece_focal_length: float

Focal length (mm) of the eyepiece

eyepiece_fov instance-attribute

eyepiece_fov: float

Field of view (degrees) of the eyepiece

focal_length instance-attribute

focal_length: float

Focal length (mm) of the telescope

magnification property

magnification: float

Magnification calculated from the telescope's focal length and eyepiece focal length

true_fov property

true_fov: float

True field of view of telescope

starplot.models.Refractor

Creates a new Refractor Telescope optic

Warning

This optic assumes a star diagonal is used, so it applies a transform that inverts the image.

If you don't want this transform applied, then use the generic Scope optic instead.

Parameters:

  • focal_length

    Focal length (mm) of the telescope

  • eyepiece_focal_length

    Focal length (mm) of the eyepiece

  • eyepiece_fov

    Field of view (degrees) of the eyepiece

Returns:

  • Refractor

    A new instance of a Refractor optic

eyepiece_focal_length instance-attribute

eyepiece_focal_length: float

Focal length (mm) of the eyepiece

eyepiece_fov instance-attribute

eyepiece_fov: float

Field of view (degrees) of the eyepiece

focal_length instance-attribute

focal_length: float

Focal length (mm) of the telescope

magnification property

magnification: float

Magnification calculated from the telescope's focal length and eyepiece focal length

true_fov property

true_fov: float

True field of view of telescope

starplot.models.Reflector

Creates a new Reflector Telescope optic

Warning

This optic applies a transform that produces an "upside-down" image.

If you don't want this transform applied, then use the generic Scope optic instead.

Parameters:

  • focal_length

    Focal length (mm) of the telescope

  • eyepiece_focal_length

    Focal length (mm) of the eyepiece

  • eyepiece_fov

    Field of view (degrees) of the eyepiece

Returns:

  • Reflector

    A new instance of a Reflector optic

eyepiece_focal_length instance-attribute

eyepiece_focal_length: float

Focal length (mm) of the eyepiece

eyepiece_fov instance-attribute

eyepiece_fov: float

Field of view (degrees) of the eyepiece

focal_length instance-attribute

focal_length: float

Focal length (mm) of the telescope

magnification property

magnification: float

Magnification calculated from the telescope's focal length and eyepiece focal length

true_fov property

true_fov: float

True field of view of telescope

starplot.models.Camera

Creates a new Camera optic

Note

Field of view for each dimension is calculated using the following formula:

TFOV = 2 * arctan( d / (2 * f) )

Where:

d = sensor size (height or width)

f = focal length of lens

Parameters:

  • sensor_height

    Height of camera sensor (mm)

  • sensor_width

    Width of camera sensor (mm)

  • lens_focal_length

    Focal length of camera lens (mm)

  • rotation

    Angle (degrees) to rotate camera, defaults to 0

Returns:

  • Camera

    A new instance of a Camera optic

lens_focal_length instance-attribute

lens_focal_length: float

Focal length (mm) of the camera's lens

rotation class-attribute instance-attribute

rotation: float = 0

Angle (degrees) to rotate the camera

sensor_height instance-attribute

sensor_height: float

Height (mm) of camera's sensor

sensor_width instance-attribute

sensor_width: float

Width (mm) of camera's sensor