You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
astro/sun/sun.go

245 lines
4.7 KiB
Go

5 years ago
package sun
import (
"errors"
"b612.me/astro/basic"
)
/*
jdeUTC
nutationtrue
*/
func EclipticObliquity(jde float64, nutation bool) float64 {
jde = basic.TD2UT(jde, true)
return basic.EclipticObliquity(jde, nutation)
}
/*
jdeUTC
*/
func EclipticNutation(jde float64) float64 {
return basic.HJZD(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func AxialtiltNutation(jde float64) float64 {
return basic.JJZD(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func GeometricLo(jde float64) float64 {
return basic.SunLo(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func TrueLo(jde float64) float64 {
return basic.HSunTrueLo(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func SeeLo(jde float64) float64 {
return basic.HSunSeeLo(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func SeeRa(jde float64) float64 {
return basic.HSunSeeRa(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func SeeDec(jde float64) float64 {
return basic.HSunSeeDec(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func SeeRaDec(jde float64) (float64, float64) {
return basic.HSunSeeRaDec(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func TrueRa(jde float64) float64 {
return basic.HSunTrueRa(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func TrueDec(jde float64) float64 {
return basic.HSunTrueDec(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func MidFunc(jde float64) float64 {
return basic.SunMidFun(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func EquationTime(jde float64) float64 {
return basic.SunTime(basic.TD2UT(jde, true))
}
/*
jde
lon西
lat
timezone西
*/
func HourAngle(jde, lon, lat, timezone float64) float64 {
return basic.SunTimeAngle(jde, lon, lat, timezone)
}
/*
jde
lon西
lat
timezone西
*/
func Azimuth(jde, lon, lat, timezone float64) float64 {
return basic.SunAngle(jde, lon, lat, timezone)
}
/*
jde
lon西
lat
timezone西
*/
func Zenith(jde, lon, lat, timezone float64) float64 {
return basic.SunHeight(jde, lon, lat, timezone)
}
/*
jde0
lon西
timezone西
*/
func CulminationTime(jde, lon, timezone float64) float64 {
return basic.GetSunTZTime(jde, lon, timezone)
}
/*
jde0 JDE
lon西
lat
timezone西
aerotrue
*/
func RiseTime(jde, lon, lat, timezone float64, aero bool) (float64, error) {
var err error = nil
tz := 0.00
if aero {
tz = 1
}
tm := basic.GetSunRiseTime(jde, lon, lat, timezone, tz)
if tm == -2 {
err = errors.New("极夜")
}
if tm == -1 {
err = errors.New("极昼")
}
return tm, err
}
/*
jde0 JDE
lon西
lat
timezone西
aerotrue
*/
func DownTime(jde, lon, lat, timezone float64, aero bool) (float64, error) {
var err error = nil
tz := 0.00
if aero {
tz = 1
}
tm := basic.GetSunDownTime(jde, lon, lat, timezone, tz)
if tm == -2 {
err = errors.New("极夜")
}
if tm == -1 {
err = errors.New("极昼")
}
return tm, err
}
/*
jde0 JDE
lon西
lat
timezone西
angle-6 -12 -18
*/
func MorningTwilightTime(jde, lon, lat, timezone, angle float64) (float64, error) {
var err error = nil
tm := basic.GetAsaTime(jde, lon, lat, timezone, angle)
if tm == -2 {
err = errors.New("不存在")
}
if tm == -1 {
err = errors.New("不存在")
}
return tm, err
}
/*
jde0 JDE
lon西
lat
timezone西
angle-6 -12 -18
*/
func EveningTwilightTime(jde, lon, lat, timezone, angle float64) (float64, error) {
var err error = nil
tm := basic.GetBanTime(jde, lon, lat, timezone, angle)
if tm == -2 {
err = errors.New("不存在")
}
if tm == -1 {
err = errors.New("不存在")
}
return tm, err
}