An uncluttered, minimal and clean display of commonly used every-day astronomical data about the moon, sun, earth and the computer's location.
Demo picture:
User interaction on the TUI:
ufor updating the data.qfor quitting the program.
List of features
- show commonly needed astronomical data at one glance.
- local calculations (except location of computer which uses web request).
This is an early version, the web requests are not buffered yet. Executing the program or the tests too often will probably lead to being denied further requests. See the section on usage limits on ip-api.com/legal .
List of things to do
- fixes.
- the sunrise time seems to be 2h too early (is it UTC?).
- NOTE: whereas the sunset time seems to be the correct local time.
- TODO: create some test cases.
- buffer TUI key presses (for the toggle keys).
- buffer web retrieved lat+lon data as a text file somewhere.
- buffer calculation of astronomical data (eg. lat+lon of moon+sun).
- display sunrise and sunset time in the local timezone (not UTC).
- the sunrise time seems to be 2h too early (is it UTC?).
- data in display updates on interval.
- provide an option for an update interval of all displayed data.
- refine tests and explicitly test data of:
-
● lat+lon. -
● phase: Waning Gibbous (◐) -
● age: 19.76 days -
● dist.: 371578 km -
● illum.: 74% -
● new in: 10.6 days -
● full in: 25.2 days -
● new on: 2001-01-11, Thu -
● full on: 2001-01-26, Fri -
▣ zone: Europe/Berlin -
▣ offset: UTC+2 (CEST)
-
- reduce dependencies.
List of things done
- sun and moon location (lat+lon) seem delayed. Either visual bug or wrong calculation. Create some tests.
- sunrise and sunset time is not accurate (1 or 2 hours off), match the local time in the timezone.
- refine tests and explicitly test data of:
-
☼ lat+lon. -
☼ rise: 01:10 h -
☼ set: 13:17 h
-
- rename project to globe, not geo (bc of https://pkg.go.dev/github.com/golang/geo)
- make sure every data in the display is read in automatically.
- add time zone detection.
- find out user's time zone code, eg 'GMT'.
- find out user's utc shift for his time zone.
- find existing go package for timezone conversion (and maybe detection).
- make a unified, somewhat pretty display for all data.
- in geocalc: convert local time of user to UTC.
- in geocalc: conversion function from location+time to timezone (default to system timezone).
- visualizations.
- visualization of lat+lon (eg user location).
- visualization of moon position with longitude.
- visualization of sun position with longitude.
- pull out TUI world map into its own package (within the globe project), eg name the package
geomap. - find out where user is located (ask system).
- find web for lat+lon (ask web).
- pretty print earth.
- calculate today's hours of sunrise and sunset.
- calculate current phase of moon.
Install the program:
go install github.com/kraasch/globe@latestGet the package:
go get github.com/kraasch/globeUse the program:
make build
./build/globe --helpUse the package:
import (
globe "github.com/kraasch/globe"
)
var geoData globe.GeoData
geoData.PrintDataHorizontally()Some inspiring images for future development of this project:
I can be reached via alex@kraasch.eu.
Feel free to help me.
Uses the following software:
Made by the following people:
- see Github info.
Geographic Coordinate System Data: Longitude and latitude. Use: Stable reference on earth, navigating earth's surface, i.e. use of GPS or Google maps.
Ecliptic Coordinate System Data: Ecliptic longitude and ecliptic latitude. Use: Stable reference frame for sun and its planets, same for all observers on earth.
Horizontal Coordinate System Data: Altitude (angle of an observed object), Azimuth (direction of the object along the horizon). Use: References observed objects in the night sky, local to observer, changes during night with earth's rotation.
Equatorial Coordinate System Data: Declination (how far north or south a celestial object is from the celestial equator), Right Ascension (hours, minutes and seconds along the celestial equator from a reference point called vernal equinox). Use: Reference system fixed with respect to distant stars, slowly changing over long periods of time.
For certain data there cannot be any meaningful tests, for example:
- tests not possible.
-
▣ lat+lon: 53.48, 10.22 -
🜃 utc: 10:52 h -
▣ time: 12:52 h
-
Used packages:
- for sunrise and sunset: https://github.com/nathan-osman/go-sunrise
- for moon phases: https://github.com/janczer/goMoonPhase
- for lon+lat to timezone conversion: https://github.com/evanoberholster/timezoneLookup
- for timzeones: https://github.com/ringsaturn/tzf.
Other useful packages:
- all kinds of astronomical algorithms: https://github.com/observerly
- might contain sun position algorithm: https://github.com/observerly/sidera
- for sun and moon position, dependent on the observer's location on earth: https://github.com/hablullah/go-sampa
- NOTE: this package can calculate location-dependent sunrise and sunset.
- can provide the sun's position (latitude and longitude): https://github.com/sj14/astral
Other useful resources:
- more symbols: https://en.wikipedia.org/wiki/Geometric_Shapes_(Unicode_block)
- good info on calculating sun's position: https://observablehq.com/@danleesmith/meeus-solar-position-calculations
- info and implementation of some known algorithms: https://pkg.go.dev/github.com/soniakeys/meeus/v3
- gist with usage example of soniakeys/meeus: https://gist.github.com/soniakeys/b066347d58a59ac6f3b4
- info about different coordinate systems: https://pkg.go.dev/github.com/observerly/sidera@v0.7.0/pkg/coordinates
- info on side real time: https://astro.dur.ac.uk/~ams/users/lst.html
- calculator for sub-solar point from NASA: https://wgc.jpl.nasa.gov:8443/webgeocalc/#SubSolarPoint
- web tool for visualization of sun and earth related data: https://www.sunearthtools.com/dp/tools/pos_sun.php?lang=en
View the license file.
