feat: 引入可切换星历模型并扩展天象观测链路

- 新增半解析、旧模型、自定义与多源堆叠星历实例,提供 Context、Instance、SPK 读取及状态与视位置计算
- 统一太阳、月球和行星实例接口,扩展黄经穿越、留、相位、最近角距、偕日可见、任意高度升落、轨道节点及凌日等天象查询
- 完善日月食、月掩与凌日的月缘剖面、有限盘面接触、站心修正、局地可见性、全球路径和地图输出
- 新增 SVG、GeoJSON、KML 天象输出及凌日、月掩和月缘地形相关缓存与几何求解
- 新增恒星星表导入与查询,支持 CSV、Hipparcos、BSC5、Stellarium 等格式及名称、交叉标识、锥面检索和星等过滤
- 补充 IAU 2006、地球定向、折射消光、大气观测、轨道传播及半解析行星/月球数据支持
- 将默认未来民用时标切换为 TimeScaleLeapHour,更新 2027–2400 农历速查表、中文日期解析和时区边界处理
- 增加事件基线、跨模型回归、几何边界、月缘地形和输出契约测试,完善中英文手册、示例资源、NOTICE 与忽略规则
This commit is contained in:
2026-10-15 23:54:15 +08:00
parent 16c62a97d5
commit 044f2f4381
674 changed files with 62983 additions and 8396 deletions
+16 -12
View File
@@ -3,7 +3,6 @@ package basic
import (
"math"
"b612.me/astro/planet"
. "b612.me/astro/tools"
)
@@ -122,18 +121,19 @@ func OrbitAstrometricGeocentricEquatorialJ2000(jde float64, elements OrbitElemen
return orbitVectorToEquatorial(vector)
}
// OrbitApparentGeocentricEcliptic 返回光行时与章动修正后的地心视黄道坐标,单位度/AU。
// OrbitApparentGeocentricEcliptic 返回光行时、周年光行差与章动修正后的地心视黄道坐标,单位度/AU。
func OrbitApparentGeocentricEcliptic(jde float64, elements OrbitElements) (lon, lat, distance float64) {
vectorDate := eclipticVectorAtReferenceEpoch(OrbitAstrometricGeocentricXYZJ2000(jde, elements), orbitReferenceJD, jde)
lon, lat, distance = orbitVectorToEcliptic(vectorDate)
if math.IsNaN(lon) {
return math.NaN(), math.NaN(), math.NaN()
}
lon = Limit360(lon + Nutation2000Bi(jde))
return lon, lat, distance
aberrationLon, aberrationLat := GXCLo(lon, lat, jde), GXCBo(lon, lat, jde)
lon = Limit360(lon + aberrationLon/3600 + Nutation2000Bi(jde))
return lon, lat + aberrationLat/3600, distance
}
// OrbitApparentGeocentricEquatorial 返回光行时与章动修正后的地心视赤道坐标,单位度/AU。
// OrbitApparentGeocentricEquatorial 返回光行时、周年光行差与章动修正后的地心视赤道坐标,单位度/AU。
func OrbitApparentGeocentricEquatorial(jde float64, elements OrbitElements) (ra, dec, distance float64) {
lon, lat, distance := OrbitApparentGeocentricEcliptic(jde, elements)
if math.IsNaN(lon) {
@@ -143,7 +143,7 @@ func OrbitApparentGeocentricEquatorial(jde float64, elements OrbitElements) (ra,
return ra, dec, distance
}
// OrbitApparentTopocentricEquatorial 返回光行时、章动与站心修正后的视赤道坐标,单位度/AU。
// OrbitApparentTopocentricEquatorial 返回光行时、周年光行差、章动与站心修正后的视赤道坐标,单位度/AU。
func OrbitApparentTopocentricEquatorial(jde, observerLon, observerLat, observerHeight float64, elements OrbitElements) (ra, dec, distance float64) {
geocentricRA, geocentricDec, geocentricDistance := OrbitApparentGeocentricEquatorial(jde, elements)
if math.IsNaN(geocentricRA) {
@@ -159,16 +159,20 @@ func OrbitApparentTopocentricEquatorial(jde, observerLon, observerLat, observerH
return orbitVectorToEquatorial(topocentricVector)
}
func earthHeliocentricVectorOfDate(jde float64) Vector3 {
func earthHeliocentricVectorOfDate(jde float64, instances ...*Instance) Vector3 {
inst := instanceValue(instances)
return eclipticCartesian(
planet.WherePlanet(-1, 0, jde),
planet.WherePlanet(-1, 1, jde),
planet.WherePlanet(-1, 2, jde),
PlanetCoordinateWithInstance(-1, 0, jde, inst),
PlanetCoordinateWithInstance(-1, 1, jde, inst),
PlanetCoordinateWithInstance(-1, 2, jde, inst),
)
}
func earthHeliocentricVectorJ2000(jde float64) Vector3 {
return eclipticVectorAtReferenceEpoch(earthHeliocentricVectorOfDate(jde), jde, orbitReferenceJD)
func earthHeliocentricVectorJ2000(jde float64, instances ...*Instance) Vector3 {
inst := instanceValue(instances)
return eclipticVectorAtReferenceEpoch(earthHeliocentricVectorOfDate(jde, inst), jde, orbitReferenceJD)
}
func orbitVectorToEcliptic(vector Vector3) (lon, lat, distance float64) {