sun

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
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      = ERR_SUN_NEVER_SET
	ERR_TWILIGHT_NOT_EXISTS = errors.New("ERROR:今日晨昏朦影不存在!")
)

Functions

func Altitude added in v0.1.0

func Altitude(date time.Time, lon, lat float64) float64

Altitude 太阳高度角 / solar altitude.

date 为观测时刻,会读取其时区参与地方时计算;lon/lat 为观测者经纬度,东正西负、北正南负;返回值单位度。 date is the observing instant and its zone offset participates in local-time calculations. lon/lat are east-positive and north-positive; the result is in degrees.

func AltitudeN added in v0.1.0

func AltitudeN(date time.Time, lon, lat float64, n int) float64

AltitudeN 截断项太阳高度角 / truncated solar altitude.

参数与 Altitude 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as Altitude. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func ApparentAltitude added in v0.1.0

func ApparentAltitude(date time.Time, lon, lat, pressureHPa, temperatureC float64) float64

ApparentAltitude 太阳视高度角 / apparent solar altitude.

func ApparentAltitudeN added in v0.1.0

func ApparentAltitudeN(date time.Time, lon, lat, pressureHPa, temperatureC float64, n int) float64

ApparentAltitudeN 太阳视高度角(截断版) / truncated apparent solar altitude.

func ApparentDec

func ApparentDec(date time.Time) float64

ApparentDec 太阳地心视赤纬 / apparent geocentric declination.

返回 date 对应绝对时刻的太阳地心视赤纬,单位度。 Returns the Sun's apparent geocentric declination at the instant represented by date, in degrees.

func ApparentLo

func ApparentLo(date time.Time) float64

ApparentLo 太阳视黄经 / apparent ecliptic longitude.

返回 date 对应绝对时刻的太阳视黄经,单位度。 Returns the Sun's apparent ecliptic longitude at the instant represented by date, in degrees.

func ApparentRa

func ApparentRa(date time.Time) float64

ApparentRa 太阳地心视赤经 / apparent geocentric right ascension.

返回 date 对应绝对时刻的太阳地心视赤经,单位度。 Returns the Sun's apparent geocentric right ascension at the instant represented by date, in degrees.

func ApparentRaDec

func ApparentRaDec(date time.Time) (float64, float64)

ApparentRaDec 太阳地心视赤经、视赤纬 / apparent geocentric right ascension and declination.

返回 date 对应绝对时刻的太阳地心视赤经与视赤纬,单位度。 Returns the Sun's apparent geocentric right ascension and declination at the instant represented by date, in degrees.

func ApparentSolarTime

func ApparentSolarTime(date time.Time, lon float64) time.Time

ApparentSolarTime 真太阳时 / apparent solar time.

返回 date 这一绝对时刻在给定经度 lon 处对应的真太阳时,结果时区为按经度换算的地方平太阳时区。 Returns the apparent solar time for the instant represented by date at longitude lon. The result uses a synthetic local-solar time zone derived from longitude.

func ApparentSolarTimeN added in v0.1.0

func ApparentSolarTimeN(date time.Time, lon float64, n int) time.Time

ApparentSolarTimeN 截断项真太阳时 / truncated apparent solar time.

参数与 ApparentSolarTime 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as ApparentSolarTime. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func ApparentZenith added in v0.1.0

func ApparentZenith(date time.Time, lon, lat, pressureHPa, temperatureC float64) float64

ApparentZenith 太阳视天顶距 / apparent solar zenith distance.

func ApparentZenithN added in v0.1.0

func ApparentZenithN(date time.Time, lon, lat, pressureHPa, temperatureC float64, n int) float64

ApparentZenithN 太阳视天顶距(截断版) / truncated apparent solar zenith distance.

func AxialtiltNutation

func AxialtiltNutation(date time.Time) float64

AxialtiltNutation 交角章动(IAU 2000B) / nutation in obliquity, IAU 2000B.

返回 date 对应绝对时刻的交角章动,单位度。 Returns nutation in obliquity at the instant represented by date, in degrees.

func AxialtiltNutation1980

func AxialtiltNutation1980(date time.Time) float64

AxialtiltNutation1980 交角章动(IAU 1980) / nutation in obliquity, IAU 1980.

返回 date 对应绝对时刻的交角章动,单位度。 Returns nutation in obliquity at the instant represented by date, in degrees.

func Azimuth

func Azimuth(date time.Time, lon, lat float64) float64

Azimuth 太阳方位角 / azimuth.

date 为观测时刻,会读取其时区参与地方时计算;lon/lat 为观测者经纬度,东正西负、北正南负;返回值按正北为 0°、向东增加。 date is the observing instant and its zone offset participates in local-time calculations. lon/lat are east-positive and north-positive; azimuth is measured from north toward east.

func AzimuthN added in v0.1.0

func AzimuthN(date time.Time, lon, lat float64, n int) float64

AzimuthN 截断项太阳方位角 / truncated azimuth.

参数与 Azimuth 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as Azimuth. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func CulminationTime

func CulminationTime(date time.Time, lon float64) time.Time

CulminationTime 太阳中天时刻 / culmination time.

date 取其所在时区的当地日期,返回值保持相同时区;lon 为观测者经度,东正西负。 date is interpreted on its local civil day and the result keeps the same time zone. lon is east-positive longitude.

func CulminationTimeN added in v0.1.0

func CulminationTimeN(date time.Time, lon float64, n int) time.Time

CulminationTimeN 截断项太阳中天时刻 / truncated culmination time.

参数与 CulminationTime 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as CulminationTime. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func Diameter added in v0.1.0

func Diameter(date time.Time) float64

Diameter 太阳视直径,单位角秒 / apparent solar diameter in arcseconds.

func DiameterN added in v0.1.0

func DiameterN(date time.Time, n int) float64

DiameterN 太阳视直径(截断版),单位角秒 / truncated apparent solar diameter in arcseconds.

func DownTime deprecated

func DownTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, error)

DownTime 日落时刻别名 / deprecated sunset alias.

Deprecated: use SetTime instead.

参数与 SetTime 相同,仅为兼容旧接口保留。 Same as SetTime and kept only for backward compatibility.

func DownTimeN added in v0.1.0

func DownTimeN(date time.Time, lon, lat, height float64, aero bool, n int) (time.Time, error)

DownTimeN 截断项日落时刻别名 / deprecated truncated sunset alias.

参数与 SetTimeN 相同,仅为兼容旧接口保留。 Same as SetTimeN and kept only for backward compatibility.

func EarthDistance

func EarthDistance(date time.Time) float64

EarthDistance 日地距离 / Earth-Sun distance.

返回 date 对应绝对时刻的日地距离,单位 AU。 Returns the Earth-Sun distance at the instant represented by date, in astronomical units.

func EclipticNutation

func EclipticNutation(date time.Time) float64

EclipticNutation 黄经章动(IAU 2000B) / nutation in longitude, IAU 2000B.

返回 date 对应绝对时刻的黄经章动,单位度。 Returns nutation in longitude at the instant represented by date, in degrees.

func EclipticNutation1980

func EclipticNutation1980(date time.Time) float64

EclipticNutation1980 黄经章动(IAU 1980) / nutation in longitude, IAU 1980.

返回 date 对应绝对时刻的黄经章动,单位度。 Returns nutation in longitude at the instant represented by date, in degrees.

func EclipticObliquity

func EclipticObliquity(date time.Time, nutation bool) float64

EclipticObliquity 黄赤交角 / ecliptic obliquity.

返回 date 对应绝对时刻的黄赤交角,单位度;nutation 为 true 时加入交角章动。 Returns the obliquity of the ecliptic at the instant represented by date, in degrees. When nutation is true, obliquity nutation is included.

func EquationTime

func EquationTime(date time.Time) float64

EquationTime 均时差 / equation of time.

返回 date 对应绝对时刻的均时差,单位小时。 Returns the equation of time at the instant represented by date, in hours.

func EveningTwilight

func EveningTwilight(date time.Time, lon, lat, angle float64) (time.Time, error)

EveningTwilight 暮光终时 / evening twilight.

参数与 MorningTwilight 相同,返回对应当地日期的暮光结束时刻。 Uses the same inputs as MorningTwilight and returns the evening-twilight time on the corresponding local civil day.

func EveningTwilightN added in v0.1.0

func EveningTwilightN(date time.Time, lon, lat, angle float64, n int) (time.Time, error)

EveningTwilightN 截断项暮光终时 / truncated evening twilight.

参数与 MorningTwilightN 相同,返回对应当地日期的暮光结束时刻。 Uses the same inputs as MorningTwilightN and returns the evening-twilight time on the corresponding local civil day.

func GeometricLo

func GeometricLo(date time.Time) float64

GeometricLo 太阳几何黄经 / geometric ecliptic longitude.

返回 date 对应绝对时刻的太阳几何黄经,单位度。 Returns the Sun's geometric ecliptic longitude at the instant represented by date, in degrees.

func HourAngle

func HourAngle(date time.Time, lon, lat float64) float64

HourAngle 太阳时角 / hour angle.

date 为观测时刻,会读取其时区参与地方时计算;lon 为观测者经度,东正西负;返回值单位度。 lat 目前不参与计算,仅为与其他观测接口保持参数形状一致。 date is the observing instant and its zone offset participates in local-time calculations. lon is east-positive longitude and the result is in degrees. lat is currently unused and kept only for API symmetry with the other observation helpers.

func HourAngleN added in v0.1.0

func HourAngleN(date time.Time, lon, lat float64, n int) float64

HourAngleN 截断项太阳时角 / truncated hour angle.

参数与 HourAngle 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as HourAngle. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func MidFunc

func MidFunc(date time.Time) float64

MidFunc 太阳中心差 / solar equation of center.

返回 date 对应绝对时刻的太阳中心差,单位度。 Returns the Sun's equation of center at the instant represented by date, in degrees.

func MorningTwilight

func MorningTwilight(date time.Time, lon, lat, angle float64) (time.Time, error)

MorningTwilight 晨光始时 / morning twilight.

date 取其所在时区的当地日期,返回值保持相同时区;lon/lat 为观测者经纬度,东正西负、北正南负; angle 为目标太阳高度角,常用 -6/-12/-18 度,分别对应民用、航海、天文朦影。 date is interpreted on its local civil day and the result keeps the same time zone. lon/lat are east-positive and north-positive; angle is the target solar altitude in degrees, typically -6, -12, or -18 for civil, nautical, and astronomical twilight.

func MorningTwilightN added in v0.1.0

func MorningTwilightN(date time.Time, lon, lat, angle float64, n int) (time.Time, error)

MorningTwilightN 截断项晨光始时 / truncated morning twilight.

参数与 MorningTwilight 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as MorningTwilight. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func ParallacticAngle added in v0.1.0

func ParallacticAngle(date time.Time, lon, lat float64) float64

ParallacticAngle 太阳视差角(天顶方向角) / solar parallactic angle.

lon/lat 为观测者经纬度,东正西负、北正南负;返回值为有符号视差角,单位度。

func ParallacticAngleN added in v0.1.0

func ParallacticAngleN(date time.Time, lon, lat float64, n int) float64

ParallacticAngleN 截断项太阳视差角(天顶方向角) / truncated solar parallactic angle.

func RiseTime

func RiseTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, error)

RiseTime 日出时刻 / sunrise time.

date 取其所在时区的当地日期,返回值保持相同时区;lon/lat 为观测者经纬度,东正西负、北正南负; height 为海拔高度,单位米;aero 为 true 时加入标准大气折射。 date is interpreted on its local civil day and the result keeps the same time zone. lon/lat are east-positive and north-positive; height is observer elevation in meters, and aero enables standard atmospheric refraction.

func RiseTimeN added in v0.1.0

func RiseTimeN(date time.Time, lon, lat, height float64, aero bool, n int) (time.Time, error)

RiseTimeN 截断项日出时刻 / truncated sunrise time.

参数与 RiseTime 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as RiseTime. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func Semidiameter added in v0.1.0

func Semidiameter(date time.Time) float64

Semidiameter 太阳视半径,单位角秒 / apparent solar semidiameter in arcseconds.

func SemidiameterN added in v0.1.0

func SemidiameterN(date time.Time, n int) float64

SemidiameterN 太阳视半径(截断版),单位角秒 / truncated apparent solar semidiameter in arcseconds.

func SetTime

func SetTime(date time.Time, lon, lat, height float64, aero bool) (time.Time, error)

SetTime 日落时刻 / sunset time.

参数与 RiseTime 相同,返回给定当地日期内的日落时刻。 Uses the same inputs as RiseTime and returns the sunset time on the corresponding local civil day.

func SetTimeN added in v0.1.0

func SetTimeN(date time.Time, lon, lat, height float64, aero bool, n int) (time.Time, error)

SetTimeN 截断项日落时刻 / truncated sunset time.

参数与 RiseTimeN 相同,返回给定当地日期内的日落时刻。 Uses the same inputs as RiseTimeN and returns the sunset time on the corresponding local civil day.

func TrueBo

func TrueBo(date time.Time) float64

TrueBo 太阳真黄纬 / true ecliptic latitude.

返回 date 对应绝对时刻的太阳真黄纬,单位度。 Returns the Sun's true ecliptic latitude at the instant represented by date, in degrees.

func TrueBoN added in v0.1.0

func TrueBoN(date time.Time, n int) float64

TrueBoN 截断项太阳真黄纬 / truncated true ecliptic latitude.

参数与 TrueBo 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as TrueBo. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func TrueLo

func TrueLo(date time.Time) float64

TrueLo 太阳真黄经 / true ecliptic longitude.

返回 date 对应绝对时刻的太阳真黄经,单位度。 Returns the Sun's true ecliptic longitude at the instant represented by date, in degrees.

func TrueLoN added in v0.1.0

func TrueLoN(date time.Time, n int) float64

TrueLoN 截断项太阳真黄经 / truncated true ecliptic longitude.

参数与 TrueLo 相同;n<0 使用当前仓库内嵌的全部 VSOP 项,其余值用于截断太阳位置级数。 Uses the same inputs as TrueLo. n<0 keeps all embedded VSOP terms in this repository; other values truncate the solar series.

func Zenith

func Zenith(date time.Time, lon, lat float64) float64

Zenith 太阳天顶距 / solar zenith distance.

参数与 Altitude 相同,返回值为对应时刻的天顶距,单位度。 Uses the same inputs as Altitude and returns the zenith distance in degrees.

func ZenithN added in v0.1.0

func ZenithN(date time.Time, lon, lat float64, n int) float64

ZenithN 截断项太阳天顶距 / truncated solar zenith distance.

参数与 AltitudeN 相同,返回值为对应时刻的天顶距,单位度。 Uses the same inputs as AltitudeN and returns the zenith distance in degrees.

Types

type PhysicalInfo added in v0.1.0

type PhysicalInfo struct {
	// P 太阳北极位置角,单位度 / position angle of the solar north pole in degrees.
	P float64
	// B0 日面中心太阳纬度,单位度 / heliographic latitude of the disk center in degrees.
	B0 float64
	// L0 日面中心卡林顿经度,单位度 / Carrington heliographic longitude of the disk center in degrees.
	L0 float64
}

PhysicalInfo 太阳物理观测参数 / physical observing parameters of the Sun.

func Physical added in v0.1.0

func Physical(date time.Time) PhysicalInfo

Physical 太阳物理观测参数 / physical observing parameters of the Sun.

func PhysicalN added in v0.1.0

func PhysicalN(date time.Time, n int) PhysicalInfo

PhysicalN 太阳物理观测参数(截断版) / truncated physical observing parameters of the Sun.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL