From 287883dddf3b0e65a006462849c10e5be3c43b61 Mon Sep 17 00:00:00 2001 From: Emile Date: Mon, 19 Aug 2019 14:55:56 +0200 Subject: moved the individual lines out of the TLE --- TLE.go | 73 ++++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/TLE.go b/TLE.go index 5d89656..5b1a370 100644 --- a/TLE.go +++ b/TLE.go @@ -6,39 +6,42 @@ package TLE // tlebytes defines a tle using raw bytes. type TLE struct { - TitleLine struct { - Satname string `json:"satname"` - } `json:"titleline"` - 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"` - } `json:"lineone"` - 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"` - } `json:"linetwo"` + 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"` } -- cgit 1.4.1