feat: 新增月掩与日月食地理绘图并提升观测计算精度
- 新增月掩恒星和行星:支持搜索、掩甚点、全球掩带及固定地点轨迹计算 - 支持恒星星表坐标转换、有限盘面行星接触事件和月掩 SVG 输出 - 新增日月食及月掩全球投影图、时间标记和 GeoJSON 地理数据接口 - 扩展日食中心线、南北界及偏食足迹采样,支持极区投影 - 修正站心时角、月出月落、月球视半径、折射和恒星自行计算 - 优化内外行星事件搜索、边界选择、极端输入处理和计算稳定性
This commit is contained in:
+15
-5
@@ -195,9 +195,23 @@ func nextPlanetTransitSeasonTT(jdTT float64, cfg planetTransitConfig, direction
|
||||
for nodeOffset := 0; nodeOffset <= 1; nodeOffset++ {
|
||||
candidate := estimatePlanetTransitSeasonTT(jdTT, cfg, nodeOffset, direction)
|
||||
candidate = refinePlanetTransitSeasonTT(candidate, cfg, nodeOffset)
|
||||
for !planetTransitMatchesDirection(candidate, jdTT, direction, false) {
|
||||
if !isFiniteFloat(candidate) {
|
||||
continue
|
||||
}
|
||||
matchedDirection := false
|
||||
for i := 0; i < eventDirectionalSearchIterations; i++ {
|
||||
if planetTransitMatchesDirection(candidate, jdTT, direction, false) {
|
||||
matchedDirection = true
|
||||
break
|
||||
}
|
||||
candidate += float64(direction) * planetTransitTropicalYearDays
|
||||
candidate = refinePlanetTransitSeasonTT(candidate, cfg, nodeOffset)
|
||||
if !isFiniteFloat(candidate) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if !matchedDirection {
|
||||
continue
|
||||
}
|
||||
if !isFiniteFloat(best) || math.Abs(candidate-jdTT) < math.Abs(best-jdTT) {
|
||||
best = candidate
|
||||
@@ -514,7 +528,3 @@ func planetTransitAngleDelta(diff float64) float64 {
|
||||
}
|
||||
return diff
|
||||
}
|
||||
|
||||
func isFiniteFloat(value float64) bool {
|
||||
return !math.IsNaN(value) && !math.IsInf(value, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user