Skip to content

Commit

Permalink
Merge pull request #119 from Projeto-Jupiter/develop
Browse files Browse the repository at this point in the history
WIP: Last touches for release 0.9.9
  • Loading branch information
Gui-FernandesBR authored Jan 8, 2022
2 parents 04ca5a1 + 623171c commit 1dcc42d
Show file tree
Hide file tree
Showing 15 changed files with 232 additions and 139 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

project = "RocketPy"
copyright = "2020, Projeto Jupiter"
author = "Giovani Hdalgo Ceotto"
author = "Giovani Hidalgo Ceotto"

# The full version, including alpha/beta/rc tags
release = "0.9.8"
release = "0.9.9"


# -- General configuration ---------------------------------------------------
Expand Down
Binary file added docs/technical/aerodynamics/Roll_Equations.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you want to choose a specific version to guarantee compatibility, you may ins

.. code-block:: shell
pip install rocketpy==0.9.8
pip install rocketpy==0.9.9
Optional Installation Method: ``conda``
Expand Down
66 changes: 33 additions & 33 deletions rocketpy/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Environment:
Environment.earthRadius : float
Value of Earth's Radius = 6.3781e6 m.
Environment.airGasConstant : float
Value of Air's Gast Constant = 287.05287 J/K/Kg
Value of Air's Gas Constant = 287.05287 J/K/Kg
Gravity and Launch Rail Length:
Environment.rl : float
Expand Down Expand Up @@ -82,14 +82,14 @@ class Environment:
Environment.date : datetime
Date time of launch.
Topographic informations:
Topographic information:
Environment.elevLonArray: array
Unidimensional array containing the longitude coordinates
Environment.elevLatArray: array
Unidimensional array containing the latitude coordinates
Environment.elevArray: array
Two-dimensional Array containing the elevation information
Environment.topograficProfileAticvated: bool
Environment.topographicProfileActivated: bool
True if the user already set a topographic plofile
Atmosphere Static Conditions:
Expand Down Expand Up @@ -167,7 +167,7 @@ class Environment:
'CustomAtmosphere', 'WyomingSounding', 'NOAARucSounding',
'Forecast', 'Reanalysis', 'Ensemble'.
Environment.atmosphericModelFile : string
Adress of the file used for the atmospheric model being used.
Address of the file used for the atmospheric model being used.
Only defined for 'WyomingSounding', 'NOAARucSounding',
'Forecast', 'Reanalysis', 'Ensemble'
Environment.atmosphericModelDict : dictionary
Expand Down Expand Up @@ -332,7 +332,7 @@ def __init__(
-------
None
"""
# Save launch rail ength
# Save launch rail length
self.rL = railLength

# Save gravity value
Expand Down Expand Up @@ -504,7 +504,7 @@ def setTopographicProfile(self, type, file, dictionary="netCDF4", crs=None):
NASADEM data products were derived from original telemetry data from
the Shuttle Radar Topography Mission (SRTM).
file : string
The path/name of the topografic file. Usually .nc provided by
The path/name of the topographic file. Usually .nc provided by
dictionary : string, optional
Dictionary which helps to read the specified file. By default
'netCDF4' which works well with .nc files will be used.
Expand All @@ -520,7 +520,7 @@ def setTopographicProfile(self, type, file, dictionary="netCDF4", crs=None):
self.elevLatArray = rootgrp.variables["lat"][:].tolist()
self.elevArray = rootgrp.variables["NASADEM_HGT"][:].tolist()
# crsArray = rootgrp.variables['crs'][:].tolist().
self.topograficProfileAticvated = True
self.topographicProfileActivated = True

print("Region covered by the Topographical file: ")
print(
Expand Down Expand Up @@ -559,7 +559,7 @@ def getElevationFromTopograghicProfile(self, lat, lon):
ValueError
[description]
"""
if self.topograficProfileAticvated == False:
if self.topographicProfileActivated == False:
print(
"You must define a Topographic profile first, please use the method Environment.setTopograghicProfile()"
)
Expand Down Expand Up @@ -750,7 +750,7 @@ def setAtmosphericModel(
String that must be given when type is either
'WyomingSounding', 'Forecast', 'Reanalysis' or 'Ensemble'.
It specifies the location of the data given, either through
a local file adress or a URL.
a local file address or a URL.
If type is 'Forecast', this parameter can also be either
'GFS', 'FV3', 'RAP' or 'NAM' for latest of these forecasts.
References: GFS: Global - 0.25deg resolution - Updates every 6 hours, forecast for 81 points spaced by 3 hours
Expand All @@ -759,15 +759,15 @@ def setAtmosphericModel(
NAM: Regional CONUS Nest - 5 km resolution - Updates every 6 hours, forecast for 21 points spaced by 3 hours
If type is 'Ensemble', this parameter can also be either
'GEFS', or 'CMC' for the latest of these ensembles.
Refrences: GEFS: Global, bias-corrected, 0.5deg resolution, 21 forecast members, Updates every 6 hours, forecast for 65 points spaced by 4 hours
References: GEFS: Global, bias-corrected, 0.5deg resolution, 21 forecast members, Updates every 6 hours, forecast for 65 points spaced by 4 hours
CMC: Global, 0.5deg resolution, 21 forecast members, Updates every 12 hours, forecast for 65 points spaced by 4 hours
dictionary : dictionary, string, optional
Dictionary that must be given when type is either
'Forecast', 'Reanalysis' or 'Ensemble'.
It specifies the dictionary to be used when reading netCDF
and OPeNDAP files, allowing the correct retrieval of data.
Acceptable values include 'ECMWF', 'NOAA' and 'UCAR' for
default dicitonaries which can generally be used to read
default dictionaries which can generally be used to read
datasets from these institutes.
Alternatively, a dictionary structure can also be given,
specifying the short names used for time, latitude, longitude,
Expand Down Expand Up @@ -799,7 +799,7 @@ def setAtmosphericModel(
meters while the second column must be the pressure in Pa.
If an array is given, it is expected to be a list or array
of coordinates (height in meters, pressure in Pa).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding pressure in Pa.
temperature : float, string, array, callable, optional
Expand All @@ -814,7 +814,7 @@ def setAtmosphericModel(
meters while the second column must be the temperature in K.
If an array is given, it is expected to be a list or array
of coordinates (height in meters, temperature in K).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding temperature in K.
wind_u : float, string, array, callable, optional
Expand All @@ -830,7 +830,7 @@ def setAtmosphericModel(
meters while the second column must be the wind-u in m/s.
If an array is given, it is expected to be an array of
coordinates (height in meters, wind-u in m/s).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding wind-u in m/s.
wind_v : float, string, array, callable, optional
Expand All @@ -846,7 +846,7 @@ def setAtmosphericModel(
meters while the second column must be the wind-v in m/s.
If an array is given, it is expected to be an array of
coordinates (height in meters, wind-v in m/s).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding wind-v in m/s.
Expand Down Expand Up @@ -1249,7 +1249,7 @@ def processCustomAtmosphere(
meters while the second column must be the pressure in Pa.
If an array is given, it is expected to be a list or array
of coordinates (height in meters, pressure in Pa).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding pressure in Pa.
temperature : float, string, array, callable, optional
Expand All @@ -1264,7 +1264,7 @@ def processCustomAtmosphere(
meters while the second column must be the temperature in K.
If an array is given, it is expected to be a list or array
of coordinates (height in meters, temperature in K).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding temperature in K.
wind_u : float, string, array, callable, optional
Expand All @@ -1280,7 +1280,7 @@ def processCustomAtmosphere(
meters while the second column must be the wind-u in m/s.
If an array is given, it is expected to be an array of
coordinates (height in meters, wind-u in m/s).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding wind-u in m/s.
wind_v : float, string, array, callable, optional
Expand All @@ -1296,7 +1296,7 @@ def processCustomAtmosphere(
meters while the second column must be the wind-v in m/s.
If an array is given, it is expected to be an array of
coordinates (height in meters, wind-v in m/s).
Finally, a callable or function is also acepted. The
Finally, a callable or function is also accepted. The
function should take one argument, the height above sea
level in meters and return a corresponding wind-v in m/s.
Expand Down Expand Up @@ -1402,7 +1402,7 @@ def processWyomingSounding(self, file):
----------
file : string
URL of an upper air sounding data output from Wyoming
Upper Air Soundigs database.
Upper Air Soundings database.
Example:
http://weather.uwyo.edu/cgi-bin/sounding?region=samer&TYPE=TEXT%3ALIST&YEAR=2019&MONTH=02&FROM=0200&TO=0200&STNM=82599
More can be found at:
Expand Down Expand Up @@ -1720,7 +1720,7 @@ def processForecastReanalysis(self, file, dictionary):
used for time, latitude, longitude, pressure levels,
temperature profile, geopotential or geopotential height
profile, wind-u and wind-v profiles in the dataset given in
the file parameter. An example is the following dicitonary,
the file parameter. An example is the following dictionary,
generally used to read OPeNDAP files from NOAA's NOMAD
server: {'time': 'time',
'latitude': 'lat',
Expand Down Expand Up @@ -1749,8 +1749,8 @@ def processForecastReanalysis(self, file, dictionary):
raise TypeError(
"Please specify Location (lat, lon). when "
"initializing this Environment. "
"Alternatively, use the Environment.setLoc"
"ation method."
"Alternatively, use the Environment."
"setLocation method."
)

# Read weather file
Expand Down Expand Up @@ -2108,14 +2108,14 @@ def processEnsemble(self, file, dictionary):
file : string
String containing path to local netCDF file or URL of an
OPeNDAP file, such as NOAA's NOMAD or UCAR TRHEDDS server.
dicitonary : dictionary
dictionary : dictionary
Specifies the dictionary to be used when reading netCDF and
OPeNDAP files, allowing for the correct retrieval of data.
The dictionary structure should specify the short names
used for time, latitude, longitude, pressure levels,
temperature profile, geopotential or geopotential height
profile, wind-u and wind-v profiles in the dataset given in
the file parameter. An example is the following dicitonary,
the file parameter. An example is the following dictionary,
generally used to read OPeNDAP files from NOAA's NOMAD
server: {'time': 'time',
'latitude': 'lat',
Expand Down Expand Up @@ -2144,8 +2144,8 @@ def processEnsemble(self, file, dictionary):
raise TypeError(
"Please specify Location (lat, lon). when "
"initializing this Environment. "
"Alternatively, use the Environment.setLoc"
"ation method."
"Alternatively, use the Environment."
"setLocation method."
)

# Read weather file
Expand Down Expand Up @@ -2673,7 +2673,7 @@ def pressure_function(h):

def calculateDensityProfile(self):
"""Compute the density of the atmosphere as a function of
heigth by using the formula rho = P/(RT). This function is
height by using the formula rho = P/(RT). This function is
automatically called whenever a new atmospheric model is set.
Parameters
Expand Down Expand Up @@ -2702,7 +2702,7 @@ def calculateDensityProfile(self):

def calculateSpeedOfSoundProfile(self):
"""Compute the speed of sound in the atmosphere as a function
of heigth by using the formula a = sqrt(gamma*R*T). This
of height by using the formula a = sqrt(gamma*R*T). This
function is automatically called whenever a new atmospheric
model is set.
Expand Down Expand Up @@ -3280,7 +3280,7 @@ def geodesicToUtm(self, lat, lon, datum):
x = 500000 + K0 * n * (ag + J + K)
y = N0 + K0 * (m + n * np.tan(lat) * (ag * ag / 2 + L + M))

# Convert the output lat and lon to degress
# Convert the output lat and lon to degrees
lat = lat * 180 / np.pi
lon = lon * 180 / np.pi
lon_mc = lon_mc * 180 / np.pi
Expand Down Expand Up @@ -3328,7 +3328,7 @@ def utmToGeodesic(self, x, y, utmZone, hemis, datum):
y = y + 10000000

# Calculate the Central Meridian from the UTM zone number
centralMeridian = utmZone * 6 - 183 # degress
centralMeridian = utmZone * 6 - 183 # degrees

# Select the desired datum
if datum == "SAD69":
Expand Down Expand Up @@ -3475,7 +3475,7 @@ def decimalDegressToArcSeconds(self, angle):
min: float
The arc minutes. 1 arc-minute = (1/60)*degree
sec: float
The arc Seconds. 1 arc-secon = (1/360)*degree
The arc Seconds. 1 arc-second = (1/360)*degree
"""

if angle < 0:
Expand All @@ -3494,7 +3494,7 @@ def decimalDegressToArcSeconds(self, angle):

def printEarthDetails(self):
"""[UNDER CONSTRUCTION]
Function to print informations about the Earth Model used in the
Function to print information about the Earth Model used in the
Environment Class
"""
Expand Down
Loading

0 comments on commit 1dcc42d

Please sign in to comment.