/* Implementing the "Two-line element set (TLE)", a data format encoding orbital elements of Earth-orbiting objects. More information can be found here: - https://en.wikipedia.org/wiki/Two-line_element_set - https://spaceflight.nasa.gov/realdata/sightings/SSapplications/Post/JavaSSOP/SSOP_Help/tle_def.html */ package TLE // TLE defines the lines contained in a Two-Line-Element type TLE struct { TitleLine TitleLine `json:"titleline"` LineOne LineOne `json:"lineone"` LineTwo LineTwo `json:"linetwo"` } // NewTLE returns a pointer to a TLE struct filled with the given Lines func NewTLE(titleLine TitleLine, lineOne LineOne, lineTwo LineTwo) *TLE { return &TLE{TitleLine: titleLine, LineOne: lineOne, LineTwo: lineTwo} } // TitleLine defines the first line in the the TLE // It contains the name of the satellite type TitleLine struct { Satname string `json:"satname"` } // LineOne defines the first line in the TLE type LineOne struct { Linenumber int8 `json:"linenumber"` // Catalog number defined by USSPACECOM // A "U" indicates an unclassified object SatelliteNumber int `json:"satellitenumber"` Classification rune `json:"classification"` InternationalDesignator InternationalDesignator `json:"internationaldesignator"` Epoch Epoch `json:"epoch"` Firstderiv float64 `json:"firstderiv"` Secondderiv float64 `json:"secondderiv"` BSTAR float64 `json:"BSTAR"` Numberzero int8 `json:"numberzero"` ElementSetNumber int `json:"elementesetnumber"` Checksum int8 `json:"checksum"` } // InternationalDesignator stores information about the satellite such as when it launched type InternationalDesignator struct { // Last two digits of launch year Launchyear int8 `json:"launchyear"` // Launch number of the year Launchnumber int `json:"launchnumber"` // Piece of the launch Launchpiece rune `json:"launchpiece"` } // Epoch defines a moment in time type Epoch struct { // Last two digits of the year Year int8 `json:"year"` // day of the year and fractional portion of the day Dayfraction float64 `json:"dayfraction"` } 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"` }