Skip to content

Constellation

starplot.Constellation dataclass

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

pk instance-attribute

pk: int

Primary key of object in catalog. Needs to be unique across all objects in the catalog.

boundary instance-attribute

boundary: Polygon | MultiPolygon

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

If the constellation's boundary crosses the 0-meridian, then this will be a MultiPolygon split at the meridian.

star_hip_ids instance-attribute

star_hip_ids: list[int]

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

star_hip_lines instance-attribute

star_hip_lines: list[list[int, int]]

Nested list of star HIP ids that represent the lines of this constellation. Each pair of HIP ids represents a line between those stars.

name class-attribute instance-attribute

name: str = None

Name of constellation

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

border class-attribute instance-attribute

border: LineString = None

Shapely LineString of the constellation's border. Right ascension coordinates are in degrees (0...360).

Coordinates in this geometry may extend past RA=360, if the border crosses the 0-meridian. This makes it ready to plot with the line function.

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

populate_constellation_id

populate_constellation_id()

Populates the constellation_id field based on the location of this object

all classmethod

all(catalog: Catalog = CONSTELLATIONS_IAU) -> Iterator[Constellation]

Get all constellations from a catalog

Parameters:

Name Type Description Default
catalog Catalog

Catalog you want to get constellation objects from

CONSTELLATIONS_IAU

Returns:

Type Description
Iterator[Constellation]

Iterator of Constellation instances

get classmethod

get(
    catalog: Catalog = CONSTELLATIONS_IAU, sql: str | None = None, **kwargs
) -> Constellation

Get a Constellation, by matching its attributes.

Example:

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

Parameters:

Name Type Description Default
catalog Catalog

The catalog of constellations to use

CONSTELLATIONS_IAU
sql str | None

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

None
**kwargs

Attributes on the constellation you want to match

{}

Raises: ValueError if more than one constellation is matched

find classmethod

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

Find Constellations

Parameters:

Name Type Description Default
catalog Catalog

The catalog of constellations to use

CONSTELLATIONS_IAU
where list | None

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

None
sql str | None

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

None

Returns:

Type Description
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.