Comments (1)
Solving this was much harder than I thought it would be. But I have done it in the latest commit.
Turns out that some weather files present latitude values in in descending sorted order, such as ERA-Interim files for South America. This is the reason that the last approach was to check if the input coordinates are in between two consecutive coordinates of the weather file by using a sign multiplication method, fail-safe in terms of ascending or descending order.
However, it is true that it was slow. To make it faster, bisect was used and descending grids were dealt with by reversing them, than applying bisect and than reversing them again.
Furthermore, instead of operation on the masked arrays of latitudes and longitudes given by netCDF4, the arrays were first converted into simple lists. This may present problems if the grid has empty values, but this is not generally the case with the common weather models. Since it improves significantly the speed of the code, I decided that it is definitely worth it.
In the end, we achieved a speed increase varying from 10 times to 1000 times, depending on size of the latitudes and longitudes list, dropping from ms to micro seconds.
from rocketpy.
Related Issues (20)
- BUG: KeyError: 'I_11' and AttributeError: 'NoneType' object has no attribute 'reset' HOT 1
- ENH: Support for Open Meteo API
- ENH: make rocketpy classes json serializable
- ENH: adds an 3D animation of flight trajectory
- DOC: Software in a Loop (SIL) example with parachute ejection systems
- DOC: update badges on our README
- DOC: stop cloning the whole repository just for examples HOT 1
- ENH: plot inertia tensor components in a single plot
- ENH: display both power_off_drag and power_on_drag in a single plot
- ENH: adds `axial_acceleration` attribute to the Flight class HOT 2
- MNT: EmptyMotor class inherits from Motor(ABC)
- MNT: delete tools.cached_property
- DOC: convert notebooks to .rst files in the documentation
- ENH: Support for Meteomatics API
- ENH: give me a scissor or apply `Function.clip` and `Function.crop`
- BUG: Invalid Center of Pressure for Rockets with Variable Diameter
- Incorrect/incomplete docstring in environment.py HOT 4
- MNT: save ref_factor value when adding aero surfaces to a Rocket
- ENH: Allow saving plots instead of showing them HOT 3
- BLD: change setup.py to pyproject.toml HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocketpy.