about summary refs log tree commit diff
path: root/TLE.go
blob: 5b1a370c37efcab3c05509c856d76ac06ec904af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Implementing the "Two-line element set (TLE)", a data format encoding orbital elements of Earth-orbiting objects. https://en.wikipedia.org/wiki/Two-line_element_set
*/

package TLE

// tlebytes defines a tle using raw bytes.
type TLE struct {
	TitleLine TitleLine `json:"titleline"`
	LineOne   LineOne   `json:"lineone"`
	LineTwo   LineTwo   `json:"linetwo"`
}
type TitleLine struct {
	Satname string `json:"satname"`
}
type LineOne struct {
	Linenumber              int8 `json:"linenumber"`
	Satellitenumber         int  `json:"satellitenumber"`
	Classification          rune `json:"classification"`
	InternationalDesignator struct {
		launchyear   int8 `json:"launchyear"`
		launchnumber int  `json:"launchnumber"`
		launchpiece  rune `json:"launchpiece"`
	} `json:"internationaldesignator"`
	Epoch struct {
		year        int8    `json:"year"`
		dayfraction float64 `json:"dayfraction"`
	}
	Firstderiv       float64 `json:"firstderiv"`
	Secondderiv      float64 `json:"secondderiv"`
	BSTAR            float64 `json:"BSTAR"`
	Numberzero       int8    `json:"numberzero"`
	ElementSetNumber int     `json:"elementesetnumber"`
	Checksum         int8    `json:"checksum"`
}
type LineTwo struct {
	Linenumber                       int8    `json:"linenumber"`
	Satellitenumber                  int     `json:"satellitenumber"`
	Inclination                      float64 `json:"inclination"`
	RightAscensionOfTheAscendingNode float64 `json:"rightascensionoftheascendingnode"`
	Eccentricity                     float64 `json:"eccentricity"`
	ArgumentOfPerigee                float64 `json:"argumentofperigee"`
	MeanAnomaly                      float64 `json:"meananomaly"`
	MeanMotion                       float64 `json:"meanmotion"`
	RevolutionNumberAtEpoch          int     `json:"revolutionnumberatepoch"`
	Checksum                         int8    `json:"checksum"`
}