fix: 修正行星事件边界与留点计算
- 统一 UT 事件时刻与 TT 查询时刻的边界判断 - 将外行星留点搜索锚定到对应冲日周期 - 修正水星、金星合日、留、大距事件选择 - 统一七大行星视位置计算辅助逻辑 - 增加公开 Last/Next 边界和 JPL/NAOJ 基线回归测试
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
package neptune
|
||||
|
||||
import (
|
||||
"math"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func sameUnixSecond(got time.Time, want int64) bool {
|
||||
return math.Abs(float64(got.Unix()-want)) <= 1
|
||||
}
|
||||
|
||||
func TestNeptune(t *testing.T) {
|
||||
tz := time.FixedZone("CST", 8*3600)
|
||||
date := time.Date(2022, 01, 20, 00, 00, 00, 00, tz)
|
||||
if NextConjunction(date).Unix() != 1647171800 {
|
||||
if !sameUnixSecond(NextConjunction(date), 1647171800) {
|
||||
t.Fatal(NextConjunction(date).Unix())
|
||||
}
|
||||
if CulminationTime(date, 115).Unix() != 1642665021 {
|
||||
|
||||
Reference in New Issue
Block a user