Constellation
starplot.Constellation
dataclass
Constellation model.
constellation_id
class-attribute
instance-attribute
Three-letter IAU id of the constellation that contains this object
healpix_index
class-attribute
instance-attribute
HEALPix pixel index of this object's RA/DEC
pk
instance-attribute
Primary key of object in catalog. Needs to be unique across all objects in the catalog.
boundary
instance-attribute
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
List of HIP ids for stars that are part of the lines for this constellation.
star_hip_lines
instance-attribute
Nested list of star HIP ids that represent the lines of this constellation. Each pair of HIP ids represents a line between those stars.
iau_id
class-attribute
instance-attribute
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
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
Creates an optic plot with this object at the center
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
args passed through to |
()
|
|
**kwargs
|
kwargs passed through to |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
OpticPlot |
new instance of a |
create_map
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 |
()
|
|
**kwargs
|
kwargs passed through to |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
MapPlot |
new instance of a |
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 |