From b73bca142c0107c2552739a8aadda96e92c32554 Mon Sep 17 00:00:00 2001 From: Sylvain Guillet Date: Wed, 2 Oct 2024 21:47:31 +0200 Subject: [PATCH] features/removespicedependencies (#218) * Add bodies factory * Fixes * Upgrade sgp4 --- .../IO.Astrodynamics.CLI.csproj | 2 +- .../Body/BarycenterTests.cs | 4 +- .../Body/CelestialBodyTests.cs | 107 +++++++++++++++++- .../IO.Astrodynamics.Tests/Body/StarTests.cs | 3 +- .../Coordinates/EquatorialTests.cs | 2 +- .../IO.Astrodynamics.Tests/Example.cs | 2 +- .../Maneuvers/LaunchTests.cs | 8 +- .../Math/LagrangeTests.cs | 4 +- .../Mission/ScenarioTests.cs | 4 +- .../EquinoctialElementsTests.cs | 6 +- .../KeplerianElementsTests.cs | 34 +++--- .../OrbitalParameters/StateVectorTests.cs | 38 +++---- .../Propagators/SpacecraftPropagatorTests.cs | 9 +- .../Surface/SiteTests.cs | 8 +- .../IO.Astrodynamics/Body/CelestialBody.cs | 8 +- .../IO.Astrodynamics/Body/CelestialItem.cs | 82 +++++++++++++- .../IO.Astrodynamics/Body/LagrangePoint.cs | 6 +- .../Body/Spacecraft/Instrument.cs | 5 +- .../Body/Spacecraft/RectangularInstrument.cs | 5 +- .../Body/Spacecraft/Spacecraft.cs | 3 +- .../IO.Astrodynamics/Body/Star.cs | 3 +- .../DataProvider/SpiceDataProvider.cs | 2 +- .../IO.Astrodynamics/IO.Astrodynamics.csproj | 11 +- .../IO.Astrodynamics/IO.Astrodynamics.nuspec | 2 +- .../IO.Astrodynamics/Maneuver/Launch.cs | 3 +- .../IO.Astrodynamics/OrbitalParameters/TLE.cs | 6 +- .../Forces/SolarRadiationPressure.cs | 3 +- .../Propagator/SpacecraftPropagator.cs | 2 +- .../SolarSystemObjects/Barycenters.cs | 57 ++++++++-- .../SolarSystemObjects/PlanetsAndMoons.cs | 11 ++ .../SolarSystemObjects/Stars.cs | 8 ++ .../IO.Astrodynamics/Surface/Site.cs | 4 +- .../IO.Astrodynamics/resources/One_Sgp4.dll | Bin 0 -> 56832 bytes 33 files changed, 347 insertions(+), 105 deletions(-) create mode 100644 IO.Astrodynamics.Net/IO.Astrodynamics/resources/One_Sgp4.dll diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.CLI/IO.Astrodynamics.CLI.csproj b/IO.Astrodynamics.Net/IO.Astrodynamics.CLI/IO.Astrodynamics.CLI.csproj index 4db0a73e..6e21c330 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.CLI/IO.Astrodynamics.CLI.csproj +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.CLI/IO.Astrodynamics.CLI.csproj @@ -9,7 +9,7 @@ 0.0.1 true astro - 0.5.0-preview-9 + 0.5.0-preview-10 Astrodynamics command line interface Sylvain Guillet This CLI allows end user to exploit IO.Astrodynamics framework diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/BarycenterTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/BarycenterTests.cs index 91706b3f..f8266f84 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/BarycenterTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/BarycenterTests.cs @@ -14,7 +14,7 @@ public BarycenterTests() [Fact] public void Create() { - var earthbc = new Barycenter(Barycenters.EARTH_BARYCENTER.NaifId); + var earthbc = Barycenters.EARTH_BARYCENTER; Assert.Equal("EARTH BARYCENTER", earthbc.Name); Assert.Equal(3, earthbc.NaifId); Assert.Equal(6.0456262922775433E+24, earthbc.Mass); @@ -25,7 +25,7 @@ public void Create() [Fact] public void Mass() { - var earthbc = new Barycenter(Barycenters.EARTH_BARYCENTER.NaifId); + var earthbc = Barycenters.EARTH_BARYCENTER; Assert.Equal(6.0456262922775433E+24, earthbc.Mass); } } \ No newline at end of file diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/CelestialBodyTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/CelestialBodyTests.cs index 7485e7ee..6af1f752 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/CelestialBodyTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/CelestialBodyTests.cs @@ -21,7 +21,7 @@ public CelestialBodyTests() [Fact] public void Create() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Assert.Equal(399, earth.NaifId); Assert.Equal("EARTH", earth.Name); @@ -154,8 +154,8 @@ public void CelestialBodyToString() [Fact] public void Equality() { - var earth1 = new CelestialBody(PlanetsAndMoons.EARTH); - var earth2 = new CelestialBody(PlanetsAndMoons.EARTH); + var earth1 = PlanetsAndMoons.EARTH_BODY; + var earth2 = PlanetsAndMoons.EARTH_BODY; var moon = new CelestialBody(PlanetsAndMoons.MOON); Assert.Equal(earth1, earth2); Assert.NotEqual(earth1, moon); @@ -172,7 +172,7 @@ public void Equality() [Fact] public void GetEphemeris() { - var earth = new CelestialBody(PlanetsAndMoons.EARTH); + var earth = PlanetsAndMoons.EARTH_BODY; var res = earth.GetEphemeris(new Window(TimeSystem.Time.J2000TDB, TimeSpan.FromDays(1.0)), TestHelpers.Sun, Frames.Frame.ICRF, Aberration.None, TimeSpan.FromDays(1.0)).ToArray(); Assert.Equal(2, res.Length); @@ -416,4 +416,103 @@ public void MarsAirDensity() Assert.Equal(0.015026759563140498, model.GetDensity(0.0)); Assert.Equal(0.0013352044980975983, model.GetDensity(30000.0)); } + + [Fact] + public void FindBarycenterOfMotionId_ReturnsZero_ForSun() + { + var celestialItem = TestHelpers.Sun; + Assert.Equal(0, celestialItem.BarycenterOfMotionId); + } + + [Fact] + public void FindBarycenterOfMotionId_ReturnsZero_ForBarycenter() + { + var celestialItem = new Barycenter(0); + Assert.Equal(0, celestialItem.BarycenterOfMotionId); + } + + [Fact] + public void FindBarycenterOfMotionId_ReturnsZero_ForAsteroid() + { + var celestialItem = new CelestialBody(2000001); + Assert.Equal(0, celestialItem.BarycenterOfMotionId); + } + + [Fact] + public void FindBarycenterOfMotionId_ReturnsCorrectValue_ForPlanet() + { + var celestialItem = TestHelpers.EarthAtJ2000; + Assert.Equal(3, celestialItem.BarycenterOfMotionId); + } + + [Fact] + public void FindBarycenterOfMotionId_ReturnsCorrectValue_ForMoon() + { + var celestialItem = TestHelpers.MoonAtJ2000; + Assert.Equal(3, celestialItem.BarycenterOfMotionId); + } + + [Fact] + public void FindBarycenterOfMotionId_ReturnsCorrectValue_ForLagrangePoint391() + { + var celestialItem = new LagrangePoint(LagrangePoints.L1); + Assert.Equal(3, celestialItem.BarycenterOfMotionId); + } + + [Fact] + public void FindBarycenterOfMotionId_ReturnsZero_ForLagrangePoint394() + { + var celestialItem = new LagrangePoint(LagrangePoints.L4); + Assert.Equal(3, celestialItem.BarycenterOfMotionId); + } + + +[Fact] + public void FindCenterOfMotionId_ReturnsZero_ForBarycenter() + { + var celestialItem = new Barycenter(0); + Assert.Equal(0, celestialItem.CenterOfMotionId); + } + + [Fact] + public void FindCenterOfMotionId_ReturnsTen_ForSun() + { + var celestialItem = TestHelpers.Sun; + Assert.Equal(10, celestialItem.CenterOfMotionId); + } + + [Fact] + public void FindCenterOfMotionId_ReturnsTen_ForPlanet() + { + var celestialItem = TestHelpers.EarthAtJ2000; + Assert.Equal(10, celestialItem.CenterOfMotionId); + } + + [Fact] + public void FindCenterOfMotionId_ReturnsTen_ForAsteroid() + { + var celestialItem = new CelestialBody(2000001); + Assert.Equal(10, celestialItem.CenterOfMotionId); + } + + [Fact] + public void FindCenterOfMotionId_ReturnsCorrectValue_ForMoon() + { + var celestialItem = TestHelpers.MoonAtJ2000; + Assert.Equal(399, celestialItem.CenterOfMotionId); + } + + [Fact] + public void FindCenterOfMotionId_ReturnsCorrectValue_ForLagrangePoint391() + { + var celestialItem = new LagrangePoint(LagrangePoints.L1); + Assert.Equal(10, celestialItem.CenterOfMotionId); + } + + [Fact] + public void FindCenterOfMotionId_ReturnsTen_ForLagrangePoint394() + { + var celestialItem = new LagrangePoint(LagrangePoints.L4); + Assert.Equal(10, celestialItem.CenterOfMotionId); + } } \ No newline at end of file diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/StarTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/StarTests.cs index fa71e8d3..f290c936 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/StarTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Body/StarTests.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using IO.Astrodynamics.Body; using IO.Astrodynamics.Coordinates; +using IO.Astrodynamics.SolarSystemObjects; using IO.Astrodynamics.TimeSystem; using Xunit; @@ -78,7 +79,7 @@ public void GetRightAscensionSigma() public async Task Propagate() { var epoch = new TimeSystem.Time(new DateTime(2001, 1, 1), TimeFrame.TDBFrame); - var observer = new Barycenter(0); + var observer = Barycenters.SOLAR_SYSTEM_BARYCENTER; var star = new Star(1, "star1", 1E+30, "spec", 2, 0.3792, new Equatorial(1, 1, epoch), 0.1, 0.1, 0, 0, 0, 0, epoch); await star.PropagateAsync(new Window(epoch, epoch + TimeSpan.FromDays(365 * 4)), TimeSpan.FromDays(365)); var eph0 = star.GetEphemeris(epoch, observer, Frames.Frame.ICRF, Aberration.None); diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Coordinates/EquatorialTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Coordinates/EquatorialTests.cs index 2289e603..3257a427 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Coordinates/EquatorialTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Coordinates/EquatorialTests.cs @@ -32,7 +32,7 @@ public void CreateFromStateVector() Astrodynamics.Mission.Mission mission = new Astrodynamics.Mission.Mission("mission1"); new Scenario("scn1", mission, new Window(new TimeSystem.Time(new DateTime(2001, 1, 1), TimeFrame.TDBFrame), new TimeSystem.Time(new DateTime(2001, 2, 1), TimeFrame.TDBFrame))); var epoch = new TimeSystem.Time(DateTime.MinValue, TimeFrame.TDBFrame); - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Equatorial eq = new Equatorial(new StateVector( new Vector3(-291608.38463344, -266716.83339423, -76102.48709990), new Vector3(), earth, epoch, Frames.Frame.ICRF)); diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Example.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Example.cs index 5dfb8337..672ae75b 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Example.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Example.cs @@ -14,7 +14,7 @@ public void ReadEphemeris() { //In this example we want the ephemeris of the moon at epoch (2000-01-01T12:00Z) in ICRF frame with earth at center API.Instance.LoadKernels(new DirectoryInfo("Data/SolarSystem"));//replace Data/SolarSytem by your kernel path - var earth = new CelestialBody(PlanetsAndMoons.EARTH); + var earth = PlanetsAndMoons.EARTH_BODY; var moon = new CelestialBody(PlanetsAndMoons.MOON); var ephemerid = moon.GetEphemeris(new TimeSystem.Time(new DateTime(2000, 1, 1, 12, 0, 0), TimeFrame.UTCFrame), earth, Frames.Frame.ICRF, Aberration.None); } diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Maneuvers/LaunchTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Maneuvers/LaunchTests.cs index b913b24b..46251982 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Maneuvers/LaunchTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Maneuvers/LaunchTests.cs @@ -44,7 +44,7 @@ public void FindLaunchWindows() new StateVector(new Vector3(-1.144243683349977E+06, 4.905086030671815E+06, 4.553416875193589E+06), new Vector3(-5.588288926819989E+03, -4.213222250603758E+03, 3.126518392859475E+03), earth, epoch, Frames.Frame.ICRF), IO.Astrodynamics.Constants.CivilTwilight, null); - var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0)), Constants.OutputPath); + var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0))); var launchWindows = res as LaunchWindow[] ?? res.ToArray(); Assert.Equal(2, launchWindows.Count()); var firstWindow = launchWindows.ElementAt(0); @@ -78,7 +78,7 @@ public void FindLaunchWindowsByDay() new StateVector(new Vector3(-1.144243683349977E+06, 4.905086030671815E+06, 4.553416875193589E+06), new Vector3(-5.588288926819989E+03, -4.213222250603758E+03, 3.126518392859475E+03), earth, epoch, Frames.Frame.ICRF), IO.Astrodynamics.Constants.CivilTwilight, true); - var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0)), Constants.OutputPath); + var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0))); Assert.Single(res); var firstWindow = res.ElementAt(0); Assert.Equal(new TimeSystem.Time("2021-06-02T18:11:31.0119753Z"), firstWindow.Window.StartDate.ToUTC(), TestHelpers.TimeComparer); @@ -104,7 +104,7 @@ public void FindSouthLaunchWindowsByDay() new StateVector(new Vector3(-1.144243683349977E+06, 4.905086030671815E+06, 4.553416875193589E+06), new Vector3(-5.588288926819989E+03, -4.213222250603758E+03, 3.126518392859475E+03), earth, epoch, Frames.Frame.ICRF), IO.Astrodynamics.Constants.CivilTwilight, true); - var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0)), Constants.OutputPath); + var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0))); Assert.Single(res); var firstWindow = res.ElementAt(0); Assert.Equal(new TimeSystem.Time("2021-06-02T15:08:24.4541548Z"), firstWindow.Window.StartDate.ToUTC(), TestHelpers.TimeComparer); @@ -129,7 +129,7 @@ public void FindSouthLaunchWindows() new StateVector(new Vector3(-1.144243683349977E+06, 4.905086030671815E+06, 4.553416875193589E+06), new Vector3(-5.588288926819989E+03, -4.213222250603758E+03, 3.126518392859475E+03), earth, epoch, Frames.Frame.ICRF), IO.Astrodynamics.Constants.CivilTwilight, null); - var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0)), Constants.OutputPath); + var res = launch.FindLaunchWindows(new Window(epoch, TimeSpan.FromDays(1.0))); Assert.Equal(2, res.Count()); var firstWindow = res.ElementAt(0); Assert.Equal(new TimeSystem.Time("2021-06-02T08:55:43.6080970z"), firstWindow.Window.StartDate.ToUTC(), TestHelpers.TimeComparer); diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Math/LagrangeTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Math/LagrangeTests.cs index bda4d9fb..d54ad5a2 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Math/LagrangeTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Math/LagrangeTests.cs @@ -58,7 +58,7 @@ public void InterpolateCubic() public void InterpolateStateVectorSquare() { //Interpolate square function - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector[] data = new StateVector[10]; var start = new TimeSystem.Time(2021, 01, 01, 0, 0, 0); for (int i = 0; i < 10; i++) @@ -86,7 +86,7 @@ public void InterpolateStateVectorSquare() public void InterpolateStateVectorCubic() { //Interpolate square function - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector[] data = new StateVector[10]; var start = new TimeSystem.Time(2021, 01, 01, 0, 0, 0); for (int i = 0; i < 10; i++) diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Mission/ScenarioTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Mission/ScenarioTests.cs index cf5799f8..916e6c84 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Mission/ScenarioTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Mission/ScenarioTests.cs @@ -43,7 +43,7 @@ public void AddSite() Scenario scenario = new Scenario("Scenario", mission, new Window(new TimeSystem.Time(2021, 1, 1), new TimeSystem.Time(2021, 1, 2))); Assert.Equal("Scenario", scenario.Name); Assert.Equal(mission, scenario.Mission); - var site = new Site(13, "DSS-13", new CelestialBody(PlanetsAndMoons.EARTH)); + var site = new Site(13, "DSS-13", PlanetsAndMoons.EARTH_BODY); scenario.AddSite(site); Assert.Single(scenario.Sites); Assert.Equal(site, scenario.Sites.First()); @@ -496,7 +496,7 @@ public async Task PropagateStar() { var start = new TimeSystem.Time(2001, 1, 1); var end = start.AddDays(365 * 4); - var observer = new Barycenter(0); + var observer = Barycenters.SOLAR_SYSTEM_BARYCENTER; var star = new Star(2, "star2", 1E+30, "spec", 2, 0.3792, new Equatorial(1, 1, start), 0.1, 0.1, 0, 0, 0, 0, start); Astrodynamics.Mission.Mission mission = new Astrodynamics.Mission.Mission("mission102"); diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/EquinoctialElementsTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/EquinoctialElementsTests.cs index a9661c5f..c219a507 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/EquinoctialElementsTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/EquinoctialElementsTests.cs @@ -17,7 +17,7 @@ public EquinoctialElementsTests() [Fact] public void Create() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; var epoch = new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame); EquinoctialElements equ = new EquinoctialElements(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, earth, epoch, Frames.Frame.ICRF); Assert.Equal(1.0, equ.P); @@ -34,7 +34,7 @@ public void Create() [Fact] public void ToEquinoctial() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(6800.81178582, 0.00134, 51.71 * IO.Astrodynamics.Constants.Deg2Rad, 32.57 * IO.Astrodynamics.Constants.Deg2Rad, 105.64 * IO.Astrodynamics.Constants.Deg2Rad, 46.029 * IO.Astrodynamics.Constants.Deg2Rad, earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -50,7 +50,7 @@ public void ToEquinoctial() [Fact] public void Equality() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(6800.81178582, 0.00134, 51.71 * IO.Astrodynamics.Constants.Deg2Rad, 32.57 * IO.Astrodynamics.Constants.Deg2Rad, 105.64 * IO.Astrodynamics.Constants.Deg2Rad, 46.029 * IO.Astrodynamics.Constants.Deg2Rad, earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/KeplerianElementsTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/KeplerianElementsTests.cs index c64b046f..1f8c3e4b 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/KeplerianElementsTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/KeplerianElementsTests.cs @@ -18,7 +18,7 @@ public KeplerianElementsTests() [Fact] public void Create() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; TimeSystem.Time epoch = new TimeSystem.Time(DateTime.Now, TimeFrame.TDBFrame); KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -66,7 +66,7 @@ public void Create() [Fact] public void ToKeplerian() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; TimeSystem.Time epoch = new TimeSystem.Time(DateTime.Now, TimeFrame.TDBFrame); KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -79,7 +79,7 @@ public void ToKeplerian() [Fact] public void ToStateVector() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(6.800803544958167E+06, 1.353139738203394E-03, 5.171921958517460E+01 * IO.Astrodynamics.Constants.Deg2Rad, @@ -100,7 +100,7 @@ public void ToStateVector() [Fact] public void ToStateVector2() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Astrodynamics.OrbitalParameters.OrbitalParameters ke = new KeplerianElements(6.800803544958167E+06, 1.353139738203394E-03, 5.171921958517460E+01 * IO.Astrodynamics.Constants.Deg2Rad, @@ -145,7 +145,7 @@ public void SingularityZeroEccentricityZeroInclination() [Fact] public void TrueAnomaly10() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -158,7 +158,7 @@ public void TrueAnomaly10() [Fact] public void TrueAnomaly0() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(12800000.0, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -171,7 +171,7 @@ public void TrueAnomaly0() [Fact] public void TrueAnomaly180() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -185,7 +185,7 @@ public void TrueAnomaly180() [Fact] public void TrueAnomaly300() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -198,7 +198,7 @@ public void TrueAnomaly300() [Fact] public void ExcentricityVector() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(7487.36, 0.0918, 0.0, 0.0, 0.0, 0.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -213,7 +213,7 @@ public void ExcentricityVector() [Fact] public void AscendingNodeVector() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(8811.47, 0.228, IO.Astrodynamics.Constants.PI2 * 0.5, 0.0, 0.0, 0.0 * IO.Astrodynamics.Constants.Deg2Rad, earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -227,7 +227,7 @@ public void AscendingNodeVector() [Fact] public void DescendingNodeVector() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(8811.47, 0.228, IO.Astrodynamics.Constants.PI2 * 0.5, 0.0, 0.0, 0.0 * IO.Astrodynamics.Constants.Deg2Rad, earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -241,7 +241,7 @@ public void DescendingNodeVector() [Fact] public void EccentricAnomaly() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -268,7 +268,7 @@ public void SpecificAngularMomentum() [Fact] public void SpecificOrbitalEnergyMomentum() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(6800811.78582, 0.00134, 51.71 * IO.Astrodynamics.Constants.Deg2Rad, @@ -282,7 +282,7 @@ public void SpecificOrbitalEnergyMomentum() [Fact] public void PerigeeVectorAnomaly() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -299,7 +299,7 @@ public void PerigeeVectorAnomaly() [Fact] public void ApogeeVectorAnomaly() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, @@ -316,7 +316,7 @@ public void ApogeeVectorAnomaly() [Fact] public void TrueAnomalyToMeanAnomaly() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; KeplerianElements km0 = new KeplerianElements(20000, 0.3, 0.0, 0.0, 0.0, 0.0, earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -351,7 +351,7 @@ public void TrueAnomalyToMeanAnomaly() [Fact] public void Equality() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; TimeSystem.Time epoch = new TimeSystem.Time(DateTime.Now, TimeFrame.TDBFrame); KeplerianElements ke = new KeplerianElements(20000, 0.5, 30.0 * IO.Astrodynamics.Constants.Deg2Rad, 40.0 * IO.Astrodynamics.Constants.Deg2Rad, diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/StateVectorTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/StateVectorTests.cs index 0cc87e44..3605aebb 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/StateVectorTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/OrbitalParameters/StateVectorTests.cs @@ -19,7 +19,7 @@ public StateVectorTests() [Fact] public void Create() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Vector3 pos = new Vector3(1.0, 2.0, 3.0); Vector3 vel = new Vector3(4.0, 5.0, 6.0); @@ -35,7 +35,7 @@ public void Create() [Fact] public void Inverse() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Vector3 pos = new Vector3(1.0, 2.0, 3.0); Vector3 vel = new Vector3(4.0, 5.0, 6.0); @@ -48,7 +48,7 @@ public void Inverse() [Fact] public void Add() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Vector3 pos = new Vector3(1.0, 2.0, 3.0); Vector3 vel = new Vector3(4.0, 5.0, 6.0); @@ -65,7 +65,7 @@ public void Add() [Fact] public void AddExcept() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Vector3 pos = new Vector3(1.0, 2.0, 3.0); Vector3 vel = new Vector3(4.0, 5.0, 6.0); @@ -81,7 +81,7 @@ public void AddExcept() [Fact] public void Eccentricity() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(-6.116559469556896E+06, -1.546174698676721E+06, 2.521950157430313E+06), new Vector3(-8.078523150700097E+02, -5.477647950892673E+03, -5.297615757935174E+03), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), @@ -92,7 +92,7 @@ public void Eccentricity() [Fact] public void EccentricityVector() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(6800000.0, 0.0, 0.0), new Vector3(0.0, 8000.0, 0.0), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -120,7 +120,7 @@ public void SpecificAngularMomentum() [Fact] public void SpecificOrbitalEnergyMomentum() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(-6.116559469556896E+06, -1.546174698676721E+06, 2.521950157430313E+06), new Vector3(-8.078523150700097E+02, -5.477647950892673E+03, -5.297615757935174E+03), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), @@ -132,7 +132,7 @@ public void SpecificOrbitalEnergyMomentum() [Fact] public void Inclination() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(6800000.0, 0.0, 0.0), new Vector3(0.0, 5000.0, 5000.0), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -142,7 +142,7 @@ public void Inclination() [Fact] public void SemiMajorAxis() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(8000000.0, 0.0, 0.0), new Vector3(0.0, 6000.0, 6000.0), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -152,7 +152,7 @@ public void SemiMajorAxis() [Fact] public void AscendingNodeVector() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(8000000.0, 0.0, 0.0), new Vector3(0.0, 6000.0, 0.0), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -165,7 +165,7 @@ public void AscendingNodeVector() [Fact] public void AscendingNode() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(9208000.0, 3352000, 0.0), new Vector3(-1750, 4830, 5140), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -179,7 +179,7 @@ public void AscendingNode() [Fact] public void ArgumentOfPeriapis() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(8237000.0, 17000.0, 5308000.0), new Vector3(-2000.0, 6000.0, 3000.0), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -195,7 +195,7 @@ public void ArgumentOfPeriapis() [Fact] public void TrueAnomaly() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(5070000.0, -2387000.0, 1430000.0), new Vector3(2450.0, 6350.0, 6440.0), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -211,7 +211,7 @@ public void TrueAnomaly() [Fact] public void EccentricAnomaly() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(6700000.0, 2494000.0, 0.0), new Vector3(-2150.0, 8850.0, 0.0), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), Frames.Frame.ICRF); @@ -222,7 +222,7 @@ public void EccentricAnomaly() [Fact] public void MeanAnomaly() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(-5775.068936894231E+03, -3372.353197848874E+03, 651.695854037289E+03), new Vector3(-0.661469579672604E+03, -7.147573777688288E+03, -2.915719736461653E+03), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), @@ -234,7 +234,7 @@ public void MeanAnomaly() [Fact] public void Period() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(-5775.068936894231E+03, -3372.353197848874E+03, 651.695854037289E+03), new Vector3(-0.661469579672604E+03, -7.147573777688288E+03, -2.915719736461653E+03), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), @@ -246,7 +246,7 @@ public void Period() [Fact] public void MeanMotion() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; StateVector sv = new StateVector(new Vector3(-5775.068936894231E+03, -3372.353197848874E+03, 651.695854037289E+03), new Vector3(-0.661469579672604E+03, -7.147573777688288E+03, -2.915719736461653E+03), earth, new TimeSystem.Time(DateTime.UtcNow, TimeFrame.UTCFrame), @@ -277,7 +277,7 @@ public void ToFrame() [Fact] public void ToNonInertialFrame() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; var epoch = new TimeSystem.Time(2000, 1, 1, 12, 0, 0); var earthFrame = new Frames.Frame(PlanetsAndMoons.EARTH.Frame); @@ -397,7 +397,7 @@ public void RelativeToAndRevert() { var originalSV = new StateVector(new Vector3(6800000.0, 0.0, 0.0), new Vector3(0.0, 8000.0, 0.0), TestHelpers.EarthAtJ2000, TimeSystem.Time.J2000TDB, Frames.Frame.ICRF); - var svSSB = originalSV.RelativeTo(new Barycenter(0), Aberration.None).ToStateVector(); + var svSSB = originalSV.RelativeTo(Barycenters.SOLAR_SYSTEM_BARYCENTER, Aberration.None).ToStateVector(); var svEarth = svSSB.RelativeTo(TestHelpers.EarthAtJ2000, Aberration.None).ToStateVector(); var deltaP = svEarth.Position - originalSV.Position; var deltaV = svEarth.Velocity - originalSV.Velocity; diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Propagators/SpacecraftPropagatorTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Propagators/SpacecraftPropagatorTests.cs index 7c8d0db2..031ff75c 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Propagators/SpacecraftPropagatorTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Propagators/SpacecraftPropagatorTests.cs @@ -6,6 +6,7 @@ using IO.Astrodynamics.Body.Spacecraft; using IO.Astrodynamics.Math; using IO.Astrodynamics.OrbitalParameters; +using IO.Astrodynamics.SolarSystemObjects; using IO.Astrodynamics.TimeSystem; using Xunit; using CelestialBody = IO.Astrodynamics.Body.CelestialBody; @@ -26,10 +27,10 @@ public SpacecraftPropagatorTests() public void CheckSymplecticProperty() { Clock clk = new Clock("My clock", 256); - var orbit = new KeplerianElements(150000000000.0, 0, 0, 0, 0, 0, new Barycenter(0), TimeSystem.Time.J2000TDB, Frames.Frame.ICRF); + var orbit = new KeplerianElements(150000000000.0, 0, 0, 0, 0, 0, Barycenters.SOLAR_SYSTEM_BARYCENTER, TimeSystem.Time.J2000TDB, Frames.Frame.ICRF); Spacecraft spc = new Spacecraft(-1001, "MySpacecraft", 100.0, 10000.0, clk, orbit); Propagator.SpacecraftPropagator spacecraftPropagator = new Propagator.SpacecraftPropagator(new Window(TimeSystem.Time.J2000TDB, TimeSystem.Time.J2000TDB.AddDays(30)), spc, - [new Barycenter(0)], false, false, TimeSpan.FromSeconds(100.0)); + [Barycenters.SOLAR_SYSTEM_BARYCENTER], false, false, TimeSpan.FromSeconds(100.0)); spacecraftPropagator.Propagate(); var energy = spc.StateVectorsRelativeToICRF.Values.Select(x => x.SpecificOrbitalEnergy()).ToArray(); var min = energy.Min(); @@ -42,11 +43,11 @@ public void CheckSymplecticProperty() public void CheckNonFittingStepSize() { Clock clk = new Clock("My clock", 256); - var orbit = new KeplerianElements(150000000000.0, 0, 0, 0, 0, 0, new Barycenter(0), TimeSystem.Time.J2000TDB, Frames.Frame.ICRF); + var orbit = new KeplerianElements(150000000000.0, 0, 0, 0, 0, 0, Barycenters.SOLAR_SYSTEM_BARYCENTER, TimeSystem.Time.J2000TDB, Frames.Frame.ICRF); Spacecraft spc = new Spacecraft(-1001, "MySpacecraft", 100.0, 10000.0, clk, orbit); Propagator.SpacecraftPropagator spacecraftPropagator = new Propagator.SpacecraftPropagator(new Window(TimeSystem.Time.J2000TDB, TimeSystem.Time.J2000TDB.AddSeconds(5)), spc, - [new Barycenter(0)], false, false, TimeSpan.FromSeconds(2.0)); + [Barycenters.SOLAR_SYSTEM_BARYCENTER], false, false, TimeSpan.FromSeconds(2.0)); spacecraftPropagator.Propagate(); var state = spc.StateVectorsRelativeToICRF.Values.ElementAt(0); diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Surface/SiteTests.cs b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Surface/SiteTests.cs index 6420ed91..e21f4cb8 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Surface/SiteTests.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics.Tests/Surface/SiteTests.cs @@ -24,7 +24,7 @@ public SiteTests() public void StateVector() { var epoch = new TimeSystem.Time(2000, 1, 1, 12, 0, 0); - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Site site = new Site(13, "DSS-13", earth); var sv = site.GetEphemeris(epoch, earth, Frames.Frame.ICRF, Aberration.None).ToStateVector(); @@ -119,7 +119,7 @@ public void CreateException() public void GetEphemeris() { var epoch = new TimeSystem.Time(2000, 1, 1, 12, 0, 0); - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Site site = new Site(13, "DSS-13", earth); var sv = site.GetEphemeris(new Window(epoch, epoch + TimeSpan.FromDays(1.0)), earth, Frames.Frame.ICRF, Aberration.None, TimeSpan.FromDays(1.0)) @@ -136,7 +136,7 @@ public void GetEphemeris() [Fact] public void GetPosition() { - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Site site = new Site(13, "DSS-13", earth); var sv = site.InitialOrbitalParameters.ToStateVector().Position; @@ -148,7 +148,7 @@ public void GetPosition() public void GetVelocity() { var epoch = new TimeSystem.Time(2000, 1, 1, 12, 0, 0); - CelestialBody earth = new CelestialBody(PlanetsAndMoons.EARTH); + CelestialBody earth = PlanetsAndMoons.EARTH_BODY; Site site = new Site(13, "DSS-13", earth); var sv = site.GetEphemeris(epoch, earth, Frames.Frame.ICRF, Aberration.None).ToStateVector().Velocity; diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialBody.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialBody.cs index ac5098f6..6da0a8ef 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialBody.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialBody.cs @@ -163,7 +163,7 @@ private void UpdateSphereOfInfluence() return; } - var mainBody = new CelestialBody(ExtendedInformation.CenterOfMotionId); + var mainBody = new CelestialBody(ExtendedInformation.CenterOfMotionId, Frame.ECLIPTIC_J2000, InitialOrbitalParameters.Epoch); var a = this.GetEphemeris(InitialOrbitalParameters.Epoch, mainBody, Frame.ECLIPTIC_J2000, Aberration.None).SemiMajorAxis(); SphereOfInfluence = InitialOrbitalParameters != null ? SphereOfInluence(a, Mass, mainBody.Mass) : double.PositiveInfinity; } @@ -202,7 +202,7 @@ public TimeSpan SideralRotationPeriod(Time epoch) { return TimeSpan.FromSeconds(Constants._2PI / GetOrientation(Frame.ICRF, epoch).AngularVelocity.Magnitude()); } - + public double AngularVelocity(Time epoch) { var siderealRotationPeriod = SideralRotationPeriod(epoch); @@ -233,7 +233,7 @@ public KeplerianElements GeosynchronousOrbit(double longitude, double latitude, /// the orbit perigee is lower than the equatorial radius. public KeplerianElements HelioSynchronousOrbit(double semiMajorAxis, double eccentricity, Time epochAtDescendingNode) { - CelestialBody sun = new CelestialBody(10); + CelestialBody sun = Stars.SUN_BODY; double p = semiMajorAxis * (1 - eccentricity); if (p < EquatorialRadius) { @@ -291,7 +291,7 @@ public TimeSpan TrueSolarDay(Time epoch) throw new InvalidOperationException("At this time, the computation of true solar day works only with planets"); } - CelestialBody sun = new CelestialBody(10); + CelestialBody sun = Stars.SUN_BODY; var sideralRotation = SideralRotationPeriod(epoch); var eph0 = this.GetEphemeris(epoch, sun, Frame.ECLIPTIC_J2000, Aberration.LT).ToStateVector().Position; var eph1 = this.GetEphemeris(epoch + sideralRotation, sun, Frame.ECLIPTIC_J2000, Aberration.LT).ToStateVector().Position; diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialItem.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialItem.cs index 4159062b..8a5c6b33 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialItem.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/CelestialItem.cs @@ -95,7 +95,7 @@ public abstract class CelestialItem : ILocalizable, IEquatable /// /// Gets a value indicating whether the celestial item is a moon. /// - public bool IsMoon => NaifId is > 100 and < 1000 && (NaifId % 100) != 99; + public bool IsMoon => (NaifId is > 100 and < 1000 && (NaifId % 100) != 99) && !IsLagrangePoint; /// /// Gets a value indicating whether the celestial item is an asteroid. @@ -112,6 +112,16 @@ public abstract class CelestialItem : ILocalizable, IEquatable /// public bool IsLagrangePoint => this.NaifId is 391 or 392 or 393 or 394 or 395; + /// + /// Gets the barycenter of motion identifier. + /// + public int BarycenterOfMotionId { get; protected set; } + + /// + /// Gets the center of motion identifier. + /// + public int CenterOfMotionId { get; protected set; } + /// /// Instantiate celestial item from naif id with orbital parameters at given frame and epoch /// @@ -136,9 +146,12 @@ protected CelestialItem(int naifId, Frame frame, in Time epoch, GeopotentialMode ? new GeopotentialGravitationalField(geopotentialModelParameters.GeopotentialModelPath, geopotentialModelParameters.GeopotentialDegree) : new GravitationalField(); - if (NaifId == Barycenters.SOLAR_SYSTEM_BARYCENTER.NaifId) return; + BarycenterOfMotionId = FindBarycenterOfMotionId(this); + CenterOfMotionId = FindCenterOfMotionId(this); + + if (NaifId == 0) return; if (IsPlanet || IsMoon || IsBarycenter || IsSun) - InitialOrbitalParameters = GetEphemeris(epoch, new Barycenter(ExtendedInformation.BarycenterOfMotionId), frame, Aberration.None); + InitialOrbitalParameters = GetEphemeris(epoch, new Barycenter(BarycenterOfMotionId, epoch), frame, Aberration.None); (InitialOrbitalParameters?.Observer as CelestialItem)?._satellites.Add(this); } @@ -151,7 +164,6 @@ protected CelestialItem(int naifId, Frame frame, in Time epoch, GeopotentialMode /// /// /// - /// protected CelestialItem(int naifId, string name, double mass, OrbitalParameters.OrbitalParameters initialOrbitalParameters, GeopotentialModelParameters geopotentialModelParameters = null) { @@ -172,6 +184,9 @@ protected CelestialItem(int naifId, string name, double mass, OrbitalParameters. Mass = mass; GM = mass * Constants.G; InitialOrbitalParameters = initialOrbitalParameters; + + + (InitialOrbitalParameters?.Observer as CelestialBody)?._satellites.Add(this); GravitationalField = geopotentialModelParameters != null ? new GeopotentialGravitationalField(geopotentialModelParameters.GeopotentialModelPath, geopotentialModelParameters.GeopotentialDegree) @@ -199,7 +214,7 @@ internal void RemoveSatellite(CelestialItem celestialItem) /// public IEnumerable GetEphemeris(in Window searchWindow, ILocalizable observer, Frame frame, Aberration aberration, in TimeSpan stepSize) { - var occurences = (int)System.Math.Ceiling(searchWindow.Length / stepSize) + 1; + var occurences = (int)((searchWindow.Length / stepSize)+1); var ephemeris = new List(occurences); for (int i = 0; i < occurences; i++) { @@ -370,12 +385,67 @@ public Vector3 EvaluateGravitationalAcceleration(OrbitalParameters.OrbitalParame return GravitationalField.ComputeGravitationalAcceleration(sv); } - + public void WriteEphemeris(FileInfo outputFile) { API.Instance.WriteEphemeris(outputFile, this, _stateVectorsRelativeToICRF.Values.ToArray()); } + internal static int FindBarycenterOfMotionId(CelestialItem celestialItem) + { + if (celestialItem.IsSun || celestialItem.IsBarycenter || celestialItem.IsAsteroid) + { + return 0; + } + + if (celestialItem.IsPlanet || celestialItem.IsMoon) + { + return (int)(celestialItem.NaifId / 100); + } + + if (celestialItem.IsLagrangePoint) + { + if (celestialItem.NaifId is 391 or 392) + { + return (int)(celestialItem.NaifId / 100); + } + + return 0; + } + + throw new ArgumentException("Invalid Naif Id : " + celestialItem.NaifId); + } + + internal static int FindCenterOfMotionId(CelestialItem celestialItem) + { + if (celestialItem.IsBarycenter) + { + return 0; + } + + if (celestialItem.IsSun || celestialItem.IsPlanet || celestialItem.IsAsteroid) + { + return 10; + } + + if (celestialItem.IsMoon) + { + return celestialItem.NaifId - (celestialItem.NaifId % 100) + 99; + } + + if (celestialItem.IsLagrangePoint) + { + if (celestialItem.NaifId is 391 or 392) + { + return (int)(celestialItem.NaifId / 100); + } + + return 10; + } + + throw new ArgumentException("Invalid Naif Id : " + celestialItem.NaifId); + } + #region FindWindows diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/LagrangePoint.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/LagrangePoint.cs index 466fa2ad..36de5a52 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/LagrangePoint.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/LagrangePoint.cs @@ -16,7 +16,7 @@ public class LagrangePoint : CelestialItem /// The NAIF object representing the celestial system. public LagrangePoint(NaifObject systemObject) : this(systemObject, TimeSystem.Time.J2000TDB) { - this.InitialOrbitalParameters = GetEphemeris(TimeSystem.Time.J2000TDB, new Barycenter(Barycenters.EARTH_BARYCENTER.NaifId), Frame.ECLIPTIC_J2000, Aberration.None); + } /// @@ -26,6 +26,8 @@ public LagrangePoint(NaifObject systemObject) : this(systemObject, TimeSystem.Ti /// The epoch time for the Lagrange point. public LagrangePoint(NaifObject systemObject, Time epoch) : base(systemObject.NaifId, systemObject.Name, 0.0, null) { - this.InitialOrbitalParameters = GetEphemeris(epoch, new Barycenter(Barycenters.EARTH_BARYCENTER.NaifId), Frame.ECLIPTIC_J2000, Aberration.None); + this.InitialOrbitalParameters = GetEphemeris(epoch, Barycenters.EARTH_BARYCENTER, Frame.ECLIPTIC_J2000, Aberration.None); + BarycenterOfMotionId = 3; + CenterOfMotionId = 10; } } \ No newline at end of file diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Instrument.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Instrument.cs index 3ef85f1a..ad06ffb5 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Instrument.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Instrument.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using IO.Astrodynamics.Frames; using IO.Astrodynamics.Math; +using IO.Astrodynamics.SolarSystemObjects; using IO.Astrodynamics.TimeSystem; namespace IO.Astrodynamics.Body.Spacecraft @@ -173,8 +174,8 @@ public virtual bool IsInFOV(Time date, ILocalizable target, Aberration aberratio protected (double azimuth, double elevation, bool isInFov) PositionInFOV(Time date, ILocalizable target, Aberration aberration) { - var cameraPostion = Spacecraft.GetEphemeris(date, new Barycenter(0), Frame.ICRF, aberration).ToStateVector(); - var objectPosition = target.GetEphemeris(date, new Barycenter(0), Frame.ICRF, aberration).ToStateVector(); + var cameraPostion = Spacecraft.GetEphemeris(date, Barycenters.SOLAR_SYSTEM_BARYCENTER, Frame.ICRF, aberration).ToStateVector(); + var objectPosition = target.GetEphemeris(date, Barycenters.SOLAR_SYSTEM_BARYCENTER, Frame.ICRF, aberration).ToStateVector(); // Calculate the vector from the camera to the object // Compute the vector from the camera to the object Vector3 toObject = objectPosition.Position - cameraPostion.Position; diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/RectangularInstrument.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/RectangularInstrument.cs index 0cd93f69..cf413deb 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/RectangularInstrument.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/RectangularInstrument.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using IO.Astrodynamics.Frames; using IO.Astrodynamics.Math; +using IO.Astrodynamics.SolarSystemObjects; using IO.Astrodynamics.TimeSystem; namespace IO.Astrodynamics.Body.Spacecraft; @@ -22,8 +23,8 @@ internal RectangularInstrument(Spacecraft spacecraft, int naifId, string name, s } public override bool IsInFOV(Time date, ILocalizable target, Aberration aberration) { - var cameraPostion = Spacecraft.GetEphemeris(date, new Barycenter(0), Frame.ICRF, aberration).ToStateVector(); - var objectPosition = target.GetEphemeris(date, new Barycenter(0), Frame.ICRF, aberration).ToStateVector(); + var cameraPostion = Spacecraft.GetEphemeris(date, Barycenters.SOLAR_SYSTEM_BARYCENTER, Frame.ICRF, aberration).ToStateVector(); + var objectPosition = target.GetEphemeris(date, Barycenters.SOLAR_SYSTEM_BARYCENTER, Frame.ICRF, aberration).ToStateVector(); // Calculate the vector from the camera to the object Vector3 toObject = objectPosition.Position - cameraPostion.Position; diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Spacecraft.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Spacecraft.cs index 6d5c480a..e2141af0 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Spacecraft.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Spacecraft/Spacecraft.cs @@ -8,6 +8,7 @@ using IO.Astrodynamics.Math; using IO.Astrodynamics.OrbitalParameters; using IO.Astrodynamics.Propagator; +using IO.Astrodynamics.SolarSystemObjects; using IO.Astrodynamics.TimeSystem; using StateOrientation = IO.Astrodynamics.OrbitalParameters.StateOrientation; @@ -374,7 +375,7 @@ public override OrbitalParameters.OrbitalParameters GetGeometricStateFromICRF(in { if (_stateVectorsRelativeToICRF.Count < 2) { - return this.InitialOrbitalParameters.ToStateVector(date).RelativeTo(new Barycenter(0), Aberration.None).ToFrame(Frames.Frame.ICRF).ToStateVector(); + return this.InitialOrbitalParameters.ToStateVector(date).RelativeTo(Barycenters.SOLAR_SYSTEM_BARYCENTER, Aberration.None).ToFrame(Frames.Frame.ICRF).ToStateVector(); } return Lagrange.Interpolate(_stateVectorsRelativeToICRF.Values.OrderBy(x => x.Epoch).ToArray(), date); diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Star.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Star.cs index 62fc4ccf..a0157b3d 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Star.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Body/Star.cs @@ -6,6 +6,7 @@ using IO.Astrodynamics.Frames; using IO.Astrodynamics.Math; using IO.Astrodynamics.OrbitalParameters; +using IO.Astrodynamics.SolarSystemObjects; using IO.Astrodynamics.TimeSystem; namespace IO.Astrodynamics.Body; @@ -181,7 +182,7 @@ public Task PropagateAsync(Window timeWindow, TimeSpan stepSize) for (Time epoch = timeWindow.StartDate; epoch <= timeWindow.EndDate; epoch += stepSize) { var position = GetEquatorialCoordinates(epoch).ToCartesian(); - _stateVectorsRelativeToICRF.Add(epoch,new StateVector(position, Vector3.Zero, new Barycenter(0), epoch, Frame.ICRF)); + _stateVectorsRelativeToICRF.Add(epoch,new StateVector(position, Vector3.Zero, Barycenters.SOLAR_SYSTEM_BARYCENTER, epoch, Frame.ICRF)); } }); } diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/DataProvider/SpiceDataProvider.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/DataProvider/SpiceDataProvider.cs index 2758224b..684b4006 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/DataProvider/SpiceDataProvider.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/DataProvider/SpiceDataProvider.cs @@ -21,7 +21,7 @@ public StateOrientation FrameTransformationToICRF(in Time date, Frame source) public OrbitalParameters.OrbitalParameters GetEphemerisFromICRF(in Time date, ILocalizable target, Frame frame, Aberration aberration) { - return API.Instance.ReadEphemeris(date, new Barycenter(0), target, frame, aberration); + return API.Instance.ReadEphemeris(date, Barycenters.SOLAR_SYSTEM_BARYCENTER, target, frame, aberration); } CelestialBody IDataProvider.GetCelestialBodyInfo(int naifId) diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.csproj b/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.csproj index 48cf6219..1436a550 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.csproj +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.csproj @@ -54,6 +54,10 @@ Always + + + Always + @@ -69,7 +73,12 @@ - + + + + + resources\One_Sgp4.dll + diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.nuspec b/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.nuspec index 6060c403..41df20f9 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.nuspec +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/IO.Astrodynamics.nuspec @@ -4,7 +4,7 @@ IO.Astrodynamics Sylvain Guillet Sylvain Guillet - 6.0.0-preview-9 + 6.0.0-preview-10 Astrodynamics framework images\dragonfly-dark-trans.png docs\README.md diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Maneuver/Launch.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Maneuver/Launch.cs index 6ee9d0ba..a07a6bd5 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Maneuver/Launch.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Maneuver/Launch.cs @@ -49,9 +49,8 @@ public Launch(LaunchSite launchSite, Site recoverySite, OrbitalParameters.Orbita /// Find launch windows based on launch's constraints in the given window /// /// - /// /// - public IEnumerable FindLaunchWindows(in Window searchWindow, DirectoryInfo outputDirectory) + public IEnumerable FindLaunchWindows(in Window searchWindow) { //return API.Instance.FindLaunchWindows(this, searchWindow, outputDirectory); var date = searchWindow.StartDate; diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/OrbitalParameters/TLE.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/OrbitalParameters/TLE.cs index 1ed43625..e6a4deef 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/OrbitalParameters/TLE.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/OrbitalParameters/TLE.cs @@ -63,7 +63,7 @@ public class TLE : OrbitalParameters, IEquatable /// The third line of the TLE. /// Thrown when the frame is null. /// Thrown when any of the lines are null or empty. - public TLE(string line1, string line2, string line3) : base(new CelestialBody(PlanetsAndMoons.EARTH), Time.J2000TDB, new Frame("TEME")) + public TLE(string line1, string line2, string line3) : base(PlanetsAndMoons.EARTH_BODY, Time.J2000TDB, new Frame("TEME")) { if (string.IsNullOrEmpty(line1)) throw new ArgumentException("Value cannot be null or empty.", nameof(line1)); if (string.IsNullOrEmpty(line2)) throw new ArgumentException("Value cannot be null or empty.", nameof(line2)); @@ -77,7 +77,7 @@ public class TLE : OrbitalParameters, IEquatable EpochTime ep = new EpochTime(_tleItem.getEpochYear(), _tleItem.getEpochDay()); Epoch = new Time(ep.toDateTime(), TimeFrame.UTCFrame); - var earth = new CelestialBody(PlanetsAndMoons.EARTH); + var earth = PlanetsAndMoons.EARTH_BODY; var revDay = _tleItem.getMeanMotion(); double n = Constants._2PI / (86400.0 / revDay); _a = System.Math.Cbrt(earth.GM / (n * n)); @@ -115,7 +115,7 @@ public override StateVector ToStateVector(Time date) List resultDataList = sgp4.getResults(); var position = resultDataList[0].getPositionData(); var velocity = resultDataList[0].getVelocityData(); - return new StateVector(new Vector3(position.x, position.y, position.z) * 1000.0, new Vector3(velocity.x, velocity.y, velocity.z) * 1000.0, new CelestialBody(399), date, + return new StateVector(new Vector3(position.x, position.y, position.z) * 1000.0, new Vector3(velocity.x, velocity.y, velocity.z) * 1000.0, PlanetsAndMoons.EARTH_BODY, date, new Frame("TEME")).ToFrame(Frame.ICRF).ToStateVector(); } diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/Forces/SolarRadiationPressure.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/Forces/SolarRadiationPressure.cs index b53d470a..f34630b6 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/Forces/SolarRadiationPressure.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/Forces/SolarRadiationPressure.cs @@ -3,13 +3,14 @@ using IO.Astrodynamics.Body; using IO.Astrodynamics.Body.Spacecraft; using IO.Astrodynamics.OrbitalParameters; +using IO.Astrodynamics.SolarSystemObjects; using Vector3 = IO.Astrodynamics.Math.Vector3; namespace IO.Astrodynamics.Propagator.Forces; public class SolarRadiationPressure : ForceBase { - private readonly CelestialBody _sun = new CelestialBody(10); + private readonly CelestialBody _sun = Stars.SUN_BODY; private readonly double _areaMassRatio; private readonly double _term1; private readonly IEnumerable _occultingBodies; diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/SpacecraftPropagator.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/SpacecraftPropagator.cs index 103723cb..d1d5d7e1 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/SpacecraftPropagator.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Propagator/SpacecraftPropagator.cs @@ -43,7 +43,7 @@ public class SpacecraftPropagator : IPropagator public SpacecraftPropagator(in Window window, Spacecraft spacecraft, IEnumerable additionalCelestialBodies, bool includeAtmosphericDrag, bool includeSolarRadiationPressure, TimeSpan deltaT) { - var ssb = new Barycenter(Barycenters.SOLAR_SYSTEM_BARYCENTER.NaifId); + var ssb = Barycenters.SOLAR_SYSTEM_BARYCENTER; Spacecraft = spacecraft ?? throw new ArgumentNullException(nameof(spacecraft)); if (spacecraft.InitialOrbitalParameters.Frame != Frames.Frame.ICRF && spacecraft.InitialOrbitalParameters.Frame != Frames.Frame.B1950 diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Barycenters.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Barycenters.cs index 53cc646f..d92febc2 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Barycenters.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Barycenters.cs @@ -1,17 +1,54 @@ // Copyright 2023. Sylvain Guillet (sylvain.guillet@tutamail.com) +using System.Collections.Generic; +using System.Linq; +using IO.Astrodynamics.Body; + namespace IO.Astrodynamics.SolarSystemObjects; public static class Barycenters { - public static NaifObject SOLAR_SYSTEM_BARYCENTER = new(0, "SOLAR SYSTEM BARYCENTER", string.Empty); - public static NaifObject MERCURY_BARYCENTER = new(1, "MERCURY BARYCENTER", string.Empty); - public static NaifObject VENUS_BARYCENTER = new(2, "VENUS BARYCENTER", string.Empty); - public static NaifObject EARTH_BARYCENTER = new(3, "EARTH MOON BARYCENTER", string.Empty); - public static NaifObject MARS_BARYCENTER = new(4, "MARS BARYCENTER", string.Empty); - public static NaifObject JUPITER_BARYCENTER = new(5, "JUPITER BARYCENTER", string.Empty); - public static NaifObject SATURN_BARYCENTER = new(6, "SATURN BARYCENTER", string.Empty); - public static NaifObject URANUS_BARYCENTER = new(7, "URANUS BARYCENTER", string.Empty); - public static NaifObject NEPTUNE_BARYCENTER = new(8, "NEPTUNE BARYCENTER", string.Empty); - public static NaifObject PLUTO_BARYCENTER = new(9, "PLUTO BARYCENTER", string.Empty); + public static Barycenter SOLAR_SYSTEM_BARYCENTER; + public static Barycenter MERCURY_BARYCENTER; + public static Barycenter VENUS_BARYCENTER; + public static Barycenter EARTH_BARYCENTER; + public static Barycenter MARS_BARYCENTER; + public static Barycenter JUPITER_BARYCENTER; + public static Barycenter SATURN_BARYCENTER; + public static Barycenter URANUS_BARYCENTER; + public static Barycenter NEPTUNE_BARYCENTER; + public static Barycenter PLUTO_BARYCENTER; + + static Barycenters() + { + SOLAR_SYSTEM_BARYCENTER = new Barycenter(0); + MERCURY_BARYCENTER = new Barycenter(1); + VENUS_BARYCENTER = new Barycenter(2); + EARTH_BARYCENTER = new Barycenter(3); + MARS_BARYCENTER = new Barycenter(4); + JUPITER_BARYCENTER = new Barycenter(5); + SATURN_BARYCENTER = new Barycenter(6); + URANUS_BARYCENTER = new Barycenter(7); + NEPTUNE_BARYCENTER = new Barycenter(8); + PLUTO_BARYCENTER = new Barycenter(9); + } + + public static IEnumerable GetBarycenters() + { + return new[] + { + SOLAR_SYSTEM_BARYCENTER, MERCURY_BARYCENTER, VENUS_BARYCENTER, EARTH_BARYCENTER, MARS_BARYCENTER, JUPITER_BARYCENTER, SATURN_BARYCENTER, URANUS_BARYCENTER, + NEPTUNE_BARYCENTER, PLUTO_BARYCENTER + }; + } + + public static Barycenter GetBarycenter(int id) + { + return GetBarycenters().FirstOrDefault(b => b.NaifId == id); + } + + public static Barycenter GetBarycenter(string name) + { + return GetBarycenters().FirstOrDefault(b => b.Name == name); + } } \ No newline at end of file diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/PlanetsAndMoons.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/PlanetsAndMoons.cs index faf5d824..4554bda5 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/PlanetsAndMoons.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/PlanetsAndMoons.cs @@ -1,5 +1,7 @@ // Copyright 2023. Sylvain Guillet (sylvain.guillet@tutamail.com) +using IO.Astrodynamics.Body; + namespace IO.Astrodynamics.SolarSystemObjects; public static class PlanetsAndMoons @@ -165,4 +167,13 @@ public static class PlanetsAndMoons public static NaifObject HYDRA = new(903, "HYDRA", "IAU_HYDRA"); public static NaifObject KERBEROS = new(904, "KERBEROS", "IAU_KERBEROS"); public static NaifObject STYX = new(905, "STYX", "IAU_STYX"); + + public static CelestialBody EARTH_BODY; + public static CelestialBody MOON_BODY; + + static PlanetsAndMoons() + { + EARTH_BODY = new CelestialBody(EARTH); + MOON_BODY = new CelestialBody(MOON); + } } \ No newline at end of file diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Stars.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Stars.cs index 5769f036..941207a8 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Stars.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/SolarSystemObjects/Stars.cs @@ -1,8 +1,16 @@ // Copyright 2023. Sylvain Guillet (sylvain.guillet@tutamail.com) +using IO.Astrodynamics.Body; + namespace IO.Astrodynamics.SolarSystemObjects; public static class Stars { public static NaifObject Sun = new(10, "SUN", "IAU_SUN"); + public static CelestialBody SUN_BODY; + + static Stars() + { + SUN_BODY = new CelestialBody(Sun); + } } \ No newline at end of file diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/Surface/Site.cs b/IO.Astrodynamics.Net/IO.Astrodynamics/Surface/Site.cs index e4a3ecb5..54761ffb 100644 --- a/IO.Astrodynamics.Net/IO.Astrodynamics/Surface/Site.cs +++ b/IO.Astrodynamics.Net/IO.Astrodynamics/Surface/Site.cs @@ -176,7 +176,7 @@ public OrbitalParameters.OrbitalParameters GetGeometricStateFromICRF(in Time dat return _dataProvider.GetEphemerisFromICRF(dt, this, Frames.Frame.ICRF, Aberration.None).ToStateVector(); } - return GetEphemeris(dt, new Barycenter(0), Frames.Frame.ICRF, Aberration.None).ToStateVector(); + return GetEphemeris(dt, Barycenters.SOLAR_SYSTEM_BARYCENTER, Frames.Frame.ICRF, Aberration.None).ToStateVector(); }); } @@ -475,7 +475,7 @@ public void WriteEphemeris(Window window, FileInfo outputFile) public IEnumerable FindDayWindows(in Window searchWindow, double twilight) { - var sun = new CelestialBody(10); + var sun = Stars.SUN_BODY; return FindWindowsOnIlluminationConstraint(searchWindow, sun, IlluminationAngle.Incidence, RelationnalOperator.Lower, Constants.PI2 + twilight, 0.0, Aberration.LTS, TimeSpan.FromMinutes(1.0), sun); } diff --git a/IO.Astrodynamics.Net/IO.Astrodynamics/resources/One_Sgp4.dll b/IO.Astrodynamics.Net/IO.Astrodynamics/resources/One_Sgp4.dll new file mode 100644 index 0000000000000000000000000000000000000000..86e1acb56385935ae1e18e585bd5f533d8b91aae GIT binary patch literal 56832 zcmeFad3+qjwJ%G&*|KFDTas76lDuN@hBrndh#5;`TUgSF8QIt# z8cYI&5C|rOH4AGXAq$WT1j6P(!jiCs8@7aiSwbKQ2}uaqSl;)Xs_y9?%i-SNeSiGk z`#gcG>YO@t>eQ)Irrc8vRU;wZ7rl_)WFygN_D zDW(Dxt4j5me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