geo

module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2025 License: MIT

README

geo

An uncluttered, minimal and clean display of commonly used every-day astronomical data about the moon, sun, earth and the computer's location.

Demo and Basic Info

Demo picture:

User interaction on the TUI:

  • u for updating the data.
  • q for quitting the program.

Features

List of features

  • show commonly needed astronomical data at one glance.
  • local calculations (except location of computer which uses web request).

Usage Limits

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 .

Tasks

List of things to do

  • fixes.
    • buffer calculation of astronomical data (eg. lat+lon of moon+sun).
    • buffer TUI key presses (for the toggle keys).
    • buffer web retrieved lat+lon data as a text file somewhere.
    • sunrise and sunset time is not accurate (1 or 2 hours off), match the local time in the timezone.
    • sun and moon location (lat+lon) seem delayed. Either visual bug or wrong calculation. Create some tests.
  • 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: 53.48, 10.22
    • ▣ zone: Europe/Berlin
    • ▣ offset: UTC+2 (CEST)
    • ▣ time: 12:52 h
    • 🜃 utc: 10:52 h
    • ☼ rise: 01:10 h
    • ☼ set: 13:17 h
    • ☼ 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
    • ● lat+lon.

List of things done

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

Installation

Install the program:

go install github.com/kraasch/geo@latest

Get the package:

go get github.com/kraasch/geo

In-Code Usage

Use the program:

make build
./build/geo --help

Use the package:

import (
  geo "github.com/kraasch/geo"
)
var geoData geo.GeoData
geoData.PrintDataHorizontally()

Future Inspiration

Some inspiring images for future development of this project:

Feedback

I can be reached via alex@kraasch.eu.

Contributing

Feel free to help me.

Acknowledgments

Uses the following software:

Made by the following people:

  • see Github info.

Mini Astronomical Primer

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.

Misc Info

Used packages:

Other useful packages:

Other useful resources:

License

View the license file.

Directories

Path Synopsis
pkg
geocalc
Package geocalc does the main under-the-hood calculations.
Package geocalc does the main under-the-hood calculations.
geomap
Package geomap is is used to show an ASCII world map on the CLI.
Package geomap is is used to show an ASCII world map on the CLI.
geoview
Package geoview is used to nicely print information calculated or retreiveed from geocalc and geoauto.
Package geoview is used to nicely print information calculated or retreiveed from geocalc and geoauto.
geoweb
Package geoweb can get the location or time zone of a user machine from the web.
Package geoweb can get the location or time zone of a user machine from the web.
testutil
Package testutil helps in the tests in this projects.
Package testutil helps in the tests in this projects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL