Giter VIP home page Giter VIP logo

astral's Introduction

Astral

Action Go Report Card GoDoc

Calculations for the position of the sun and moon.

This is a Go port of the Python astral package.

The astral package provides the means to calculate the following times of the sun:

  • dawn
  • sunrise
  • noon
  • midnight
  • sunset
  • dusk
  • daylight
  • night
  • twilight
  • blue hour
  • golden hour
  • rahukaalam TODO

plus solar azimuth and elevation at a specific latitude/longitude. It can also calculate the moon phase for a specific date.

CLI

Besides the package for usage in you own programs, we also provide a tool for showing the data.

screenshot

Installation

Homebrew

brew install sj14/tap/astral

Manually

go get -u github.com/sj14/astral/cmd/astral

Usage

Usage of astral:
  -elev float
        elevation of the observer
  -lat float
        latitude of the observer
  -long float
        longitude of the observer
  -time string
        day/time used for the calculation (defaults to current time)

Example

$ astral -lat 51.58 -long 6.52
Date/Time	Fri Apr 30 21:12:11 CEST 2021
Latitude	51.58
Longitude	6.52
Elevation	0

Daylight	14h48m11s
Night-Time	9h9m55s
Moon Phase	Full Moon (17.611222222222224)

Apr 30 03:39 (-17:32)   Dawn (Astronomical)
Apr 30 04:39 (-16:32)   Dawn (Nautical)
Apr 30 05:28 (-15:43)   Dawn (Civil)         Twilight Start    Blue Hour Start
Apr 30 05:43 (-15:28)   Golden Hour Start                      Blue Hour End
Apr 30 06:07 (-15:04)   Sunrise              Twilight End
Apr 30 06:53 (-14:18)   Golden Hour End
Apr 30 13:31 (-07:41)   Noon
Apr 30 20:09 (-01:02)   Golden Hour Start
Apr 30 20:55 (-00:16)   Sunset               Twilight Start
┈┈┈┈┈┈ 21:12 ┈┈┈┈┈┈┈┈   ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
Apr 30 21:19 (+00:07)   Golden Hour End                        Blue Hour Start
Apr 30 21:34 (+00:22)   Dusk (Civil)         Twilight End      Blue Hour End
Apr 30 22:24 (+01:12)   Dusk (Nautical)
Apr 30 23:25 (+02:13)   Dusk (Astronomical)
May  1 01:31 (+04:18)   Midnight

astral's People

Contributors

alton-campbell avatar bachp avatar dependabot[bot] avatar dotlambda avatar maljub01 avatar movermeyer avatar neilrickards avatar rezemika avatar sffjunkie avatar sj14 avatar wojciechpietruszewski-tomtom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mgumz

astral's Issues

no required module provides package

Hello,

I'm not sure why, but since few days (weeks?)
I can't get the package
could not import github.com/sj14/astral (no required module provides package "github.com/sj14/astral")
I tried to go clean and such, but still the same error.

Am I the only one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.