Documentation ¶
Overview ¶
Package tle implementing the "Two-line element set (TLE)", a data format encoding orbital elements of Earth-orbiting objects.
More information can be found in the wikipedia article: (https://en.wikipedia.org/wiki/Two-line_element_set) and in the official NASA documentation: (https://spaceflight.nasa.gov/realdata/sightings/SSapplications/Post/JavaSSOP/SSOP_Help/tle_def.html)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Epoch ¶
type Epoch struct { // Last two digits of the year Year int `json:"year"` // day of the year and fractional portion of the day Dayfraction float64 `json:"dayfraction"` }
Epoch defines a moment in time
type InternationalDesignator ¶
type InternationalDesignator struct { // Last two digits of launch year Launchyear int `json:"launchyear"` // Launch number of the year Launchnumber int `json:"launchnumber"` // Piece of the launch Launchpiece string `json:"launchpiece"` }
InternationalDesignator stores information about the satellite such as when it launched
type LineOne ¶
type LineOne struct { Linenumber int `json:"linenumber"` // Catalog number defined by USSPACECOM // A "U" indicates an unclassified object SatelliteNumber int `json:"satellitenumber"` Classification string `json:"classification"` // International Designator containing information about the launch InternationalDesignator InternationalDesignator `json:"internationaldesignator"` // Epoch defining from when the TLE is Epoch Epoch `json:"epoch"` // First Time Derivative of the Mean Motion divided by two // Unit: revs / day // "catch all" drag term used in SGP4 USSPACECOM predictor Firstderiv float64 `json:"firstderiv"` // Second Time Derivative of Mean Motion divided by six (decimal point assumed) // second order drag term in the SGP4 // Unit: revs / day^3 // A leading decimal must be applied to this value // The last two characters define an applicable power of 10 (12345-5 = 0.0000012345) Secondderiv float64 `json:"secondderiv"` // Drag Term // (67960-4 = 0.000067960) // Unit: earth radii^-1 // The last two characters define an applicable power of 10 BSTAR float64 `json:"BSTAR"` // The number 0 (originally this should have been "Ephemeris type") Numberzero int `json:"numberzero"` // Element set number. Incremented when a new TLE is generated for this object. ElementSetNumber int `json:"elementesetnumber"` // Checksum (modulo 10) Checksum int `json:"checksum"` }
LineOne defines the first line in the TLE
type LineTwo ¶
type LineTwo struct { Linenumber int `json:"linenumber"` // Catalog number defined by USSPACECOM SatelliteNumber int `json:"satellitenumber"` // Inclination // Unit: degrees // Angle between the equator and the orbit plane Inclination float64 `json:"inclination"` // Right Ascension of the Ascending Node // Unit: degrees // Angle between vernal equinox and the point where the orbit crosses the equatorial plane (going north). RightAscensionOfTheAscendingNode float64 `json:"rightascensionoftheascendingnode"` // Eccentricity // Constant defining the shape of the orbit (0=circular, Less than 1=elliptical). // The value provided is the mean eccentricity. // A leading decimal must be applied to this value Eccentricity float64 `json:"eccentricity"` // Argument of perigee // Unit: degrees // The angle between the ascending node and the orbit's point of closest approach of the earth (perigee) ArgumentOfPerigee float64 `json:"argumentofperigee"` // Mean Anomaly // Unit: degrees // The angle, measured from perigee, of the satellite location in the orbit referenced to a circular orbit // with radius equal to the semi-major axis. MeanAnomaly float64 `json:"meananomaly"` // Mean Motion // The value is the mean number of orbits per day the object completes. There are 8 digits after the decimal, // leaving no trailing space(s) when the following element exceeds 9999. MeanMotion float64 `json:"meanmotion"` // The orbit number at Epoch Time. This time is chosen very near the time of true ascending node passage as // a matter of routine. The last digit is the check sum for line 2. RevolutionNumberAtEpoch int `json:"revolutionnumberatepoch"` // Checksum (modulo 10) Checksum int `json:"checksum"` }
LineTwo of the TLE
type TLE ¶
type TLE struct { TitleLine TitleLine `json:"titleline"` LineOne LineOne `json:"lineone"` LineTwo LineTwo `json:"linetwo"` }
TLE defines the lines contained in a Two-Line-Element
func NewTLE ¶
NewTLE creates a new TLE object from a given TLE string
Example ¶
var RawTLE = `ISS (ZARYA) 1 25544U 98067A 19229.39083552 .00000228 00000-0 11917-4 0 9993 2 25544 51.6447 57.6210 0007373 294.0868 138.8050 15.50381554184754` TLE, err := NewTLE(RawTLE) if err != nil { fmt.Println(err) } // convert the TLE to json b, err := json.MarshalIndent(TLE, "", " ") if err != nil { fmt.Println("error: ", err) } _, err = os.Stdout.Write(b) if err != nil { fmt.Println("error: ", err) }
Output: { "titleline": { "satname": "ISS (ZARYA) " }, "lineone": { "linenumber": 1, "satellitenumber": 25544, "classification": "U", "internationaldesignator": { "launchyear": 98, "launchnumber": 67, "launchpiece": "A" }, "epoch": { "year": 19, "dayfraction": 229.39083552 }, "firstderiv": 0.00000228, "secondderiv": 0, "BSTAR": 0.000011917, "numberzero": 0, "elementesetnumber": 999, "checksum": 3 }, "linetwo": { "linenumber": 2, "satellitenumber": 25544, "inclination": 51.6447, "rightascensionoftheascendingnode": 57.621, "eccentricity": 7373, "argumentofperigee": 294.0868, "meananomaly": 138.805, "meanmotion": 15.50381554, "revolutionnumberatepoch": 18475, "checksum": 4 } }