Skip to content

DSO

starplot.DSO dataclass

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

geometry instance-attribute

geometry: Polygon | MultiPolygon

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

name class-attribute instance-attribute

name: str = None

Name of the DSO (as specified in OpenNGC)

type class-attribute instance-attribute

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: float | None = None

Magnitude (if available)

maj_ax class-attribute instance-attribute

maj_ax: float | None = None

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

min_ax class-attribute instance-attribute

min_ax: float | None = None

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

angle class-attribute instance-attribute

angle: float | None = None

Angle of the DSO, in degrees (if available)

size class-attribute instance-attribute

size: float | None = 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: str | None = 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: str | None = 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: str | None = None

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

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

all classmethod

all(catalog: Catalog = OPEN_NGC) -> Iterator[DSO]

Get all DSOs from a catalog

Parameters:

Name Type Description Default
catalog Catalog

Catalog you want to get DSO objects from

OPEN_NGC

Returns:

Type Description
Iterator[DSO]

Iterator of DSO instances

get classmethod

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

Get a DSO, by matching its attributes.

Example:

d = DSO.get(m=13)

Parameters:

Name Type Description Default
catalog Catalog

Catalog you want to search

OPEN_NGC
sql str | None

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

None
**kwargs

Attributes on the DSO you want to match

{}

Raises: ValueError if more than one DSO is matched

find classmethod

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

Find DSOs

Parameters:

Name Type Description Default
catalog Catalog

Catalog you want to search

OPEN_NGC
where list | None

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

None
sql str | None

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

None

Returns:

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