suncalc

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: GPL-3.0, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const J0 = 0.0009

calculations for sun times

View Source
const J1970 = 2440588

J1970 ...

View Source
const J2000 = 2451545

J2000 ...

Variables

This section is empty.

Functions

func GetTimes

func GetTimes(date time.Time, lat float64, lng float64) map[DayTimeName]DayTime

calculates sun times for a given date and latitude/longitude

func IsNight

func IsNight(sunrisePos SunPosition) bool

IsNight ...

Types

type DayTime

type DayTime struct {
	MorningName DayTimeName
	Time        time.Time
}

DayTime ...

type DayTimeName

type DayTimeName string

DayTimeName ...

const (
	// Sunrise ...
	Sunrise DayTimeName = "sunrise"
	// Sunset ...
	Sunset DayTimeName = "sunset"

	// SunriseEnd ...
	SunriseEnd DayTimeName = "sunriseEnd"
	// SunsetStart ...
	SunsetStart DayTimeName = "sunsetStart"

	// Dawn ...
	Dawn DayTimeName = "dawn"
	// Dusk ...
	Dusk DayTimeName = "dusk"

	// NauticalDawn ...
	NauticalDawn DayTimeName = "nauticalDawn"
	// NauticalDusk ...
	NauticalDusk DayTimeName = "nauticalDusk"

	// NightEnd ...
	NightEnd DayTimeName = "nightEnd"
	// Night ...
	Night DayTimeName = "night"

	// GoldenHourEnd ...
	GoldenHourEnd DayTimeName = "goldenHourEnd"
	// GoldenHour ...
	GoldenHour DayTimeName = "goldenHour"

	// SolarNoon ...
	SolarNoon DayTimeName = "solarNoon"
	// Nadir ...
	Nadir DayTimeName = "nadir"
)

type MoonIllumination

type MoonIllumination struct {
	// contains filtered or unexported fields
}

MoonIllumination ...

func GetMoonIllumination

func GetMoonIllumination(date time.Time) MoonIllumination

calculations for illumination parameters of the moon, based on http://idlastro.gsfc.nasa.gov/ftp/pro/astro/mphase.pro formulas and Chapter 48 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.

type MoonPosition

type MoonPosition struct {
	Azimuth          float64
	Altitude         float64
	Distance         float64
	ParallacticAngle float64
}

MoonPosition ...

func GetMoonPosition

func GetMoonPosition(date time.Time, lat float64, lng float64) MoonPosition

GetMoonPosition ...

type MoonTimes

type MoonTimes struct {
	Rise       time.Time
	Set        time.Time
	AlwaysUp   bool
	AlwaysDown bool
}

MoonTimes ...

func GetMoonTimes

func GetMoonTimes(date time.Time, lat float64, lng float64, inUTC bool) MoonTimes

calculations for moon rise/set times are based on http://www.stargazing.net/kepler/moonrise.html article

type SunPosition

type SunPosition struct {
	Azimuth  float64
	Altitude float64
}

SunPosition ...

func GetSunPosition

func GetSunPosition(date time.Time, lat float64, lng float64) SunPosition

calculates sun position for a given date and latitude/longitude

Jump to

Keyboard shortcuts

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