satellite

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: BSD-2-Clause Imports: 5 Imported by: 0

README

前言

  • Forked from joshuaferrara/go-satellite
  • 原仓库协议:BSD 2-Clause License
  • 原 repo 的浮点数计算可能存在精度问题,所以新建一个用新的方式计算部分浮点数
  • 在原有基础上 可能做出部分修改,HamZone.cn 相关 TLE 计算会使用此仓库,方便自主调整
  • 仓库内容中文本土化
  • master 分支保持和原仓库一致,emin 为默认分支

TLESatellite

GoDoc

import "github.com/HamZone/TLESatellite"`

项目使用 SGP4 模型进行预测

用法

Constants
func ECIToLLA
func ECIToLLA(eciCoords Vector3, gmst float64) (altitude, velocity float64, ret LatLong)

Convert Earth Centered Inertial coordinated into equivalent latitude, longitude, altitude and velocity. Reference: http://celestrak.com/columns/v02n03/

func GSTimeFromDate
func GSTimeFromDate(year, mon, day, hr, min, sec int) float64

Calc GST given year, month, day, hour, minute and second

func JDay
func JDay(year, mon, day, hr, min, sec int) float64

Calc julian date given year, month, day, hour, minute and second the julian date is defined by each elapsed day since noon, jan 1, 4713 bc.

func Propagate
func Propagate(sat Satellite, year int, month int, day, hours, minutes, seconds int) (position, velocity Vector3)

Calculates position and velocity vectors for given time

func ThetaG_JD
func ThetaG_JD(jday float64) (ret float64)

Calculate GMST from Julian date. Reference: The 1992 Astronomical Almanac, page B6.

type LatLong
type LatLong struct {
	Latitude, Longitude float64
}

Holds latitude and Longitude in either degrees or radians

func LatLongDeg
func LatLongDeg(rad LatLong) (deg LatLong)

Convert LatLong in radians to LatLong in degrees

type LookAngles
type LookAngles struct {
	Az, El, Rg float64
}

Holds an azimuth, elevation and range

func ECIToLookAngles
func ECIToLookAngles(eciSat Vector3, obsCoords LatLong, obsAlt, jday float64) (lookAngles LookAngles)

Calculate look angles for given satellite position and observer position obsAlt in km Reference: http://celestrak.com/columns/v02n02/

type Satellite
type Satellite struct {
	Line1 string
	Line2 string
}

Struct for holding satellite information during and before propagation

func ParseTLE
func ParseTLE(line1, line2, gravconst string) (sat Satellite)

Parses a two line element dataset into a Satellite struct

func TLEToSat
func TLEToSat(line1, line2 string, gravconst string) Satellite

Converts a two line element data set into a Satellite struct and runs sgp4init

type Vector3
type Vector3 struct {
	X, Y, Z float64
}

Holds X, Y, Z position

func ECIToECEF
func ECIToECEF(eciCoords Vector3, gmst float64) (ecfCoords Vector3)

Convert Earth Centered Intertial coordinates into Earth Cenetered Earth Final coordinates Reference: http://ccar.colorado.edu/ASEN5070/handouts/coordsys.doc

func LLAToECI
func LLAToECI(obsCoords LatLong, alt, jday float64) (eciObs Vector3)

Convert latitude, longitude and altitude into equivalent Earth Centered Intertial coordinates Reference: The 1992 Astronomical Almanac, page K11.

Documentation

Index

Constants

View Source
const DEG2RAD float64 = math.Pi / 180.0
View Source
const RAD2DEG float64 = 180.0 / math.Pi
View Source
const TWOPI float64 = math.Pi * 2.0

Constants

View Source
const XPDOTP float64 = 1440.0 / (2.0 * math.Pi)

Variables

This section is empty.

Functions

func DecimalAdd2

func DecimalAdd2(d1, d2 float64) float64

DecimalAdd2 d1 + d2

func DecimalAdd3

func DecimalAdd3(d1, d2, d3 float64) float64

DecimalAdd2 d1 + d2 + d3

func DecimalDiv2

func DecimalDiv2(d1, d2 float64) float64

DecimalDiv2 d1 / d2

func DecimalMul2

func DecimalMul2(d1, d2 float64) float64

DecimalMul2 d1 * d2

func DecimalMul3

func DecimalMul3(d1, d2, d3 float64) float64

DecimalMul3 d1 * d2 * d3

func DecimalMul4

func DecimalMul4(d1, d2, d3, d4 float64) float64

DecimalMul3 d1 * d2 * d3 * d4

func DecimalSub2

func DecimalSub2(d1, d2 float64) float64

DecimalSub2 d1 - d2

func DecimalSub3 added in v0.0.4

func DecimalSub3(d1, d2, d3 float64) float64

DecimalSub3 d1 - d2 - d3

func DecimalSub4 added in v0.0.4

func DecimalSub4(d1, d2, d3, d4 float64) float64

DecimalSub4 d1 - d2 - d3 - d4

func GSTimeFromDate

func GSTimeFromDate(year, mon, day, hr, min, sec int) float64

GSTimeFromDate 计算Greenwich Mean Sidereal Time 格林威治平均恒星时 Calc GST given year, month, day, hour, minute and second

func JDay

func JDay(year, mon, day, hr, min, sec int) float64

JDay 计算儒略日 Calc julian date given year, month, day, hour, minute and second the julian date is defined by each elapsed day since noon, jan 1, 4713 bc.

func ThetaG_JD

func ThetaG_JD(jday float64) (ret float64)

Calculate GMST from Julian date. Reference: The 1992 Astronomical Almanac, page B6.

Types

type DSComResults

type DSComResults struct {
	// contains filtered or unexported fields
}

A struct returned from the dscom function

type DeepSpaceInitResult

type DeepSpaceInitResult struct {
	// contains filtered or unexported fields
}

A struct returned from the dsinit function

type DeepSpaceResult

type DeepSpaceResult struct {
	// contains filtered or unexported fields
}

A struct returned from the dspace function

type DpperResult

type DpperResult struct {
	// contains filtered or unexported fields
}

A struct returned from the dpper function

type GravConst

type GravConst struct {
	// contains filtered or unexported fields
}

GravConst 重力模型的一些变量 Holds variables that are dependent upon selected gravity model

type LatLong

type LatLong struct {
	Latitude, Longitude float64
}

Holds latitude and Longitude in either degrees or radians

func ECIToLLA

func ECIToLLA(eciCoords Vector3, gmst float64) (altitude, velocity float64, ret LatLong)

ECIToLLA 将地心惯性坐标转换为等效的纬度(latitude)、经度(longitude)、高度(altitude)和速度(velocity) Convert Earth Centered Inertial coordinated into equivalent latitude, longitude, altitude and velocity. Reference: http://celestrak.com/columns/v02n03/

func LatLongDeg

func LatLongDeg(rad LatLong) (deg LatLong)

LatLongDeg 将以弧度表示的LatLong转换为以度表示的LatLong Convert LatLong in radians to LatLong in degrees

type LookAngles

type LookAngles struct {
	Az, El, Rg float64
}

Holds an azimuth, elevation and range

func ECIToLookAngles

func ECIToLookAngles(eciSat Vector3, obsCoords LatLong, obsAlt, jday float64) (lookAngles LookAngles)

ECIToLookAngles 计算给定卫星位置和观察者位置的视角 Calculate look angles for given satellite position and observer position obsAlt in km Reference: http://celestrak.com/columns/v02n02/

type Satellite

type Satellite struct {
	Line1 string
	Line2 string

	Error    int64
	ErrorStr string
	// contains filtered or unexported fields
}

Struct for holding satellite information during and before propagation

func ParseTLE

func ParseTLE(line1, line2, gravconst string) (sat Satellite)

ParseTLE TLE两行数据转为结构体 Parses a two line element dataset into a Satellite struct

func TLEToSat

func TLEToSat(line1, line2 string, gravconst string) Satellite

TLEToSat TLE两行数据转为结构体 并运行sgp4init Converts a two line element data set into a Satellite struct and runs sgp4init

type Vector3

type Vector3 struct {
	X, Y, Z float64
}

Holds X, Y, Z position

func ECIToECEF

func ECIToECEF(eciCoords Vector3, gmst float64) (ecfCoords Vector3)

ECIToECEF 将地心间坐标转换为地心最终坐标 Earth Centered Intertial Convert Earth Centered Intertial coordinates into Earth Cenetered Earth Final coordinates Reference: http://ccar.colorado.edu/ASEN5070/handouts/coordsys.doc

func LLAToECI

func LLAToECI(obsCoords LatLong, alt, jday float64) (eciObs Vector3)

Convert latitude, longitude and altitude(km) into equivalent Earth Centered Intertial coordinates(km) Reference: The 1992 Astronomical Almanac, page K11.

func Propagate

func Propagate(sat Satellite, year int, month int, day, hours, minutes, seconds int) (position, velocity Vector3)

Propagate 计算给定时间的位置和速度矢量 sgp4 模型 Calculates position and velocity vectors for given time

Jump to

Keyboard shortcuts

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