Skip to content

Commit 14411da

Browse files
BUG: fixed renamed environment attributes
1 parent e0e88d6 commit 14411da

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

rocketpy/Environment.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -492,15 +492,15 @@ def setElevation(self, elevation="Open-Elevation"):
492492
"""
493493
if elevation != "Open-Elevation" and elevation != "SRTM":
494494
self.elevation = elevation
495-
# elif elevation == "SRTM" and self.latitude != None and self.lon != None:
495+
# elif elevation == "SRTM" and self.latitude != None and self.longitude != None:
496496
# # Trigger the authentication flow.
497497
# #ee.Authenticate()
498498
# # Initialize the library.
499499
# ee.Initialize()
500500

501501
# # Calculate elevation
502502
# dem = ee.Image('USGS/SRTMGL1_003')
503-
# xy = ee.Geometry.Point([self.lon, self.latitude])
503+
# xy = ee.Geometry.Point([selfgitude, self.latitude])
504504
# elev = dem.sample(xy, 30).first().get('elevation').getInfo()
505505

506506
# self.elevation = elev
@@ -3354,10 +3354,10 @@ def exportEnvironment(self, filename="environment"):
33543354
# TODO: find a way to documennt the workaround I've used on ma.getdata(self...
33553355
self.exportEnvDictionary = {
33563356
"railLength": self.rL,
3357-
"gravity": self.g,
3357+
"gravity": self.gravity,
33583358
"date": [self.date.year, self.date.month, self.date.day, self.date.hour],
3359-
"latitude": self.lat,
3360-
"longitude": self.lon,
3359+
"latitude": self.latitude,
3360+
"longitude": self.longitude,
33613361
"elevation": self.elevation,
33623362
"datum": self.datum,
33633363
"timeZone": self.timeZone,

rocketpy/Flight.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@ def potentialEnergy(self):
25762576
totalMass = self.rocket.totalMass
25772577
grid = self.vx[:, 0]
25782578
totalMass = Function(np.column_stack([grid, totalMass(grid)]), "Time (s)")
2579-
potentialEnergy = totalMass * self.env.g * self.z
2579+
potentialEnergy = totalMass * self.env.gravity * self.z
25802580
potentialEnergy.setInputs("Time (s)")
25812581
return potentialEnergy
25822582

@@ -2994,7 +2994,7 @@ def latitude(self):
29942994
latitude: Function
29952995
Rocket latitude coordinate, in degrees, at each time step.
29962996
"""
2997-
lat1 = np.deg2rad(self.env.lat) # Launch lat point converted to radians
2997+
lat1 = np.deg2rad(self.env.latitude) # Launch lat point converted to radians
29982998

29992999
# Applies the haversine equation to find final lat/lon coordinates
30003000
latitude = np.rad2deg(
@@ -3019,8 +3019,8 @@ def longitude(self):
30193019
longitude: Function
30203020
Rocket longitude coordinate, in degrees, at each time step.
30213021
"""
3022-
lat1 = np.deg2rad(self.env.lat) # Launch lat point converted to radians
3023-
lon1 = np.deg2rad(self.env.lon) # Launch lon point converted to radians
3022+
lat1 = np.deg2rad(self.env.latitude) # Launch lat point converted to radians
3023+
lon1 = np.deg2rad(self.env.longitude) # Launch lon point converted to radians
30243024

30253025
# Applies the haversine equation to find final lat/lon coordinates
30263026
longitude = np.rad2deg(

rocketpy/Rocket.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ def allInfo(self):
955955
self.thrustToWeight.plot(lower=0, upper=self.motor.burnOutTime)
956956

957957
# ax = plt.subplot(415)
958-
# ax.plot( , self.rocket.motor.thrust()/(self.env.g() * self.rocket.totalMass()))
958+
# ax.plot( , self.rocket.motor.thrust()/(self.env.gravity * self.rocket.totalMass()))
959959
# ax.set_xlim(0, self.rocket.motor.burnOutTime)
960960
# ax.set_xlabel("Time (s)")
961961
# ax.set_ylabel("Thrust/Weight")

0 commit comments

Comments
 (0)