-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Co-authored-by: Gui-FernandesBR <[email protected]>
Co-authored-by: Gui-FernandesBR <[email protected]>
Co-authored-by: Gui-FernandesBR <[email protected]>
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallypytest --runslow
) have passed locallyCHANGELOG.md
has been updated (if relevant)Current behavior
The
find_input
calls to get the height AGL from the pressure value for the parachute trigger was slowing down the simulation drastically:New behavior
Now a
Function
is created inEnvironment
calledbarometric_height
and that is called inside theFlight
class instead:Additional information
This
find_input
call was added in #345