-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
120 changed files
with
1,918 additions
and
22,339 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Go | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
build: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch. | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.15' | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
- name: Build | ||
run: go build -v ./cmd/astral/ | ||
- name: Test | ||
run: go test -race ./... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ Simon Kennedy | |
Wojciech Pietruszeski | ||
Zachary Priddy | ||
Michael Marx | ||
Simon Jürgensmeyer |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Astral | ||
|
||
![Action](https://github.com/sj14/astral/workflows/Go/badge.svg) | ||
[![GoDoc](https://godoc.org/github.com/sj14/astral?status.png)](https://godoc.org/github.com/sj14/astral) | ||
|
||
Calculations for the position of the sun and moon. | ||
|
||
This is a Go port of the Python [astral](https://github.com/sffjunkie/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. | ||
|
||
### Installation | ||
|
||
```text | ||
go get github.com/sj14/astral/cmd/astral | ||
``` | ||
|
||
### Usage | ||
|
||
```text | ||
Usage of astral: | ||
-elev float | ||
elevation of the observer | ||
-format string | ||
time output format according to Go parsing (default "Jan _2 15:04:05") | ||
-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 | ||
|
||
```text | ||
$ astral -lat 51.58 -long 6.52 | ||
Sun Apr 18 11:12:45 CEST 2021 | ||
Latitude 51.58 Longitude 6.52 Elevation 0 | ||
Apr 18 05:55:07 Dawn | ||
Apr 18 05:55:07 Blue Hour Start | ||
Apr 18 06:09:04 Blue Hour End | ||
Apr 18 06:09:04 Golden Hour Start | ||
Apr 18 06:31:44 Sunrise | ||
Apr 18 07:15:56 Golden Hour End | ||
Apr 18 13:33:18 Noon | ||
Apr 18 19:51:24 Golden Hour Start | ||
Apr 18 20:35:45 Sunset | ||
Apr 18 20:58:33 Golden Hour End | ||
Apr 18 20:58:33 Blue Hour Start | ||
Apr 18 21:12:35 Blue Hour End | ||
Apr 18 21:12:35 Dusk | ||
Apr 19 01:33:13 Midnight | ||
Moon Phase: New Moon (5.47788888888889) | ||
``` |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.