Skip to content

Sun

starplot.Sun dataclass

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 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 = 'Sun'

Name of the Sun

dt class-attribute instance-attribute

dt: datetime = None

Date/time of Sun's position

apparent_size class-attribute instance-attribute

apparent_size: float = 0

Apparent diameter (degrees)

geometry class-attribute instance-attribute

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

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

get classmethod

get(observer: Observer = None, ephemeris: str = 'de440s.bsp') -> Sun

Get the Sun for 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 Sun/moon/planet positions (see Skyfield's documentation for details)

'de440s.bsp'