Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: API docs updates #212

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "examples"]
path = examples
url = https://github.com/valeriof7/tudatpy-examples.git
url = https://github.com/tudat-team/tudatpy-examples.git
4 changes: 0 additions & 4 deletions docs/source/acceleration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Functions

radiation_pressure

cannonball_radiation_pressure

spherical_harmonic_gravity

mutual_spherical_harmonic_gravity
Expand Down Expand Up @@ -58,8 +56,6 @@ Functions

.. autofunction:: tudatpy.numerical_simulation.propagation_setup.acceleration.radiation_pressure

.. autofunction:: tudatpy.numerical_simulation.propagation_setup.acceleration.cannonball_radiation_pressure

.. autofunction:: tudatpy.numerical_simulation.propagation_setup.acceleration.spherical_harmonic_gravity

.. autofunction:: tudatpy.numerical_simulation.propagation_setup.acceleration.mutual_spherical_harmonic_gravity
Expand Down
16 changes: 6 additions & 10 deletions docs/source/environment_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,15 @@ Functions

get_default_single_alternate_body_settings

get_default_single_body_settings_time_limited

add_aerodynamic_coefficient_interface

create_system_of_bodies

create_simplified_system_of_bodies

create_body_ephemeris

add_radiation_pressure_interface
add_aerodynamic_coefficient_interface

add_radiation_pressure_target_model

add_flight_conditions

Expand All @@ -82,17 +80,15 @@ Functions

.. autofunction:: tudatpy.numerical_simulation.environment_setup.get_default_single_alternate_body_settings

.. autofunction:: tudatpy.numerical_simulation.environment_setup.get_default_single_body_settings_time_limited

.. autofunction:: tudatpy.numerical_simulation.environment_setup.add_aerodynamic_coefficient_interface

.. autofunction:: tudatpy.numerical_simulation.environment_setup.create_system_of_bodies

.. autofunction:: tudatpy.numerical_simulation.environment_setup.create_simplified_system_of_bodies

.. autofunction:: tudatpy.numerical_simulation.environment_setup.create_body_ephemeris

.. autofunction:: tudatpy.numerical_simulation.environment_setup.add_radiation_pressure_interface
.. autofunction:: tudatpy.numerical_simulation.environment_setup.add_aerodynamic_coefficient_interface

.. autofunction:: tudatpy.numerical_simulation.environment_setup.add_radiation_pressure_target_model

.. autofunction:: tudatpy.numerical_simulation.environment_setup.add_flight_conditions

Expand Down
17 changes: 12 additions & 5 deletions docs/source/ephemeris.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,25 @@ inertial Cartesian state elements produced by the ephemeris.

.. code-block:: python

bodies = .... // Create system of bodies
bodies = .... # Create system of bodies
earth_ephemeris = bodies.get('Earth').ephemeris
earth_state_at_epoch = earth_ephemeris.cartesian_state( epoch )

where the ``epoch`` input is (as always in Tudat) the time in seconds since J2000. The ``earth_state_at_epoch`` is always in a frame with inertial orientation. The specific orientation and origin can be access from the :attr:`~tudatpy.numerical_simulation.environment.Ephemeris.frame_orientation` and :attr:`~tudatpy.numerical_simulation.environment.Ephemeris.frame_origin` attributes.

* jpl_horizons (:func:`~tudatpy.numerical_simulation.environment_setup.ephemeris.horizons_wrapper.jpl_horizons`)



**Creating ephemeris objects from ephemeris settings**
Ephemeris objects can also be created directly from ephemeris settings using the :func:`~tudatpy.numerical_simulation.environment_setup.create_body_ephemeris` function.
This can be useful if you want to create an ephemeris object for a body that is not part of a system of bodies to perform further analysis, such as the barycenter of the Martian system:

.. code-block:: python

frame_origin = "SSB"
frame_orientation = "ECLIPJ2000"
body_name_to_use = "MARS BARYCENTER"
mars_system_ephemeris_settings = environment_setup.ephemeris.direct_spice(
frame_origin, frame_orientation, body_name_to_use ) # Create ephemeris settings
mars_system_ephemeris = environment_setup.create_body_ephemeris(mars_system_ephemeris_settings,
"MARS BARYCENTER") # Create ephemeris object



Expand Down
24 changes: 12 additions & 12 deletions docs/source/radiation_pressure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Functions

constant_luminosity

cannonball_radiation_target

irradiance_based_constant_luminosity

time_variable_luminosity
Expand All @@ -49,27 +47,27 @@ Functions

variable_albedo_surface_radiosity

thermal_emission_angle_based_radiosity

thermal_emission_blackbody_constant_emissivity

thermal_emission_blackbody_variable_emissivity

thermal_emission_angle_based_radiosity

specular_diffuse_body_panel_reflection

lambertian_body_panel_reflection

isotropic_radiation_source

panelled_radiation_target

panelled_extended_radiation_source

cannonball_radiation_target

panelled_radiation_target

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.constant_luminosity

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.cannonball_radiation_target

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.constant_luminosity

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.irradiance_based_constant_luminosity

Expand All @@ -95,22 +93,24 @@ Functions

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.variable_albedo_surface_radiosity

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.thermal_emission_angle_based_radiosity

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.thermal_emission_blackbody_constant_emissivity

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.thermal_emission_blackbody_variable_emissivity

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.thermal_emission_angle_based_radiosity

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.specular_diffuse_body_panel_reflection

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.lambertian_body_panel_reflection

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.isotropic_radiation_source

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.panelled_radiation_target

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.panelled_extended_radiation_source

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.cannonball_radiation_target

.. autofunction:: tudatpy.numerical_simulation.environment_setup.radiation_pressure.panelled_radiation_target




Expand Down
31 changes: 18 additions & 13 deletions tudatpy/kernel/docstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -10803,7 +10803,7 @@ static inline std::string get_docstring(std::string name) {
return R"(

List of objects that define the settings of time variations of the gravity field variation models that are to be created. Variables in this list are typically
assigned by using a function from the :ref:`\`\`gravity_field_variations\`\`` module.
assigned by using a function from the :ref:`\`\`gravity_field_variation\`\`` module.


:type: list[GravityFieldVariationSettings]
Expand Down Expand Up @@ -10878,7 +10878,12 @@ Function that retrieves the default settings for the given set of input bodies.
Function that retrieves the default settings for the given set of input bodies. Default settings are described in
detail `here <https://docs.tudat.space/en/latest/_src_user_guide/state_propagation/environment_setup/default_env_models.html>`_ .
Note that if a body is provided as input for which default settings do not exist, an exception is thrown. In addition
to settings for each separate body, this function returns an object that defines the global frame origin and orientation,
to settings for each separate body, this function returns an object that defines the global frame origin and orientation.

.. note::

Before calling this function make sure that the appropriate SPICE kernels are loaded. A set of default SPICE kernels
can be loaded by calling :func:`~tudatpy.interface.spice.load_standard_kernels`.


Parameters
Expand Down Expand Up @@ -11261,27 +11266,27 @@ Returns



} else if(name == "add_radiation_pressure_interface" ) {
} else if(name == "add_radiation_pressure_target_model" ) {
return R"(

Function that creates an radiation pressure interface from settings, and adds it to an existing body.
Function that creates a radiation pressure target model from settings, and adds it to an existing body.

This function can be used to add an radiation pressure interface to an existing body. It requires
settings for the radiation pressure interface, created using one of the functions from the :ref:`\`\`radiation_pressure\`\`` module.
settings for the radiation pressure target model, created using one of the functions from the :ref:`\`\`radiation_pressure\`\`` module.
This function creates the actual coefficient interface from these settings, and assigns it to the
selected body. In addition to the identifier for the body to which it is assigned, this function
requires the full :class:`~tudatpy.numerical_simulation.environment.SystemOfBodies` as input, to facilitate
inter-body dependencies in the radiation pressure interface
inter-body dependencies in the radiation pressure interface.


Parameters
----------
bodies : SystemOfBodies
Object defining the physical environment, with all properties of artificial and natural bodies.
body_name : str
Name of the body to which the radiation pressure interface is to be assigned
radiation_pressure_settings : RadiationPressureInterfaceSettings
Settings defining the radiation pressure interface that is to be created.
Name of the body to which the radiation pressure target model is to be assigned
radiation_pressure_target_settings : RadiationPressureTargetModelSettings
Settings defining the radiation pressure target that is to be created.



Expand Down Expand Up @@ -11331,7 +11336,7 @@ Function that creates a rotation model, and adds it to an existing body.
This function can be used to add a :class:`~tudatpy.numerical_simulation.environment.RotationalEphemeris` object to an existing body.
Typically, the ``RotationalEphemeris`` is created along with the `~tudatpy.numerical_simulation.environment.Body` itself However, in some cases it may be useful
to create a rotation model after the Body objects have been created. This function requires
settings for the rotation model, created using one of the functions from the :ref:`~tudatpy.numerical_simulation_environment_setup.rotation_model` module.
settings for the rotation model, created using one of the functions from the :ref:`~tudatpy.numerical_simulation.environment_setup.rotation_model` module.
This function creates the actual coefficient interface from these settings, and assigns it to the
selected body. In addition to the identifier for the body to which it is assigned, this function
requires the full :class:`~tudatpy.numerical_simulation.environment.SystemOfBodies` as input, to facilitate
Expand Down Expand Up @@ -13295,7 +13300,7 @@ frame_origin : str, default="SSB"
Origin of frame in which ephemeris data is defined.
frame_orientation : str, default="ECLIPJ2000"
Orientation of frame in which ephemeris data is defined.
interpolator_settings : std::make_shared< interpolators::InterpolatorSettings >, default=std::make_shared< interpolators::LagrangeInterpolatorSettings >( 6 )
interpolator_settings : InterpolatorSettings, default = tudatpy.math.interpolators.lagrange_interpolation(6)
Settings to be used for the state interpolation.
body_name_to_use : str, default = ""
Body from which Spice ephemeris is to be created.
Expand Down Expand Up @@ -13777,7 +13782,7 @@ In the above case, the original Jupiter ephemeris setting is taken and each stat
Function for creating ephemeris model settings for an SGP4-propagated TLE.

Function for creating ephemeris model settings for an SGP4-propagated two-line element (TLE). Our implementation uses the ``evsgp4_c`` function of the SPICE library
to perform the SGP4 propagation, and the :func:`~tudatpy.astro.element_conversion.teme_to_j2000 ` function to rotate the resulting state from teh TEME frame to the J2000 frame
to perform the SGP4 propagation, and the :func:`~tudatpy.astro.element_conversion.teme_to_j2000` function to rotate the resulting state from teh TEME frame to the J2000 frame
(and, if required for this ephemeris model, a subsequent different inertial frame).

Parameters
Expand Down Expand Up @@ -18749,7 +18754,7 @@ Parameters
----------
use_schwarzschild : bool, default=False
Boolean defining whether or not to use the Schwarzschild contribution to the acceleration correction
use_lense_thirring : bool
use_lense_thirring : bool, default=False
Boolean defining whether or not to use the Lense-Thirring contribution to the acceleration correction
use_de_sitter : bool, default=False
Boolean defining whether or not to use the de Sitter contribution to the acceleration correction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ namespace environment_setup {
m.def("add_radiation_pressure_target_model",
&tss::addRadiationPressureTargetModel,
py::arg("bodies"), py::arg("body_name"), py::arg("radiation_pressure_target_settings"),
get_docstring("add_radiation_pressure_interface").c_str());
get_docstring("add_radiation_pressure_target_model").c_str());

m.def("add_rotation_model",
&tss::addRotationModel,
Expand Down
Loading