Stellarium | Planets | Metadata | Celestial body |
---|---|---|---|
Xcode 14, iOS 16 is required. This app is built with Swift Package Manager, open Graviton.xcodeproj
.
The work is primarily done in the year of 2017 and 2018. It is frozen as of Jul 2023.
Two websites are planned to be built. One includes all documentation, the other is a shiny front page for maximum appeal.
This project is a monorepo that also contains multiple useful frameworks. See below section.
Outdated
This is an amateurish project by an amateur astronomer. As a lover of science and space exploration, there are a few long-term goals:
This project is licensed under GPLv3. If you have issues with any assets or resources in Graviton, please don't hesitate to reach out DJBen.
High accuracy ephemeris query and orbital mechanics calculation framework.
Conics model predicts the orbits of the major planets in our solar system pretty accurately. To account for apsidal precession and other orbital perturbations of celestial bodies like Mercury and Earth's moon, Orbits fetches many data points from JPL and cherry-pick the orbital configuration closest to the reference time.
StarryNight is all you need for curiosity towards stars and constellations.
Star.magitudeLessThan(7)
Star.hr(9077)
Star.hd(224750)
Star.hip(25)
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
Constellation.iau("Tau")
Constellation.named("Orion")
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
// 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.
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.
Equatorial to horizontal coordinate:
// Supply observer location and timestamp
let locTime = ObserverLocationTime(location: location, timestamp: JulianDay.now)
let vegaCoord = EquatorialCoordinate(rightAscension: radians(hours: 18, minutes: 36, seconds: 56.33635), declination: radians(degrees: 38, minutes: 47, seconds: 1.2802), distance: 1)
// Azimuth and altitude of Vega
let vegaAziAlt = HorizontalCoordinate.init(equatorialCoordinate: vegaCoord, observerInfo: locTime)
Ecliptic coordinate of Pollux at standard equinox of J2000.0.
let ra = DegreeAngle(116.328942)
let dec = DegreeAngle(28.026183)
let eclipticCoord = EclipticCoordinate(longitude: ra, latitude: dec, distance: 1, julianDay: .J2000)
eclipticCoord.longitude.wrappedValue // 113.21563
eclipticCoord.latitude.wrappedValue // 6.68417
Greenwich Mean Sidereal Time:
SiderealTime.init(julianDay: JulianDay.now)
Local Apparent Sidereal Time:
// Get location from GPS or hard code
let locTime = ObserverLocationTime(location: location, timestamp: JulianDay.now)
let localSidTime = SiderealTime.init(observerLocationTime: locTime)
More use cases can be found in the source and test cases.
A startracker is included to obtain precise alignment to the stars when viewing at night. To compile the app/run tests, you will first need to download the image files from: https://drive.google.com/drive/folders/1aB7_yC7U4iHJOtRk4fT2sOnFLDsacUH5?usp=sharing. The directories in the drive correspond to directories in this repo. Place the files into the corresponding repo directory.
To further develop/test the startracker, there are two methods:
py/README.md
)Both types of images can be converted into unit tests on the Swift side.
The following are differrent coordinate systems used throughout the codebase. A transformation
between two coordinate systems is denoted T_{space_to}_{space_from}
.
Ceq (Catalog Equatorial)
Cc (Catalog Camera)
Cc
system refers to a hypothetical camera placed at the same origin/orientation
as the Ceq
system, but using camera conventions.Meq (Mobile Equatorial)
Mc (Mobile Camera)