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/moon/moon.go

210 lines
3.8 KiB
Go

5 years ago
package moon
import (
"errors"
"b612.me/astro/basic"
)
/*
jdeUTC
*/
func TrueLo(jde float64) float64 {
return basic.HMoonTrueLo(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func SeeLo(jde float64) float64 {
return basic.HMoonSeeLo(basic.TD2UT(jde, true))
}
/*
jdeUTC
lon,
lat,
timezone,
*/
func SeeRa(jde, lon, lat, timezone float64) float64 {
return basic.HMoonSeeRa(basic.TD2UT(jde, true), lon, lat, timezone)
}
/*
jdeUTC
lon,
lat,
timezone,
*/
func SeeDec(jde, lon, lat, timezone float64) float64 {
return basic.HMoonSeeDec(basic.TD2UT(jde, true), lon, lat, timezone)
}
/*
jdeUTC
lon,
lat,
timezone,
*/
func SeeRaDec(jde, lon, lat, timezone float64) (float64, float64) {
return basic.HMoonSeeRaDec(basic.TD2UT(jde, true), lon, lat, timezone)
}
/*
jdeUTC
*/
func TrueRa(jde float64) float64 {
return basic.HMoonTrueRa(basic.TD2UT(jde, true))
}
/*
jdeUTC
*/
func TrueDec(jde float64) float64 {
return basic.HMoonTrueDec(basic.TD2UT(jde, true))
}
/*
jde
lon西
lat
timezone西
*/
func HourAngle(jde, lon, lat, timezone float64) float64 {
return basic.MoonTimeAngle(jde, lon, lat, timezone)
}
/*
jde
lon西
lat
timezone西
*/
func Azimuth(jde, lon, lat, timezone float64) float64 {
return basic.HMoonAngle(jde, lon, lat, timezone)
}
/*
jde
lon西
lat
timezone西
*/
func Zenith(jde, lon, lat, timezone float64) float64 {
return basic.HMoonHeight(jde, lon, lat, timezone)
}
/*
jde0
lon西
lat
timezone西
*/
func CulminationTime(jde, lon, lat, timezone float64) float64 {
return basic.GetMoonTZTime(jde, lon, lat, 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.GetMoonRiseTime(jde, lon, lat, timezone, tz)
5 years ago
if tm == -3 {
err = errors.New("非今日")
}
5 years ago
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.GetMoonDownTime(jde, lon, lat, timezone, tz)
5 years ago
if tm == -3 {
err = errors.New("非今日")
}
5 years ago
if tm == -2 {
err = errors.New("极夜")
}
if tm == -1 {
err = errors.New("极昼")
}
return tm, err
}
/*
jdeUTC JDE
*/
func Phase(jde float64) float64 {
return basic.MoonLight(basic.TD2UT(jde, true))
}
/*
*/
func ShuoYue(year float64) float64 {
return basic.CalcMoonSH(year, 0)
}
/*
*/
func WangYue(year float64) float64 {
return basic.CalcMoonSH(year, 1)
}
/*
*/
func ShangXianYue(year float64) float64 {
return basic.CalcMoonXH(year, 0)
}
/*
*/
func XiaXianYue(year float64) float64 {
return basic.CalcMoonXH(year, 1)
}