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/basic/all_test.go

30 lines
1.2 KiB
Go

5 years ago
package basic
import (
"fmt"
"testing"
)
func Test_SunAndMoon(t *testing.T) {
jde := GetNowJDE() - 1
ra := HSunSeeRa(jde - 8.0/24.0)
dec := HSunSeeDec(jde - 8.0/24.0)
fmt.Printf("当前JDE:%.14f\n", jde)
fmt.Println("当前太阳黄经:", HSunSeeLo(jde-8.0/24.0))
fmt.Println("当前太阳赤经:", ra)
fmt.Println("当前太阳赤纬:", dec)
fmt.Println("当前太阳星座:", WhichCst(ra, dec, jde))
fmt.Println("当前黄赤交角:", EclipticObliquity(jde-8.0/24.0, true))
fmt.Println("当前日出:", JDE2Date(GetSunRiseTime(jde, 115, 32, 8, 1)))
fmt.Println("当前日落:", JDE2Date(GetSunDownTime(jde, 115, 32, 8, 1)))
fmt.Println("当前晨影 -6", JDE2Date(GetAsaTime(jde, 115, 32, 8, -6)))
fmt.Println("当前晨影 -12", JDE2Date(GetAsaTime(jde, 115, 32, 8, -12)))
fmt.Println("当前昏影 -6", JDE2Date(GetBanTime(jde, 115, 32, 8, -6)))
fmt.Println("当前昏影 -12", JDE2Date(GetBanTime(jde, 115, 32, 8, -12)))
fmt.Print("农历:")
fmt.Println(GetLunar(2019, 10, 23))
fmt.Println("当前月出:", JDE2Date(GetMoonRiseTime(jde, 115, 32, 8, 1)))
fmt.Println("当前月落:", JDE2Date(GetMoonDownTime(jde, 115, 32, 8, 1)))
fmt.Println("月相:", MoonLight(jde-8.0/24.0))
}