All Projects → kelvins → sunrisesunset

kelvins / sunrisesunset

Licence: MIT license
🌅 Go package that provides the sunrise and sunset equation

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to sunrisesunset

Solar-Calculator
Calculates the sunrise and sunset for a given date and location (using GEO coordinates). This library uses the method outlined NOAA Solar Calculations Day spreadsheet found at http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.
Stars: ✭ 36 (-52%)
Mutual labels:  sunrise, sunset
astral
☀️ Go calculations for the position of the sun and moon.
Stars: ✭ 23 (-69.33%)
Mutual labels:  sunrise, sunset
KosherCocoa
My Objective-C port of KosherJava. KosherCocoa enables you to perform sunrise-based and sunset-based calculations for Jewish prayer and calendar.
Stars: ✭ 49 (-34.67%)
Mutual labels:  sunrise, sunset
astro
自用天文算法,公历农历转换、八大行星位置、日出日落月出月落时间、节气物候时间等
Stars: ✭ 33 (-56%)
Mutual labels:  sunrise, sunset
go-sunrise
Go package for calculating the sunrise and sunset times for a given location
Stars: ✭ 42 (-44%)
Mutual labels:  sunrise, sunset
Daylight-Calendar-ICS
Daylight Calendar is a dynamically generated .ics calendar that you can host and subscribe to in Google Calendar, iCal, or other calendar software.
Stars: ✭ 22 (-70.67%)
Mutual labels:  sunrise, sunset
rust-sun
A Rust library for calculating sun positions
Stars: ✭ 31 (-58.67%)
Mutual labels:  sunrise, sunset
sun
Simple library and application that shows sunset and sunrise based on your latitude,longitude
Stars: ✭ 23 (-69.33%)
Mutual labels:  sunrise, sunset
Sunscreen
🌅 A macOS app that sets your wallpaper based on sunrise and sunset.
Stars: ✭ 52 (-30.67%)
Mutual labels:  sunrise, sunset
suncalc-py
A Python port of suncalc.js for calculating sun position and sunlight phases
Stars: ✭ 31 (-58.67%)
Mutual labels:  sunrise, sunset
sunrise-electron-vue
SunRise项目-前端 sunrise-electron-vue。该项目是一个后台前端解决方案,它基于 vue.js 开发堆栈和 electron 并使用 element-ui 实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。
Stars: ✭ 48 (-36%)
Mutual labels:  sunrise
mobileid
Mobile ID Sample Scripts
Stars: ✭ 13 (-82.67%)
Mutual labels:  sunrise
sunraster
A SunPy-affiliated package which provides tools to analyze data from spectral data from any solar mission.
Stars: ✭ 19 (-74.67%)
Mutual labels:  sunrise
homebridge-eosstb
A homebridge plugin for the EOS set-top box as used by Sunrise, Telenet, Ziggo, Magenta, Virgin Media and maybe more in various countries on the Horizon Go (HGO) platform
Stars: ✭ 25 (-66.67%)
Mutual labels:  sunrise
kirby3-suncyclepages
kirby3 plugin to embargo pages until sunrise date and withdraw at sunset date
Stars: ✭ 17 (-77.33%)
Mutual labels:  sunset

Sunrise Sunset Package

License: MIT Build Status Coverage Status Go Report Card

Go package used to calculate the apparent sunrise and sunset times based on latitude, longitude, date and UTC offset.

You can use go get command:

go get github.com/kelvins/sunrisesunset

General

This package was created based on the Corrected Sunrise, Sunset, Noon Times in Seconds - and Solar Angles Matlab function developed by Richard Droste, that was created based on the spreadsheets available in the Earth System Research Laboratory website from the National Oceanic & Atmospheric Administration (NOAA).

Based on the Solar Calculation Details:

The calculations in the NOAA Sunrise/Sunset and Solar Position Calculators are based on equations from Astronomical Algorithms, by Jean Meeus. The sunrise and sunset results are theoretically accurate to within a minute for locations between +/- 72° latitude, and within 10 minutes outside of those latitudes. However, due to variations in atmospheric composition, temperature, pressure and conditions, observed values may vary from calculations.

Apparent Sunrise/Sunset:

Due to atmospheric refraction, sunrise occurs shortly before the sun crosses above the horizon. Light from the sun is bent, or refracted, as it enters earth's atmosphere. See Apparent Sunrise Figure. This effect causes the apparent sunrise to be earlier than the actual sunrise. Similarly, apparent sunset occurs slightly later than actual sunset. The sunrise and sunset times reported in our calculator have been corrected for the approximate effects of atmospheric refraction. However, it should be noted that due to changes in air pressure, relative humidity, and other quantities, we cannot predict the exact effects of atmospheric refraction on sunrise and sunset time. Also note that this possible error increases with higher (closer to the poles) latitudes.

Usage

package main

import (
    "fmt"
    "time"
    "github.com/kelvins/sunrisesunset"
)

func main() {
    // You can use the Parameters structure to set the parameters
    p := sunrisesunset.Parameters{
      Latitude:  -23.545570,
      Longitude: -46.704082,
      UtcOffset: -3.0,
      Date:      time.Date(2017, 3, 23, 0, 0, 0, 0, time.UTC),
    }

    // Calculate the sunrise and sunset times
    sunrise, sunset, err := p.GetSunriseSunset()

    // If no error has occurred, print the results
    if err == nil {
        fmt.Println("Sunrise:", sunrise.Format("15:04:05")) // Sunrise: 06:11:44
        fmt.Println("Sunset:", sunset.Format("15:04:05")) // Sunset: 18:14:27
    } else {
        fmt.Println(err)
    }
}

License

This project was created under the MIT license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].