ENH Precalculate Barometric Height#511
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #511 +/- ##
===========================================
+ Coverage 72.34% 72.36% +0.02%
===========================================
Files 56 56
Lines 9393 9409 +16
===========================================
+ Hits 6795 6809 +14
- Misses 2598 2600 +2 ☔ View full report in Codecov by Sentry. |
Gui-FernandesBR
left a comment
There was a problem hiding this comment.
Good work, @MateusStano !! Before approving this one, I'd like to see some unit tests for the barometric height, lemme know if you need any help.
Question: What would happen if a given Environment had the same value of pressure at diferent altitude? For example, for really high altitudes.
|
Hey! @Gui-FernandesBR solved everything you commented. However, during the test creation, I identified an issue with the barometric height data. In some environmental models, the pressure remains constant from the surface up to a specific altitude. For example, the pressure assumed in our tests remains constant from ground level to 722 meters. This is a problem for the To solve this, I've added exatrapolation into the pressure data. I would appreciate a double check on this solution. |
|
I know the implementation seems to be straightforward, but I'd like to ensure the code will have the best behavior under different circumstances...
|
|
Hey, guess I forgot the I changed the implementation to use this, and it seems more consistent. The error showed by @Gui-FernandesBR has been fixed. Regarding the "correctness" of the barometric_height, it should not be very wrong. The The only inconsistency happens with models that consider the pressure to be constant from height 0 to a certain level, like this: This is using the Wyoming Upper Air Soundings example from the environment usage notebook. Since we are dealing with parachutes that commonly have triggers at low altitudes, simply inverting this curve would not be sufficient for our applications. The resulting By using Note that, in this case, the reason for the pressure to be constant below 720m is because the data is from a weather observation site located at an elevation of 720m ASL. Also note that the height here can reach negative values. However, unless the user has set the elevation of the environment to be negative, this will never be called in the simulation. The extrapolation is the most logical way to extend the data from environment models to our use case. |
Thanks for the comments! Gonna review it again as soon as possible just to double check it. |
f0fbc15 to
0551317
Compare
Gui-FernandesBR
left a comment
There was a problem hiding this comment.
Good work here, @MateusStano !
I ran some examples locally and everything seems to be working correctly.
I'm also trusting the unit tests here.
This PRs reminds me that the Environment class has some code repetitions. We could work on a refactor/overhaul in the future. Lot of the code remains the same since the first commits.
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>





Pull request type
Checklist
black rocketpy/ tests/) has passed locallypytest --runslow) have passed locallyCHANGELOG.mdhas been updated (if relevant)Current behavior
The
find_inputcalls to get the height AGL from the pressure value for the parachute trigger was slowing down the simulation drastically:New behavior
Now a
Functionis created inEnvironmentcalledbarometric_heightand that is called inside theFlightclass instead:Additional information
This
find_inputcall was added in #345