+
Skip to content

gavineadie/SatelliteUtilities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SatelliteUtilities

Beware: under construction .. API will change)

SatelliteKit

This package requires SatelliteKit, a library, written in Swift, implementing the SGP4/SDP4 earth-orbiting satellite propagation algorithms first published in the SpaceTrack Report #3 and later refined by Vallado et al in Revisiting Spacetrack Report #3.

SatelliteKit propagates the path of an earth-orbiting satellite based on information provided in a standard form read from a file or network source. That provides the satellite's an approximation of the seven classical orbital elements, plus additional data need to cope with perturbations to that classical orbit caused by atmospheric drag. In SatelliteKit these elements are:

    public let t: Double                   // the t=0 epoch time
    public let e: Double                   // Eccentricity
    public let i: Double                   // Inclination (radians).
    public let ω: Double                   // Argument of perigee (radians).
    public let Ω: Double                   // Right Ascension of Ascending node (radians).
    public let M: Double                   // Mean anomaly (radians).
    public var n: Double = 0.0             // Mean motion (radians/min)

A Satellite is created from these Elements and that is what is propagated by SatelliteKit.


SatelliteUtilities

SatelliteKit is dedicated to propagation, but more is need to ease its use.

The data for Elements is often obtained from the Celestrak, a source of such data, now a website, that had been in operation for forty years. That data is available for various groups of satellites in various formats. SatelliteUtilities provides ways to access that information and make it available for in SatelliteKit.

Change Notes

At the end of the README. Lastest change: Version/Tag 0.1.3 -- (2025 May 19)

ElementsGroup

For example:

    if let elementsGroup = await downloadTLEs(
        "https://celestrak.org/NORAD/elements/gp.php?GROUP=visual&FORMAT=tle",
        named: "brightest.tle") {
        guard let issElements = elementsGroup.norad(25544)
                        else { print("no elements with norad# 25544"); return }
        print(issElements.debugDescription())
    }

A TLE (two line element) file from the Celestrak group called "visual" contains elements for the 100-plus brightest satellites. The code above:

  • call the downloadTLEs function to read the data from the website into an ElementsGroup
  • extracts the Elements for the International Space Station (NORAD ID: 25544)
  • prints a summary of the ISS Elements A Satellite can be constructed from the Elements
   let issSatellite = Satellite(issElements)

and propagated with SatelliteKit functions.

ElementsStore

Well behaved applications will not want to reach out to Celestrak every time satellite information is needed. First, the Celestrak data is refreshed only a few times a day so it's very unlikely to change over minutes or even a few hours and, secondly, Celestrak is a widely used resource and it's only polite to not hit it more than necessary.

To this end, SatelliteUtilities provides a way to keep a local store of downloaded files.

    let store = ElementsStore()                         
    store.insertElements(elementsGroup,
                         named: "visual-tles-net")        

    let elements = store.extractElements(named: "visual-tles-net")     
  • creates an ElementsStore
  • call the insertElements function to write Elements into the store
  • and reads them back.

version/tag 0.1.3 .. (2015 May 19)

  • Minor corrections.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载