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/star/star_test.go

27 lines
539 B
Go

package star
import (
"b612.me/astro/tools"
"fmt"
"testing"
"time"
)
func TestStar(t *testing.T) {
err := InitStarDatabase()
if err != nil {
t.Fatal(err)
}
sirius, err := GetStarDataByHR(2491)
if err != nil {
t.Fatal(err)
}
fmt.Printf("%+v\n", sirius)
now := time.Now()
ra, dec := sirius.RaDecByDate(now)
fmt.Println(tools.Format(ra/15, 1), tools.Format(dec, 0))
fmt.Println(RiseTime(now, ra, dec, 115, 40, 0, true))
fmt.Println(CulminationTime(now, ra, 115))
fmt.Println(DownTime(now, ra, dec, 115, 40, 0, true))
}