Skip to content

Conversation

@MateusStano
Copy link
Member

Pull request type

  • Code base additions (bugfix, features)
  • Code maintenance (refactoring, formatting, renaming, tests)
  • ReadMe, Docs and GitHub maintenance
  • Other (please describe):

Description

When working on #290 I found that the Flight.plotPressureSignals method did not work. This was just because the __calculate_pressure_signal method was not being called. Furthermore, when using "StandardAtmosphere" the Pressure at Rocket's Altitude plot raised an error. This error comes from calling Environment.pressure with an array as such:

image

Using a list instead works fine:

image

I am pretty sure that a Function object should be able to receive an np.array so I think this not working as intended.

One more thing, looking at how the pressure Function is calculated for StandardAtmosphere. Lines 2832 and 2833 are incoherent. I don't know much about pressure profiles though, so I might be wrong. Maybe @Gui-FernandesBR or @giovaniceotto know more.

image

What was changed

The only thing changed currently in this PR is that the plot for Pressure at Rocket's Altitude now converts the np.array into a list when getting the pressure values and also calls __calculate_pressure_signal, which was not doing before so it just did not work. This fixes the plot but there may be more things wrong here.

Does this introduce a breaking change?

  • Yes
  • No

@MateusStano MateusStano added Bug Something isn't working Environment Enviroment Class related features labels Dec 29, 2022
@MateusStano MateusStano self-assigned this Dec 29, 2022
@MateusStano MateusStano changed the title bug: fix standard atmosphere Pressure ar Rockets Altitude plot BUG: Flight.plotPressureSignals and "StandardAtmosphere" environment pressure calculation Dec 29, 2022
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! I verified locally and the code is running as expected.

Regarding line 2833, it was not modified since the first addition of Environment.py file, made 3 years ago by @giovaniceotto . It seems wrong to me, at least one of the definition of the h variable should be deleted. Please notice this problem also happen in line 2815 of the same file.

@giovaniceotto , what do you think? Can we fix that in another PR?

@MateusStano , I believe you can already merge this one 👌

@MateusStano
Copy link
Member Author

Closing this. I opened issue #318 to continue the discussion there.

@MateusStano MateusStano closed this Jan 2, 2023
@MateusStano MateusStano reopened this Jan 2, 2023
@MateusStano MateusStano merged commit 1baa95d into develop Jan 2, 2023
@Gui-FernandesBR Gui-FernandesBR deleted the bug/standard_atmosphere_pressure_calculation branch January 7, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Environment Enviroment Class related features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants