star

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: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERR_STAR_NEVER_RISE = errors.New("ERROR:极夜,星星在今日永远在地平线下!")
	ERR_STAR_NEVER_SET  = errors.New("ERROR:极昼,星星在今日永远在地平线上!")
	// ERR_STAR_NEVER_DOWN deprecated: -- use ERR_STAR_NEVER_SET instead
	ERR_STAR_NEVER_DOWN = ERR_STAR_NEVER_SET
)

Functions

func Altitude added in v0.1.0

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

Altitude 恒星高度角 / stellar altitude.

ra/dec 为瞬时赤经赤纬,单位度;lon/lat 为观测者经纬度,东正西负、北正南负;返回值单位度。 ra/dec are apparent equatorial coordinates in degrees; lon/lat are east-positive and north-positive; the result is in degrees.

func ApparentAltitude added in v0.1.0

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

ApparentAltitude 恒星视高度角 / apparent stellar altitude.

func ApparentSiderealTime

func ApparentSiderealTime(date time.Time) float64

ApparentSiderealTime 真恒星时 / apparent sidereal time.

返回 date 对应绝对时刻的格林尼治真恒星时,单位小时。 Returns Greenwich apparent sidereal time at the instant represented by date, in hours.

func ApparentZenith added in v0.1.0

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

ApparentZenith 恒星视天顶距 / apparent stellar zenith distance.

func Azimuth

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

Azimuth 恒星方位角 / azimuth.

ra/dec 为瞬时赤经赤纬,单位度;lon/lat 为观测者经纬度,东正西负、北正南负;返回值按正北为 0°、向东增加。 ra/dec are apparent equatorial coordinates in degrees; lon/lat are east-positive and north-positive; azimuth is measured from north toward east.

func Constellation

func Constellation(ra, dec float64, date time.Time) string

Constellation 星座中文名 / Chinese constellation name.

ra/dec 为给定时刻的赤经赤纬,单位度;date 作为所属历元使用。 ra/dec are equatorial coordinates in degrees and date provides the epoch used by the constellation boundaries.

func ConstellationCode added in v0.1.0

func ConstellationCode(ra, dec float64, date time.Time) string

ConstellationCode IAU 星座代码 / IAU constellation code.

ra/dec 为给定时刻的赤经赤纬,单位度;date 作为所属历元使用。 ra/dec are equatorial coordinates in degrees and date provides the epoch used by the constellation boundaries.

func ConstellationEN added in v0.1.0

func ConstellationEN(ra, dec float64, date time.Time) string

ConstellationEN 星座英文名 / English constellation name.

ra/dec 为给定时刻的赤经赤纬,单位度;date 作为所属历元使用。 ra/dec are equatorial coordinates in degrees and date provides the epoch used by the constellation boundaries.

func CulminationTime

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

CulminationTime 恒星中天时刻 / culmination time.

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

func DownTime deprecated

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

DownTime 恒星落下时刻别名 / deprecated stellar set-time alias.

Deprecated: use SetTime instead.

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

func HourAngle

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

HourAngle 恒星时角 / hour angle.

ra 为瞬时赤经,单位度;lon 为观测者经度,东正西负;date 为观测时刻,会读取其时区参与地方时计算。 ra is the apparent right ascension in degrees; lon is east-positive longitude; date is the observing instant and its zone offset participates in local-time calculations.

func InitStarDatabase

func InitStarDatabase() error

InitStarDatabase 初始化恒星数据库 / initializes the embedded star catalog.

func MeanSiderealTime

func MeanSiderealTime(date time.Time) float64

MeanSiderealTime 平恒星时 / mean sidereal time.

返回 date 对应绝对时刻的格林尼治平恒星时,单位小时。 Returns Greenwich mean sidereal time at the instant represented by date, in hours.

func ParallacticAngle added in v0.1.0

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

ParallacticAngle 恒星视差角(天顶方向角) / stellar parallactic angle.

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

func RiseTime

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

RiseTime 恒星升起时刻 / stellar rise time.

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

func SetTime

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

SetTime 恒星落下时刻 / stellar set time.

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

func StarDataByHR

func StarDataByHR(hr int) (basic.StarData, error)

StarDataByHR 按 HR 编号查询恒星数据 / returns star data by HR number.

func StarDataByName

func StarDataByName(name string) (basic.StarData, error)

StarDataByName 按中文名查询恒星数据 / returns star data by Chinese name.

func TopBrightStars

func TopBrightStars() ([]basic.StarData, error)

TopBrightStars 明亮恒星样本 / bright-star sample list.

返回按视星等大致由亮到暗排列、视星等约不高于 3 的内置恒星数据。 Returns the built-in bright-star sample, roughly ordered from brighter to dimmer and limited to stars around magnitude 3 or brighter.

func Zenith

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

Zenith 恒星天顶距 / stellar zenith distance.

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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