feat: 完善水星与金星全球凌日搜索及制图导出

- 基于平均下合周期与节点相位预筛候选,减少无效星历计算;跳过无法求解的单个会合周期,避免有限覆盖星历导致搜索提前终止
- 引入影轴 γ、半影半径及地球尺度几何判定,结合站心可见性识别地心无接触、仅部分地区可见的掠凌
- 添加金星 243 年、水星 46 年周期族编号,并明确编号适用范围及未分配时的零值语义
- 为 SVG、GeoJSON 和 KML 增加站心部分凌日可见区,适配接触等时线、几何元数据、图层样式及取景;为地心无接触凌日事件增加正射图,按可见区球面面积加权居中
This commit is contained in:
b612 committed 2026-10-20 22:35:39 +08:00
1 parent 72460fa228
commit ccf5880269
41 files changed
+1554 -307

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
package venus
import (
"testing"
"time"
)
func TestGlobalTransitWrapper(tester *testing.T) {
zone := time.FixedZone("UTC+8", 8*3600)
info := NextTransit(time.Date(2854, 1, 1, 0, 0, 0, 0, zone))
if !info.Valid || info.Greatest.Year() != 2854 || info.HasExternal || !info.Start.IsZero() || !info.End.IsZero() || info.Duration != 0 || info.Series.Number != 4 {
tester.Fatalf("invalid global transit: %+v", info)
}
if info.Greatest.Location() != zone || info.WindowStart.Location() != zone || info.WindowEnd.Location() != zone {
tester.Fatal("global transit lost the caller's timezone")
}
local := LocalTransit(info, -135, -60, 0)
if !local.Valid || !local.Visible || local.HasInternal || local.Greatest.Time.Location() != zone {
tester.Fatalf("invalid local partial transit: %+v", local)
}
for _, result := range []TransitInfo{ClosestTransit(info.Greatest), LastTransit(info.Greatest.Add(time.Minute)), NextTransit(info.Greatest.Add(-time.Minute))} {
difference := result.Greatest.Sub(info.Greatest)
if !result.Valid || difference > time.Second || difference < -time.Second {
tester.Fatal("global event lost at a query boundary")
}
}
}
func TestLocalTransitRequiresContactsOrWindow(tester *testing.T) {
info := NextTransit(time.Date(2854, 1, 1, 0, 0, 0, 0, time.UTC))
info.WindowStart, info.WindowEnd = time.Time{}, time.Time{}
if local := LocalTransit(info, -135, -60, 0); local.Valid {
tester.Fatal("partial transit without a window must be rejected")
}
}