One_Sgp4 1.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package One_Sgp4 --version 1.0.9
NuGet\Install-Package One_Sgp4 -Version 1.0.9
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="One_Sgp4" Version="1.0.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add One_Sgp4 --version 1.0.9
#r "nuget: One_Sgp4, 1.0.9"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install One_Sgp4 as a Cake Addin
#addin nuget:?package=One_Sgp4&version=1.0.9

// Install One_Sgp4 as a Cake Tool
#tool nuget:?package=One_Sgp4&version=1.0.9

one_Sgp4

Introduction

This library calculates the orbits of satellites via TLEs data from the web. Other functions for coordination transformation, time calculations and the calculation of contact windows depending on the observers coordinates on earth are also available.

This library was created since I could not find a c# library with the necessary functions that I required. The calculations for the orbit propagations are based on the SpaceTrack Report 3. Other Calculations for Time and coordination transformations were taken from [Dr. T.S. Kelso website] (http://celestrak.com/columns/).

Installing via NuGet

The easiest way to install One_Sgp4 is via NuGet.

In Visual Studio's Package Manager Console, enter the following command:

Install-Package One_Sgp4

Manually

Download the latest dll file here and import it into youre project.

Usage

A more complete Example can be found in the OneSGP4_Example Project.

Example TLE for ISS:

0 UME 1 (ISS 1)
1  8709U 76019A   17083.91463156 +.00000030 +00000-0 +91115-4 0  9995
2  8709 069.6748 319.8382 0011306 339.5223 102.9699 13.71383337054833

This is can be done using the parser or creating a new TLE element Manually The Parser can be given the TLE lines as a string

Tle tleItem = ParserTLE.parseTle(
                "1  8709U 76019A   17083.91463156 +.00000030 +00000-0 +91115-4 0  9995",
                "2  8709 069.6748 319.8382 0011306 339.5223 102.9699 13.71383337054833",
                "ISS 1");

or one can give a txt-file containing a large list of TLE-Data

List<Tle> tleList = ParserTLE.ParseFile("PATH_TO_TLE.txt");

To calculate the Orbit positiont of the object in question the start and stop times need to be defined. These Epoch Times should be given in UTC-Time.

EpochTime startTime = new EpochTime(DateTime.UtcNow());
EpochTime stopTime = new EpochTime(2017,100.5); (Year 2017, 100 day at 12:00 HH)
//Add 15 Seconds to EpochTime
anotherTime.addTick(15);
//Add 20 Min to EpochTime
anotherTime.addMinutes(20);
//Add 1 hour to EpochTime
anotherTime.addHours(1);
//Add 2 Days to EpochTime
anotherTime.addDays(2);

The calculation are then done using the SGP4 class with the TLE-data and the WGS-Constant (1 = WGS84; 0 = WGS72) with WGS84 being standard. The propagator will calculate from the starting time to the defined end time. Each step of the calculation can be defined from up to minutes or even seconds and lower. The results can be then retrived containing the Positon (X,Y,Z) and its Velocity (X_dot, Y_dot, Z_dot)

One_Sgp4.Sgp4 sgp4Propagator = new Sgp4(tleItem, Int<WGSCONSTANT>);
sgp4Propagator.runSgp4Cal(startTime, stopTime, Double<calculation step in minutes>);
List<One_Sgp4.Sgp4Data> resultDataList = new List<Sgp4Data>();
resultDataList = sgp4Propagator.getRestults();

It is also possible to calculate the position of the Satellite at a single timepoint

Sgp4Data satellitePos = getSatPositionAtTime(satellite, epoch, wgs);

Other Functions

Furthermore it is possible to calculate if a satellite will be visible from the ground at a certain location and time. For this one has to set a location of the observer on earth.

Coordinate of an observer on Ground latitude, longitude, height(in meters)

  One_Sgp4.Coordinate observer = new Coordinate(35.554595, 18.888574, 0);

Convert to ECI (Earth Centerd Inertial) coordinate system

  One_Sgp4.Point3d eci = observer.toECI(startTime.getLocalSiderealTime());

Get Local SiderealTime for Observer

  double localSiderealTime = startTime.getLocalSiderealTime(observer.getLongitude());

To Calculate the SubPoint of Satellite on ground

One_Sgp4.Coordinate satOnGround = One_Sgp4.SatFunctions.calcSatSubPoint(startTime, resultDataList[0], Sgp4.wgsConstant.WGS_84);

Check if a satellite is currently visible

bool satelliteIsVisible = One_Sgp4.SatFunctions.isSatVisible(observer, 0.0, startTime, satellitePos);

Calculate the Spherical Coordinates from an Observer to a Satelite. This will return a 3D-Point that contains the following information range from the point to the satellite in km, the Azimuth in radians and the Elevation in radians.

One_Sgp4.Point3d spherical = One_Sgp4.SatFunctions.calcSphericalCoordinate(observer, startTime, resultDataList[0]);

To Calculate the upcomming passes of the satellite for the next 5 days

List<Pass> passes = One_Sgp4.SatFunctions.CalculatePasses(observer, tleISS, new EpochTime(DateTime.UtcNow), 15, 5, Sgp4.wgsConstant.WGS_84);

License: MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 281 2/16/2024
1.0.15 1,453 11/1/2022
1.0.13 2,915 11/13/2020
1.0.12 1,599 6/7/2020
1.0.11 1,169 1/21/2020
1.0.10 1,103 12/30/2019
1.0.9 1,139 8/15/2019
1.0.8 2,096 4/23/2019
1.0.7 1,149 4/7/2019
1.0.6 1,102 4/7/2019
1.0.5 1,307 12/2/2018
1.0.4 1,225 10/31/2018
1.0.3 1,326 9/5/2018
1.0.2 1,528 4/15/2018
1.0.1 1,467 3/11/2018
1.0.0 1,492 3/6/2018

Included Net 4.0 and Net 4.5 as TargetFrameworks