- fix: Correct sun.TrueBo calculation, now using basic.HSunTrueBo for correct solar latitude

- fix: Rename GetSunDownTime to GetSunSetTime in basic/sun.go and update related calls/outputs
- fix: Update test cases to use new method and error constant names

- improve: Rename all DownTime/Down functions to SetTime/Set for consistency
- improve: Standardize ERR_XXX_NEVER_DOWN error constants to ERR_XXX_NEVER_SET, with ERR_XXX_NEVER_DOWN kept as compatibility alias
- improve: More standard naming for interfaces and errors to improve maintainability and readability
This commit is contained in:
2025-09-08 10:59:04 +08:00
parent 126cf68cab
commit 438f1700c7
11 changed files with 41 additions and 19 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import (
var (
ERR_SUN_NEVER_RISE = errors.New("ERROR:极夜,太阳在今日永远在地平线下!")
ERR_SUN_NEVER_SET = errors.New("ERROR:极昼,太阳在今日永远在地平线上!")
// ERR_SUN_NEVER_DOWN deprecated -- use ERR_SUN_NEVER_RISE instead
// ERR_SUN_NEVER_DOWN deprecated: -- use ERR_SUN_NEVER_RISE instead
ERR_SUN_NEVER_DOWN = ERR_SUN_NEVER_SET
ERR_TWILIGHT_NOT_EXISTS = errors.New("ERROR:今日晨昏朦影不存在!")
)
@@ -54,7 +54,7 @@ func RiseTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, e
return basic.JDE2DateByZone(riseJde, date.Location(), true), err
}
// deprecated -- use SetTime instead
// deprecated: -- use SetTime instead
// DownTime 太阳落下时间
// date,当地时区日期,务必做时区修正
// lon,经度,东正西负