feat: 完善时标与天象几何计算并扩展输出接口
- 新增时标、ΔT 模型、质心时间与 UT1 支持 - 改进日月食、月掩、行星事件及路径边界计算 - 完善恒星三维自行与动态距离传播 - 扩展 SVG、GeoJSON、KML 输出与底层距离换算工具 - 整理中英文手册、示例资源及回归测试
This commit is contained in:
@@ -140,8 +140,9 @@ func (solver *SolarEclipseShadowSolver) stationDeltaT(value time.Time) float64 {
|
||||
return state.DeltaTSeconds
|
||||
}
|
||||
|
||||
func TestSolarEclipseShadowTTEntryUsesScopedDeltaTForItsTime(t *testing.T) {
|
||||
// 显式 ΔT 下:TT 入口回填的 UT 必须是 TT − 句柄 ΔT,闭合弧与 closure 取自同一时刻。
|
||||
func TestSolarEclipseShadowTTEntryReportsCivilTime(t *testing.T) {
|
||||
// 句柄 ΔT 只改地球自转相位:TT 入口回填的必须是民用时刻(TT2UTC),
|
||||
// 而不是 TT − ΔT —— 后者是 UT1,与民用时刻差一个 DUT1。
|
||||
override := 3666.18
|
||||
value := time.Date(2009, time.July, 22, 0, 53, 0, 0, time.UTC)
|
||||
model := NewSolarEclipseShadowSolver(SolarEclipseShadowSolverOptions{})
|
||||
@@ -151,13 +152,20 @@ func TestSolarEclipseShadowTTEntryUsesScopedDeltaTForItsTime(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatal("expected a footprint at the shifted instant")
|
||||
}
|
||||
want := solarEclipseTTJDEToTimeWithDeltaT(jde, override, time.UTC)
|
||||
want := solarEclipseTTJDEToTime(jde, time.UTC)
|
||||
if !instant.Time.Equal(want) {
|
||||
t.Fatalf("TT entry time=%v, want %v (TT − %.2f s)", instant.Time.UTC(), want.UTC(), override)
|
||||
t.Fatalf("TT entry time=%v, want the civil time %v", instant.Time.UTC(), want.UTC())
|
||||
}
|
||||
if instant.DeltaTSeconds != override {
|
||||
t.Fatalf("reported ΔT=%.6f, want %.2f", instant.DeltaTSeconds, override)
|
||||
}
|
||||
if shift := instant.Time.Sub(value); shift > time.Millisecond || shift < -time.Millisecond {
|
||||
t.Fatalf("TT entry time=%v, want the civil instant %v", instant.Time.UTC(), value)
|
||||
}
|
||||
state := solver.StationStateAtJDE(jde, -96.8, 32.8, 0)
|
||||
if !state.Time.Equal(want) {
|
||||
t.Fatalf("station TT entry time=%v, want the civil time %v", state.Time.UTC(), want.UTC())
|
||||
}
|
||||
}
|
||||
|
||||
func TestSolarEclipseShadowBetweenSurvivesLongWindows(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user