### Manage SPICE Kernels (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Demonstrates how to interact with the SPICE system via the singleton API instance. This includes loading and unloading kernels from a specified path, retrieving a list of loaded kernels, and getting the SPICE toolkit version. It requires the IO.Astrodynamics namespace and FileSystemInfo for path handling. ```csharp // Load all kernels from a directory API.Instance.LoadKernels(new DirectoryInfo("kernels/")); // Check loaded kernels foreach (var kernel in API.Instance.GetLoadedKernels()) Console.WriteLine(kernel); ``` -------------------------------- ### Build and Install Astrodynamics Project using CMake (Bash) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/wiki/Home This snippet outlines the steps to clone the Astrodynamics repository, navigate into its directory, create a release build directory, configure the CMake project, build the project with parallel compilation, and finally install the libraries and includes. The build process utilizes CMake and specifies the number of threads for compilation. Installation requires administrator privileges. ```bash #Clone project git clone https://github.com/IO-Aerospace-software-engineering/Astrodynamics.git #Go into directory cd Astrodynamics #Create build directory mkdir build_release #Go into build directory cd build_release #Configure Cmake projectcmake -DCMAKE_BUILD_TYPE=Release .. #Build project #-j 4 option is used to define how many threads could be used to compile project, is this example will use 4 threads cmake --build . --config Release --target IO.Astrodynamics -j 4 #Install libraries and includes #This command must be executed with admin rights cmake --install IO.Astrodynamics ``` -------------------------------- ### In-Memory Data Provider Setup (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Configures the astrodynamics library to use an in-memory data provider for testing purposes, bypassing the need for SPICE kernels. Allows adding celestial body information, state vectors, and orientation data. ```csharp // For testing without SPICE kernels var memoryProvider = new MemoryDataProvider(); Configuration.Instance.SetDataProvider(memoryProvider); memoryProvider.AddCelestialBodyInfo(customEarth); memoryProvider.AddStateVector(399, epoch, earthState); ``` -------------------------------- ### Install IO.Astrodynamics CLI Tool Source: https://github.com/io-aerospace-software-engineering/astrodynamics/wiki/Home Shows the command to install the IO.Astrodynamics Command Line Interface (CLI) tool globally. This allows you to use the framework's functionalities directly from your terminal. ```bash dotnet tool install --global IO.Astrodynamics.CLI ``` -------------------------------- ### Start Time Property Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/functions_s.html Defines the start time for various entities like observation windows or time ranges. ```APIDOC ## start ### Description Gets or sets the start time of an interval or event. ### Method `getter`/`setter` ### Endpoint N/A (Class Property) ### Parameters - **start** (DateTime) - The start time value. ### Request Example ```javascript // For AzimuthRangeDTO let azRange = new IO.Astrodynamics.API.DTO.AzimuthRangeDTO(); azRange.start = new IO.Astrodynamics.Time.DateTime(2023, 10, 27, 10, 0, 0); // For WindowDTO let window = new IO.Astrodynamics.API.DTO.WindowDTO(); window.start = new IO.Astrodynamics.Time.DateTime(2023, 10, 27, 10, 0, 0); ``` ### Response #### Success Response (N/A) - **start** (DateTime) - The start time. #### Response Example ```json { "start": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Time Window Operations (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Demonstrates the usage of the Window class, which represents a time interval. Windows can be created from start and end times or a start time and duration. Examples include retrieving the window's duration, checking for intersections with other windows or specific times, and merging overlapping windows. ```csharp var window = new Window( new Time(2024, 1, 1), new Time(2024, 1, 31) ); Console.WriteLine($"Duration: {window.Length.TotalDays} days"); // Check intersection var t = new Time(2024, 1, 15); if (window.Intersects(t)) Console.WriteLine("Time is within window"); ``` -------------------------------- ### Document Ready and Initialize Menu (JavaScript) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/structIO_1_1SDK_1_1API_1_1DTO_1_1WindowDTO-members.html Sets up the documentation's navigation menu and search functionality when the document is ready. It calls `initMenu` and `init_search` functions, common in Doxygen-generated sites. ```javascript $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); ``` -------------------------------- ### Get Maneuver Window (C++) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Maneuvers_1_1ManeuverBase.html Gets the time window during which the maneuver itself is active, from the start of the burn to its completion. This defines the operational period of the maneuver. ```C++ IO::SDK::Time::Window* IO::SDK::Maneuvers::ManeuverBase::GetManeuverWindow() const ``` -------------------------------- ### Initialize Navigation Tree and Resizable Elements (JavaScript) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/structIO_1_1SDK_1_1API_1_1DTO_1_1AzimuthRangeDTO-members.html Sets up the navigation tree and enables resizable elements within the documentation interface. This is a standard Doxygen setup script. ```javascript $(document).ready(function(){ initNavTree('structIO_1_1SDK_1_1API_1_1DTO_1_1AzimuthRangeDTO.html',''); initResizable(); }); ``` -------------------------------- ### Get Window Start Date - C++ Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Time_1_1Window.html Retrieves the starting point of the time window. This method is templated and belongs to the IO::SDK::Time::Window class. ```cpp template T IO::SDK::Time::Window::GetStartDate() const inline ``` -------------------------------- ### POST /api/launch Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/Proxy_8h.html Evaluates launch windows based on provided launch criteria. ```APIDOC ## POST /api/launch ### Description Evaluates launch windows. ### Method POST ### Endpoint /api/launch ### Parameters #### Request Body - **launchDto** (IO::Astrodynamics::API::DTO::LaunchDTO) - Required - Object containing launch parameters. ### Response #### Success Response (200) - **void** - This endpoint does not return a specific value upon success, indicating the launch window evaluation was processed. #### Response Example ```json { "example": "" } ``` ``` -------------------------------- ### Get Maneuver Window Information Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Maneuvers_1_1ApogeeHeightChangingManeuver.html Retrieves the maneuver window, defined as the time from burn start to maneuver completion. This is a core property for scheduling and executing maneuvers. ```C++ IO::SDK::Time::TimeSpan GetManeuverWindow() const ``` -------------------------------- ### C# - Integrator and Propagator Setup Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/md_IO_SDK_API_todo.html Illustrates how to set up and configure the integrator and propagator for simulating spacecraft trajectories. This involves defining time spans and integration steps. ```csharp using IO.Aerospace.Software.Engineering.Astrodynamics.Propagation; public class PropagatorSetup { public void ConfigurePropagator(Spacecraft spacecraft) { var integrator = new Integrator(TimeStep.Seconds(60)); var propagator = new Propagator(integrator); // Further configuration... } } ``` -------------------------------- ### IO.Astrodynamics.TimeSystem Window Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Represents a time interval, supporting creation, merging, intersection checks, and retrieving properties like start date, end date, and length. ```APIDOC ## IO.Astrodynamics.TimeSystem Window Represents a time interval. ### Constructors / Methods - **Window(Time start, Time end)**: Create from start and end times. - **Window(Time start, TimeSpan duration)**: Create from start time and duration. - **StartDate**: Get start time. - **EndDate**: Get end time. - **Length**: Get window duration. - **Merge(Window other)**: Merge two overlapping windows. - **Intersects(Window other)**: Check if windows overlap. - **Intersects(Time time)**: Check if time is within window. - **GetIntersection(Window other)**: Get overlapping portion. ### Example ```csharp var window = new Window( new Time(2024, 1, 1), new Time(2024, 1, 31) ); Console.WriteLine($"Duration: {window.Length.TotalDays} days"); // Check intersection var t = new Time(2024, 1, 15); if (window.Intersects(t)) Console.WriteLine("Time is within window"); ``` ``` -------------------------------- ### Loading SPICE Kernels in C# Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/CLAUDE.md Illustrates how to load SPICE kernels, which are essential for astronomical calculations, particularly in test environments. This code snippet shows the initialization of the API instance and the loading of the solar system kernel using a defined path. ```csharp API.Instance.LoadKernels(Constants.SolarSystemKernelPath); ``` -------------------------------- ### C++ - Integrator and Propagator Setup Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/md_IO_SDK_API_todo.html Demonstrates the C++ approach to initializing and utilizing integrators and propagators for astrodynamics simulations. Requires appropriate library includes. ```cpp #include "Integrator.h" #include "Propagator.h" #include "Spacecraft.h" void ConfigurePropagatorCPP(IO::Aerospace::Software::Engineering::Astrodynamics::Spacecraft& spacecraft) { IO::Aerospace::Software::Engineering::Astrodynamics::Integrator integrator(60.0); // 60 seconds IO::Aerospace::Software::Engineering::Astrodynamics::Propagator propagator(integrator); // Further configuration... } ``` -------------------------------- ### Get Maneuver Window in C++ Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK/Maneuvers/ManeuverBase.h.gcov.html Retrieves the overall maneuver window, starting from the burn initiation and ending upon maneuver completion. Returns a pointer to a Time::Window object in TDB. ```cpp IO::SDK::Time::Window *GetManeuverWindow() const; ``` -------------------------------- ### C++ Orbital Parameters and Integration Setup Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK.Tests/PropagatorTests.cpp.gcov.html This snippet demonstrates setting up orbital parameters using TLE data and initializing a TLE integrator. It involves creating an OrbitalParameters object from TLE lines, defining a time step, and initializing a TLEIntegrator. Dependencies include IO::SDK::OrbitalParameters, IO::SDK::Time, and IO::SDK::Integrators. ```cpp std::unique_ptr tle = std::make_unique(earth, lines); IO::SDK::Time::TimeSpan step{60s}; IO::SDK::Integrators::TLEIntegrator integrator(*tleIntegrator, step); ``` -------------------------------- ### Get Maneuver Window (C++) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1Astrodynamics_1_1Maneuvers_1_1Attitudes_1_1NadirAttitude.html Retrieves the maneuver window. This window defines the start and end times of the maneuver, from burn initiation to completion. It is part of the ManeuverBase class. ```cpp IO::Astrodynamics::Time::Window< IO::Astrodynamics::Time::TDB >* GetManeuverWindow() const ``` -------------------------------- ### Get Maneuver Window - C++ Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1Astrodynamics_1_1Maneuvers_1_1Attitudes_1_1ProgradeAttitude.html Retrieves the overall maneuver window. This window spans from the start of the burn to the completion of the maneuver. It provides the total duration of the maneuver event. ```cpp IO::Astrodynamics::Time::Window GetManeuverWindow() const ``` -------------------------------- ### LaunchWindow Constructor - C++ Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1Astrodynamics_1_1Maneuvers_1_1LaunchWindow.html Constructs a LaunchWindow object with specified launch site, time window, and various azimuth and velocity parameters. Requires IO::Astrodynamics::Sites::LaunchSite, IO::Astrodynamics::Time::Window, and double values for azimuths and velocities. ```cpp #include IO::Astrodynamics::Maneuvers::LaunchWindow::LaunchWindow( const IO::Astrodynamics::Sites::LaunchSite &launchSite, const IO::Astrodynamics::Time::Window &window, double inertialAzimuth, double nonInertialAzimuth, double inertialInsertionVelocity, double nonInertialInsertionVelocity ) { // Constructor implementation details } ``` -------------------------------- ### LaunchSite Class: Managing Launch Azimuth Constraints Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Illustrates the usage of the LaunchSite class, which is a specialized site for launch operations. It shows how to create a LaunchSite with defined allowed azimuth ranges and how to check if a given launch azimuth is permitted. ```csharp var launchSite = new LaunchSite(100, "MyLaunchSite", earth, new[] { new AzimuthRange(45 * Constants.Deg2Rad, 135 * Constants.Deg2Rad) }); if (launchSite.IsAzimuthAllowed(90 * Constants.Deg2Rad)) Console.WriteLine("East launch is allowed"); ``` -------------------------------- ### Get Intersection of Two Time Windows (C++) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/Window_8h_source.html Calculates the overlapping period between the current window and another provided window. If the windows do not intersect, it throws an SDKException. The intersection is defined by the maximum of the start times and the minimum of the end times. ```cpp Window GetIntersection(const Window &window) const { if (!Intersects(window)) { throw IO::Astrodynamics::Exception::SDKException("Windows don't intersect"); } T min = m_start > window.m_start ? m_start : window.m_start; T max = m_end < window.m_end ? m_end : window.m_end; return Window(min, max); } ``` -------------------------------- ### Get Equatorial Coordinates for Celestial Body (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Demonstrates how to retrieve and display the Right Ascension and Declination of a celestial body using its ephemeris data. Requires the CelestialBody class and associated ephemeris calculation methods. ```csharp var moon = new CelestialBody(PlanetsAndMoons.MOON); var sv = moon.GetEphemeris(epoch, earth, Frames.Frame.ICRF, Aberration.None).ToStateVector(); var eq = sv.ToEquatorial(); Console.WriteLine($"RA: {eq.RightAscension * Constants.Rad2Deg:F4}°"); Console.WriteLine($"Dec: {eq.Declination * Constants.Rad2Deg:F4}°"); ``` -------------------------------- ### POST /api/kernels/load Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/Proxy_8h.html Loads SPICE kernels from a specified directory. ```APIDOC ## POST /api/kernels/load ### Description Loads kernels from a specified directory. ### Method POST ### Endpoint /api/kernels/load ### Parameters #### Request Body - **path** (string) - Required - The path to the directory containing the kernels. ### Response #### Success Response (200) - **boolean** - True if kernels were loaded successfully, false otherwise. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Get Celestial Body Ephemeris with IO.Astrodynamics Source: https://context7.com/io-aerospace-software-engineering/astrodynamics/llms.txt This C# example shows how to retrieve the position and velocity of celestial bodies at a given epoch and reference frame. It utilizes the IO.Astrodynamics library for accurate ephemeris data. ```csharp using IO.Astrodynamics.Body; using IO.Astrodynamics.SolarSystemObjects; using IO.Astrodynamics.TimeSystem; using IO.Astrodynamics.Frames; // Create celestial body instances var earth = new CelestialBody(PlanetsAndMoons.EARTH); var moon = new CelestialBody(PlanetsAndMoons.MOON); // Define epoch var epoch = new Time(new DateTime(2000, 1, 1, 12, 0, 0), TimeFrame.UTCFrame); // Get Moon's state vector relative to Earth in ICRF frame var ephemeris = moon.GetEphemeris(epoch, earth, Frames.Frame.ICRF, Aberration.None); Console.WriteLine($"Position: {ephemeris.Position}"); Console.WriteLine($"Velocity: {ephemeris.Velocity}"); Console.WriteLine($"Distance: {ephemeris.Position.Magnitude()} m"); ``` -------------------------------- ### Planetodetic Class: Defining Geodetic Coordinates Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Provides an example of creating Planetodetic coordinate objects, which represent longitude, latitude, and altitude. This class is used to define specific locations on a celestial body's surface. ```csharp // Create geodetic coordinates var coords = new Planetodetic( longitude: -122.0 * Constants.Deg2Rad, latitude: 37.0 * Constants.Deg2Rad, altitude: 100.0 ); ``` -------------------------------- ### Atmospheric Model Usage in C# Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/CLAUDE.md Demonstrates the usage of atmospheric models with different levels of context. The first example shows a simple case using only altitude, while the second illustrates a full context with time, position, and space weather data for more accurate calculations. It highlights the creation of `AtmosphericContext` and instantiation of `EarthStandardAtmosphere` and `Nrlmsise00Model`. ```csharp var context = AtmosphericContext.FromAltitude(altitude); var model = new EarthStandardAtmosphere(); double density = model.GetDensity(context); var context = new AtmosphericContext { Altitude = altitude, Epoch = epoch, GeodeticLatitude = latitude, GeodeticLongitude = longitude }; var spaceWeather = new SpaceWeather { F107 = 150, F107A = 150, Ap = 4 }; var model = new Nrlmsise00Model(spaceWeather); double density = model.GetDensity(context); ``` -------------------------------- ### Show CLI Help (.NET CLI) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/README.md Builds and displays the help information for the IO.Astrodynamics Command Line Interface (CLI). This is useful for understanding the available commands and their options. ```bash dotnet run --project IO.Astrodynamics.Net/IO.Astrodynamics.CLI -- --help ``` -------------------------------- ### Get Maneuver Window Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Maneuvers_1_1Attitudes_1_1NadirAttitude.html Retrieves the maneuver window, which defines the start and end times of a maneuver. The window begins at the burn initiation and concludes when the maneuver is completed. This function returns a IO::SDK::Time::Window object. ```cpp IO::SDK::Time::Window GetManeuverWindow() const ``` -------------------------------- ### LaunchSite Class Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/namespaceIO_1_1SDK_1_1Sites.html Documentation for the LaunchSite class, which defines properties and behaviors of a launch site. ```APIDOC ## class IO::SDK::Sites::LaunchSite ### Description Represents a specific launch site, including its geographical location, operational status, and associated facilities. This class is fundamental for planning and simulating space launches. ### Details [More information available here](classIO_1_1SDK_1_1Sites_1_1LaunchSite.html#details) ``` -------------------------------- ### Get Spacecraft Clock Coverage Window - C++ Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK/Kernels/SpacecraftClockKernel.cpp.gcov.html Retrieves the time window (start and end times) for which the spacecraft clock kernel is valid. This function is important for understanding the temporal coverage of a given kernel. It uses SPICE functions scpart_c and sct2e_c. ```cpp IO::SDK::Time::Window IO::SDK::Kernels::SpacecraftClockKernel::GetCoverageWindow() const { SpiceDouble pstart[1]; SpiceDouble pstop[1]; SpiceInt nparts; scpart_c(m_spacecraft.GetId(), &nparts, pstart, pstop); double tdbStart; double tdbEnd; sct2e_c(m_spacecraft.GetId(), pstart[0], &tdbStart); sct2e_c(m_spacecraft.GetId(), pstop[0], &tdbEnd); return IO::SDK::Time::Window(IO::SDK::Time::TDB(std::chrono::duration(tdbStart)), IO::SDK::Time::TDB(std::chrono::duration(tdbEnd))); } ``` -------------------------------- ### Initialize Documentation UI (JavaScript) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Frames_1_1SiteFrameFile-members.html Initializes the navigation tree and resizable elements for the documentation interface. This is a common pattern in generated documentation to provide an interactive user experience. ```javascript $(document).ready(function(){initNavTree('classIO_1_1SDK_1_1Frames_1_1SiteFrameFile.html',''); initResizable(); }); ``` -------------------------------- ### Get Atmospheric Properties using EarthStandardAtmosphere (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Shows how to utilize the EarthStandardAtmosphere model to retrieve temperature, pressure, and density at a given altitude. This model is based on the U.S. Standard Atmosphere 1976. An AtmosphericContext object is required to specify the altitude. ```csharp var model = new EarthStandardAtmosphere(); var context = AtmosphericContext.FromAltitude(10000); // 10 km var temp = model.GetTemperature(context); // °C var pressure = model.GetPressure(context); // kPa var density = model.GetDensity(context); // kg/m³ ``` -------------------------------- ### IO::SDK::Sites Namespace Reference Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/namespaceIO_1_1SDK_1_1Sites.html Overview of the IO::SDK::Sites namespace and its contained classes. ```APIDOC ## IO::SDK::Sites Namespace Reference ### Description This namespace contains classes for managing launch site data within the astrodynamics framework. ### Classes - **LaunchSite**: Represents a launch site with relevant properties and methods. - **Site**: A general class for site information. ### Details Refer to the individual class documentation for more information: - [LaunchSite](classIO_1_1SDK_1_1Sites_1_1LaunchSite.html#details) - [Site](classIO_1_1SDK_1_1Sites_1_1Site.html#details) ### Generated By This documentation was generated using Doxygen version 1.9.4. ``` -------------------------------- ### Get Engine from Spacecraft (C++) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK.Tests/SpacecraftTests.cpp.gcov.html This snippet demonstrates the setup for testing the retrieval of an engine from a spacecraft object. It initializes a celestial body and spacecraft, preparing for subsequent engine-related operations or checks. The code is written in C++ and uses the IO::SDK library. ```cpp const auto earth = std::make_shared(399, "earth"); std::unique_ptr orbitalParams = std::make_unique(earth, IO::SDK::Math::Vector3D(1.0, 2.0, 3.0), IO::SDK::Math::Vector3D(4.0, 5.0, 6.0), IO::SDK::Time::TDB(100.0s), IO::SDK::Frames::InertialFrames::GetICRF()); IO::SDK::Body::Spacecraft::Spacecraft s{-1, "sptest", 1000.0, 3000.0, "ms01", std::move(orbitalParams)}; ``` -------------------------------- ### Construct Site Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Sites_1_1LaunchSite-members.html Constructor for the IO::SDK::Sites::Site class. Initializes a site with an ID, name, geodetic coordinates, celestial body, and directory path. ```cpp IO::SDK::Sites::Site::Site( int id, std::string name, const IO::SDK::Coordinates::Geodetic &coordinates, std::shared_ptr< IO::SDK::Body::CelestialBody > body, std::string directoryPath ); ``` -------------------------------- ### Construct Launch Site Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Sites_1_1LaunchSite-members.html Constructor for the IO::SDK::Sites::LaunchSite class. Initializes a launch site with an ID, name, geodetic coordinates, celestial body, and a path to its directory. ```cpp IO::SDK::Sites::LaunchSite::LaunchSite( int id, const std::string &name, const IO::SDK::Coordinates::Geodetic &coordinates, std::shared_ptr< IO::SDK::Body::CelestialBody > body, std::string directoryPath ); ``` -------------------------------- ### Get Thrust Window - C++ Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/ManeuverBase_8h_source.html Retrieves the time window during which thrust is applied for a maneuver. This method returns a pointer to an IO::Astrodynamics::Time::Window object, which specifies the start and end times of the thrust phase. It is part of the ManeuverBase class, indicating a fundamental maneuver property. ```cpp [[nodiscard]] IO::Astrodynamics::Time::Window *GetThrustWindow() const; ``` -------------------------------- ### Get Ephemeris Coverage Window using SPICE Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK/Kernels/EphemerisKernel.cpp.gcov.html Retrieves the time window during which ephemeris data is available for a given spacecraft. This function uses `spkcov_c` and `wnfetd_c` from the SPICE toolkit to query the coverage. It returns a `Window` object representing the start and end times of the coverage. ```cpp #include #include #include #include #include IO::SDK::Time::Window IO::SDK::Kernels::EphemerisKernel::GetCoverageWindow() const { SPICEDOUBLE_CELL(cover, 2); spkcov_c(m_filePath.c_str(), m_spacecraft.GetId(), &cover); double start; double end; wnfetd_c(&cover, 0, &start, &end); return IO::SDK::Time::Window(IO::SDK::Time::TDB(std::chrono::duration(start)), IO::SDK::Time::TDB(std::chrono::duration(end))); } ``` -------------------------------- ### Launch API Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/Proxy_8h_source.html API for launch computations. ```APIDOC ## POST /launch ### Description Performs launch computations based on provided launch data. ### Method POST ### Endpoint /launch ### Parameters #### Request Body - **launchDto** ([LaunchDTO]) - Required - A LaunchDTO object containing the necessary data for the launch computation. ### Request Example ```json { "launchDto": { "site": { "latitude": 34.0, "longitude": -118.0, "altitude": 100.0 }, "target": "Mars", "launchEpoch": 1678886400.0, "launchWindow": 3600.0, "maxAltitude": 500000.0 } } ``` ### Response #### Success Response (200) - **result** (any) - The result of the launch computation. The specific structure depends on the computation performed. #### Response Example ```json { "result": { "trajectory": [ // ... trajectory data ], "success": true } } ``` ``` -------------------------------- ### Load Solar System Kernels using C++ and SPICE Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK/Kernels/SolarSystemKernelsLoader.cpp.gcov.html This C++ code snippet demonstrates the constructor for the SolarSystemKernelsLoader class. It first checks if the directory specified by IO::SDK::Parameters::SolarSystemKernelPath exists. If not, it creates the directory. Then, it iterates through all files in the directory and loads them as SPICE kernels using the `furnsh_c` function. Dependencies include ``, ``, and ``. The input is the directory path for kernels, and the output is the loaded kernels within the SPICE system. ```cpp #include "SolarSystemKernelsLoader.h" #include #include #include IO::SDK::Kernels::SolarSystemKernelsLoader IO::SDK::Kernels::SolarSystemKernelsLoader::m_instance{}; IO::SDK::Kernels::SolarSystemKernelsLoader::SolarSystemKernelsLoader() { if (!std::filesystem::exists(IO::SDK::Parameters::SolarSystemKernelPath)) { std::filesystem::create_directories(IO::SDK::Parameters::SolarSystemKernelPath); } for (const auto& entry : std::filesystem::directory_iterator(IO::SDK::Parameters::SolarSystemKernelPath)) { furnsh_c(entry.path().string().c_str()); } } ``` -------------------------------- ### Get Atmospheric Density using Nrlmsise00Model (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Illustrates the use of the Nrlmsise00Model for calculating atmospheric density at high altitudes (up to 2000+ km). This empirical model requires space weather data (F10.7, F10.7A, Ap) and an AtmosphericContext which includes altitude, epoch, and geodetic coordinates. ```csharp var spaceWeather = new SpaceWeather { F107 = 150, F107A = 150, Ap = 4 }; var model = new Nrlmsise00Model(spaceWeather); var context = new AtmosphericContext { Altitude = 400000, // 400 km Epoch = new Time(2024, 6, 21, 12, 0, 0), GeodeticLatitude = 0, GeodeticLongitude = 0 }; var density = model.GetDensity(context); Console.WriteLine($"Density at 400 km: {density:E3} kg/m³"); ``` -------------------------------- ### Site Class: Creating and Using Observation Sites Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Demonstrates how to create Site objects, either from SPICE data or with explicit coordinates. It also shows how to retrieve horizontal coordinates (azimuth, elevation, range) and find visibility windows for celestial bodies. The Site class is fundamental for ground-based observation simulations. ```csharp var earth = PlanetsAndMoons.EARTH_BODY; // Create site from SPICE data (DSS-13 Goldstone) var goldstone = new Site(13, "DSS-13", earth); // Create site with explicit coordinates var mySite = new Site(100, "MySite", earth, new Planetodetic( longitude: -117.0 * Constants.Deg2Rad, latitude: 34.0 * Constants.Deg2Rad, altitude: 1000.0 // meters )); // Get horizontal coordinates to Moon var epoch = new Time(2024, 1, 1, 12, 0, 0); var moon = new CelestialBody(PlanetsAndMoons.MOON); var horizontal = mySite.GetHorizontalCoordinates(epoch, moon, Aberration.LT); Console.WriteLine($"Azimuth: {horizontal.Azimuth * Constants.Rad2Deg:F2}°"); Console.WriteLine($"Elevation: {horizontal.Elevation * Constants.Rad2Deg:F2}°"); Console.WriteLine($"Range: {horizontal.Range / 1000:F0} km"); // Find visibility windows var windows = mySite.FindWindowsOnDistanceConstraint( new Window(new Time(2024, 1, 1), new Time(2024, 1, 2)), moon, RelationnalOperator.Less, 400000000, Aberration.LT, TimeSpan.FromMinutes(10)); ``` -------------------------------- ### Compute Earth's Position Relative to Sun in C# Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Example of computing the state vector (position and velocity) of Earth relative to the Sun at a specific epoch. This uses the IO.Astrodynamics framework to access ephemeris data, specifying the target body, reference frame, and aberration correction. ```csharp using IO.Astrodynamics; using IO.Astrodynamics.Body; using IO.Astrodynamics.TimeSystem; using IO.Astrodynamics.SolarSystemObjects; // Load kernels API.Instance.LoadKernels(new DirectoryInfo("Data/SolarSystem")); // Create celestial bodies var earth = PlanetsAndMoons.EARTH_BODY; var sun = new CelestialBody(Stars.Sun); // Define epoch var epoch = new Time(2024, 6, 21, 12, 0, 0); // Get Earth's state vector relative to the Sun var stateVector = earth.GetEphemeris(epoch, sun, Frames.Frame.ICRF, Aberration.None) .ToStateVector(); Console.WriteLine($"Position: {stateVector.Position}"); Console.WriteLine($"Velocity: {stateVector.Velocity}"); ``` -------------------------------- ### Initialize Search and Navigation for IO-SDK Documentation Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/structIO_1_1SDK_1_1API_1_1DTO_1_1QuaternionDTO-members.html This JavaScript code initializes the search functionality and navigation tree for the IO-SDK documentation. It relies on jQuery's document ready event to ensure the DOM is fully loaded before execution. No external libraries beyond jQuery are explicitly mentioned as dependencies. ```javascript /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */ ``` -------------------------------- ### Solve Lambert Problem for Transfer Orbits (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Demonstrates how to use the LambertSolver to find orbital transfer trajectories between two points in space. It requires initial and target orbital parameters, the central celestial body, and optionally the maximum number of revolutions. The example shows how to obtain the departure and arrival velocities. ```csharp var earth = PlanetsAndMoons.EARTH_BODY; var epoch = new Time(2024, 1, 1); // Define departure and arrival states var departure = new StateVector(...); var arrival = new StateVector(...); // Solve Lambert problem var solver = new LambertSolver(); var result = solver.Solve(false, departure, arrival, earth, 0); // Get zero-revolution solution var solution = result.GetZeroRevolutionSolution(); Console.WriteLine($"Delta-V at departure: {solution.DepartureVelocity.Magnitude():F1} m/s"); Console.WriteLine($"Delta-V at arrival: {solution.ArrivalVelocity.Magnitude():F1} m/s"); ``` -------------------------------- ### Load Kernels Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/Proxy_8h_source.html Loads SPICE kernels from a specified path. ```APIDOC ## POST /kernels/load ### Description Loads SPICE kernels from a given directory path into the system. ### Method POST ### Endpoint /kernels/load ### Parameters #### Request Body - **path** (const char *) - Required - The path to the directory containing the SPICE kernels. ### Response #### Success Response (200) - **bool** - True if the kernels were loaded successfully, false otherwise. #### Response Example { "example": "true" } ``` -------------------------------- ### Get Spacecraft Clock Coverage - C++ Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK.Tests/SpacecraftClockKernelTests.cpp.gcov.html Tests the retrieval of coverage window information from the spacecraft clock kernel. It creates a Spacecraft object and asserts that the start date, end date, and length of the coverage window match expected values. Dependencies include gtest, SpacecraftClockKernel, Parameters, TDB, Spacecraft, CelestialBody, and InertialFrames. ```cpp #include #include #include #include #include #include #include using namespace std::chrono_literals; TEST(SpacecraftClockKernel, GetCoverage) { const auto earth = std::make_shared(399, "earth"); std::unique_ptr orbitalParams = std::make_unique(earth, IO::SDK::Math::Vector3D(1.0, 2.0, 3.0), IO::SDK::Math::Vector3D(4.0, 5.0, 6.0), IO::SDK::Time::TDB(100.0s), IO::SDK::Frames::InertialFrames::GetICRF()); IO::SDK::OrbitalParameters::StateOrientation attitude(IO::SDK::Time::TDB(100.0s),IO::SDK::Frames::InertialFrames::GetICRF()); IO::SDK::Body::Spacecraft::Spacecraft s(-456, "sc456", 1000.0, 3000.0, "mission1", std::move(orbitalParams)); std::string filepath = s.GetDirectoryPath() + "/Clocks/" + s.GetName() + ".tsc"; const auto window = s.GetClock().GetCoverageWindow(); ASSERT_DOUBLE_EQ(6.62731200E+08, window.GetStartDate().GetSecondsFromJ2000().count()); ASSERT_DOUBLE_EQ(4.9576984959999084E+09, window.GetEndDate().GetSecondsFromJ2000().count()); ASSERT_DOUBLE_EQ(4.2949672959999089E+09, window.GetLength().GetSeconds().count()); } ``` -------------------------------- ### JavaScript: Initialize Search and Navigation Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/structIO_1_1SDK_1_1API_1_1DTO_1_1GeodeticDTO-members.html Initializes the search functionality and navigation tree for the documentation pages. This script is typically run when the document is ready. ```javascript var searchBox = new SearchBox("searchBox", "search",'Search','.html'); $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); $(document).ready(function(){ initNavTree('structIO_1_1SDK_1_1API_1_1DTO_1_1GeodeticDTO.html',''); initResizable(); }); ``` -------------------------------- ### Time System Operations (C#) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics.Net/DEVELOPER_GUIDE.md Provides examples of creating and manipulating Time objects, which represent precise instants with time frame awareness. It supports creation from dates, times, DateTime objects, ISO 8601 strings, and seconds from J2000. Time objects can be converted between TDB, UTC, and TAI frames, and support arithmetic operations with TimeSpan. ```csharp // Create times var t1 = new Time(2024, 6, 21, 12, 0, 0); var t2 = new Time("2024-06-21T12:00:00.000 UTC"); var t3 = Time.CreateTDB(788400000.0); // Seconds from J2000 // Convert between time frames var tdb = t1.ToTDB(); var utc = tdb.ToUTC(); // Arithmetic var t4 = t1.AddDays(1.0); var duration = t4 - t1; // TimeSpan ``` -------------------------------- ### Setup Spacecraft, Integrator, and Propagator (C++) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/coverage/IO.SDK.Tests/PhasingManeuverTests.cpp.gcov.html Configures the spacecraft with initial orbital parameters, and sets up a VVIntegrator and a Propagator for simulating the orbital dynamics over a specified time window. This includes adding fuel tanks and engines to the spacecraft. ```cpp IO::SDK::Body::Spacecraft::Spacecraft s{-1, "sptest", 1000.0, 3000.0, "ms01", std::move(orbitalParams1)}; IO::SDK::Integrators::VVIntegrator integrator(IO::SDK::Time::TimeSpan(1.0s)); IO::SDK::Propagators::Propagator prop(s, integrator, IO::SDK::Time::Window(IO::SDK::Time::TDB(100.0s), IO::SDK::Time::TDB(200.0s))); s.AddFuelTank("ft1", 1000.0, 900.0); s.AddEngine("sn1", "eng1", "ft1", {1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}, 450.0, 50.0); ``` -------------------------------- ### CMake: Installation Rules for Headers and Library Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/IO.Astrodynamics/CMakeLists.txt This section defines the installation rules for the IO.Astrodynamics project. It installs header files from the external library includes (platform-specifically for Linux and Windows) and all project headers into the 'include/IO' directory. The built shared library is installed into the 'lib' directory. ```cmake #INSTALL if (UNIX) install(DIRECTORY ${CMAKE_SOURCE_DIR}/external-lib/includeLinux/ DESTINATION include/IO FILES_MATCHING PATTERN "*.h") elseif () install(DIRECTORY ${CMAKE_SOURCE_DIR}/external-lib/includeWindows/ DESTINATION include/IO FILES_MATCHING PATTERN "*.h") endif () install(FILES ${IO_SDK_H} DESTINATION include/IO) install(TARGETS ${This} LIBRARY DESTINATION lib) ``` -------------------------------- ### Initialize Navigation Tree and Resizable Layout (JavaScript) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Instruments_1_1FOVShapes-members.html Initializes the navigation tree and resizable layout for the documentation interface. This script ensures that the left-hand navigation panel is correctly set up and can be resized by the user. ```javascript $(document).ready(function(){ initNavTree('classIO_1_1SDK_1_1Instruments_1_1FOVShapes.html',''); initResizable(); }); ``` -------------------------------- ### IO::SDK::Sites::LaunchSite - Member List Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/classIO_1_1SDK_1_1Sites_1_1LaunchSite-members.html This section details the members of the IO::SDK::Sites::LaunchSite class, including inherited members. It covers methods for managing launch ranges, ephemeris, visibility windows, and coordinate transformations. ```APIDOC ## IO::SDK::Sites::LaunchSite Members This is the complete list of members for [IO::SDK::Sites::LaunchSite](classIO_1_1SDK_1_1Sites_1_1LaunchSite.html), including all inherited members. ### Methods - **AddAzimuthLaunchRange**(`IO::SDK::Coordinates::AzimuthRange &azimuthRange`) - Description: Adds an azimuth launch range to the launch site. - Class: `IO::SDK::Sites::LaunchSite` - **BuildAndWriteEphemeris**(`const IO::SDK::Time::Window< IO::SDK::Time::UTC > &searchWindow`) const - Description: Builds and writes the ephemeris for a given time window. - Class: `IO::SDK::Sites::Site` - **ClearAzimuthLaunchRanges**() - Description: Clears all azimuth launch ranges from the launch site. - Class: `IO::SDK::Sites::LaunchSite` - **FindBodyVisibilityWindows**(`const IO::SDK::Body::Body &body`, `const IO::SDK::Time::Window< IO::SDK::Time::UTC > &searchWindow`, `IO::SDK::AberrationsEnum aberrationCorrection`) const - Description: Finds visibility windows for a celestial body. - Class: `IO::SDK::Sites::Site` - **FindDayWindows**(`const IO::SDK::Time::Window< IO::SDK::Time::UTC > &searchWindow`, `double twilight`) const - Description: Finds time windows corresponding to daylight conditions. - Class: `IO::SDK::Sites::Site` - **FindNightWindows**(`const IO::SDK::Time::Window< IO::SDK::Time::UTC > &searchWindow`, `double twilight`) const - Description: Finds time windows corresponding to nighttime conditions. - Class: `IO::SDK::Sites::Site` - **FindWindowsOnIlluminationConstraint**(`const IO::SDK::Time::Window< IO::SDK::Time::UTC > &searchWindow`, `const IO::SDK::Body::Body &observerBody`, `const IO::SDK::IlluminationAngle &illuminationAngle`, `const IO::SDK::Constraints::RelationalOperator &constraint`, `double value`) const - Description: Finds time windows based on illumination constraints. - Class: `IO::SDK::Sites::Site` - **GetBody**() const - Description: Retrieves the celestial body associated with the site. - Class: `IO::SDK::Sites::Site` - **GetCoordinates**() const - Description: Retrieves the coordinates of the launch site. - Class: `IO::SDK::Sites::Site` - **GetEphemerisCoverageWindow**() const - Description: Retrieves the time window for which ephemeris data is available. - Class: `IO::SDK::Sites::Site` - **GetFilesPath**() const - Description: Retrieves the file path for site-related data. - Class: `IO::SDK::Sites::Site` - **GetFrame**() const - Description: Retrieves the coordinate frame of the launch site. - Class: `IO::SDK::Sites::Site` - **GetHorizontalCoordinates**(`const IO::SDK::Body::Body &body`, `IO::SDK::AberrationsEnum aberrationCorrection`, `const IO::SDK::Time::TDB &epoch`) const - Description: Calculates the horizontal coordinates of a celestial body for a given epoch. - Class: `IO::SDK::Sites::Site` - **GetId**() const - Description: Retrieves the unique identifier of the launch site. - Class: `IO::SDK::Sites::Site` - **GetIllumination**(`IO::SDK::AberrationsEnum aberrationCorrection`, `const IO::SDK::Time::TDB &epoch`) const - Description: Retrieves illumination information for a celestial body at a specific epoch. - Class: `IO::SDK::Sites::Site` - **GetName**() const - Description: Retrieves the name of the launch site. - Class: `IO::SDK::Sites::Site` - **GetRADec**(`const IO::SDK::Body::Body &body`, `IO::SDK::AberrationsEnum aberrationCorrection`, `const IO::SDK::Time::TDB &epoch`) const - Description: Calculates the Right Ascension and Declination of a celestial body for a given epoch. - Class: `IO::SDK::Sites::Site` - **GetStateVector**(`const IO::SDK::Frames::Frames &frame`, `const IO::SDK::Time::TDB &epoch`) const - Description: Retrieves the state vector of the launch site in a specified frame and epoch. - Class: `IO::SDK::Sites::Site` ``` -------------------------------- ### GET /propagator/latest-state-vector Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/Docs/html/Propagator_8h_source.html Retrieves the latest state vector from the propagator. This is essential for getting the most current position and velocity information. ```APIDOC ## GET /propagator/latest-state-vector ### Description Retrieves the latest state vector from the propagator. ### Method GET ### Endpoint /propagator/latest-state-vector ### Parameters None ### Request Body None ### Request Example None ### Response #### Success Response (200) - **stateVector** (IO::Astrodynamics::OrbitalParameters::StateVector) - The latest state vector object. #### Response Example ```json { "stateVector": { ... } } ``` ``` -------------------------------- ### Install IO.Astrodynamics Package (.NET CLI) Source: https://github.com/io-aerospace-software-engineering/astrodynamics/blob/main/README.md Installs the IO.Astrodynamics NuGet package into your .NET project. This package provides the core functionality for astrodynamics computations. ```bash dotnet add package IO.Astrodynamics ```