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

DOC: Improvements of Environment docstring phrasing. #565

Merged
merged 13 commits into from
Apr 2, 2024
Merged
22 changes: 16 additions & 6 deletions rocketpy/environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,21 @@ def __init__(
timezone="UTC",
max_expected_height=80000.0,
):
phmbressan marked this conversation as resolved.
Show resolved Hide resolved
"""Initialize Environment class, saving launch rail length,
launch date, location coordinates and elevation. Note that
by default the standard atmosphere is loaded until another
"""Initialize Environment class, saving parameters of the launch location,
such as launch date, coordinates and elevation. This class also computes
relevant quantities for the Flight simulation, such as air pressure, density
and gravitational acceleration.
phmbressan marked this conversation as resolved.
Show resolved Hide resolved

Note that the default atmospheric model is the International Standard Atmosphere
as defined by ISO 2533 unless specified otherwise in
:meth:`Environment.set_atmospheric_model`.

Parameters
----------
gravity : int, float, callable, string, array, optional
Surface gravitational acceleration. Positive values point the
acceleration down. If None, the Somigliana formula is used to
acceleration down. If None, the Somigliana formula is used.
See :meth:`Environment.set_gravity_model` for more information.
date : array, optional
Array of length 4, stating (year, month, day, hour (UTC))
of rocket launch. Must be given if a Forecast, Reanalysis
Expand Down Expand Up @@ -468,8 +474,8 @@ def set_gravity_model(self, gravity):
----------
gravity : None or Function source
phmbressan marked this conversation as resolved.
Show resolved Hide resolved
If None, the Somigliana formula is used to compute the gravity
acceleration. Otherwise, the user can provide a Function object
representing the gravity model.
acceleration. Otherwise, the user can provide a Function source
object representing the gravity model.

Returns
-------
Expand Down Expand Up @@ -514,6 +520,10 @@ def somigliana_gravity(self, height):
-------
Function
Function object representing the gravity model.

References
----------
.. [1] https://en.wikipedia.org/wiki/Theoretical_gravity#Somigliana_equation
"""
a = 6378137.0 # semi_major_axis
f = 1 / 298.257223563 # flattening_factor
Expand Down
Loading