Skip to content

Star and constellation query in Swift 4. 15000+ stars within 7th magnitude (can be extended). Star Catalogs including HR, HD, HIP, Gould and Bayer-Flamsteed designations.

Notifications You must be signed in to change notification settings

DJBen/StarryNight

Repository files navigation

Header image

StarryNight

Language License: GPL v3 Carthage compatible Build Status

Overview

StarryNight is all you need for curiosity towards stars and constellations.

  • Database of 15000+ stars within 7th magnitude.
    • Star Catalogs including HR, HD, HIP, Gould and Bayer-Flamsteed designations.
    • Celestial coordinate and proper motion.
    • Visual and absolute magnitude, luminance, spectral type, binary star info, and other physical properties.
  • Extended Constellation support.
    • Position query and inverse position query.
    • Constellation line and constellation border.
    • Abbreviation, genitive and etymology.

Installation

Carthage

github "DJBen/StarryNight" ~> 0.3.0

Usage

Stars

  1. All stars brighter than...
Star.magitudeLessThan(7)
  1. Star with specific designation.
Star.hr(9077)
Star.hd(224750)
Star.hip(25)
  1. Star closest to specific celestial coordinate.

This is very useful to locate the closest star to user input.

let coord = Vector3.init(equatorialCoordinate: EquatorialCoordinate.init(rightAscension: radians(hours: 5, minutes: 20), declination: radians(degrees: 10), distance: 1)).normalized()
Star.closest(to: coord, maximumMagnitude: 2.5)
// Bellatrix

Constellations

  1. Constellation with name or IAU symbol.
Constellation.iau("Tau")
Constellation.named("Orion")
  1. Constellation that contains specific celestial coordinate.

This is very useful to locate the constellation that contains the region of user input.

It is implemented as a category on EquatorialCoordinate. See SpaceTime repo for implementation and usage of coordinate classes.

let coord = EquatorialCoordinate.init(rightAscension: 1.547, declination: 0.129, distance: 1)
coord.constellation
// Orion
  1. Neighboring constellations and centers.
// Get a set of neighboring constellations
Constellation.iau("Ori").neighbors
// Get the coordinate of center(s) of current constellation
Constellation.iau("Ori").displayCenters

Note: displayCenters returns an array of one element for all constellations except Serpens, which will include two elements - one center for Serpens Caput and the other for Serpens Cauda.

Remarks

Data extracted from HYG database and processed into SQLite. The star catalog has been trimmed to 7th magnitude to reduce file size. Feel free to download the full catalog and import into SQLite whenever you see fit.

About

Star and constellation query in Swift 4. 15000+ stars within 7th magnitude (can be extended). Star Catalogs including HR, HD, HIP, Gould and Bayer-Flamsteed designations.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published