Skip to content

Commit

Permalink
document compute_shadow_function
Browse files Browse the repository at this point in the history
  • Loading branch information
larshinueber committed Jan 12, 2025
1 parent e9c5b9d commit 5ed21e7
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/source/astro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The other modules make extensive use of the functionality exposed here.
two_body_dynamics
polyhedron_utilities
gravitation
fundamentals



Expand Down
27 changes: 27 additions & 0 deletions docs/source/fundamentals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
``fundamentals``
===============
Functions for fundamental astrodynamic calculations


This module contains a list of functions for fundamental astrodynamic calculations.
These functions are used in the other modules to perform more complex calculations,
but can also be used on their own for standalone calculations.

.. note:: The functions in this module are expected to be reorganized in the future.



Functions
---------
.. currentmodule:: tudatpy.astro.fundamentals

.. autosummary::

compute_shadow_function



.. autofunction:: tudatpy.astro.fundamentals.compute_shadow_function



45 changes: 45 additions & 0 deletions tudatpy/kernel/docstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2721,6 +2721,51 @@ tuple[numpy.ndarray, numpy.ndarray]



namespace fundamentals{

static inline std::string get_docstring(std::string name) {

if (name == "test") {
return "test";


} else if(name == "compute_shadow_function" ) {
return R"(

Compute the shadow function.

Returns the value of of the shadow function. Returns 0 if the satellite is in umbra, 1 if the
satellite is fully exposed and a value between 0 and 1 if the satellite is in penumbra or antumbra.

The point of view is from the satellite. The occulting body (for example the Earth) is the body
that blocks the light from the occulted body (for example the Sun).

Reference: Section 3.4 from ( Montebruck O, Gill E., 2005) and Fig. 5 from (Zhang et al., 2019).

Parameters
----------
occulted_body_position : numpy.ndarray
Vector containing Cartesian coordinates of the occulted body.
occulted_body_radius : float
Mean radius of occulted body.
occulting_body_position : numpy.ndarray
Vector containing Cartesian coordinates of the occulting body.
occulting_body_radius : float
Mean radius of occulting body.
satellite_position : numpy.ndarray
Vector containing Cartesian coordinates of the satellite.
Returns
-------
float
Shadow function value

)";

} else {
return "No documentation found.";
}

}

}

Expand Down
3 changes: 2 additions & 1 deletion tudatpy/kernel/expose_astro/expose_fundamentals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace fundamentals {
py::arg("occulted_body_radius"),
py::arg("occulting_body_position"),
py::arg("occulting_body_radius"),
py::arg("satellite_position"));
py::arg("satellite_position"),
get_docstring("compute_shadow_function").c_str());

}

Expand Down

0 comments on commit 5ed21e7

Please sign in to comment.