-
Notifications
You must be signed in to change notification settings - Fork 61
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
Vectorized numpy operations #48
Comments
Not sure what the best way would be. Using numpy or scipy would only be faster if the conversion is done by a function built-in to numpy or scipy. Show an example of the conversions you need to perform. Without that it is impossible to guestimate what the effort is.
Also, with respect to the "internal data types", several pygeodesy modules, classes and functions do support data in a numpy array format. However the modules, classes and functions, like EcefKarney or ellipsoidalKarney which use and require Karney's geographiclib (in Python) must use a format compatible with the latter, obviously.
|
The pygeodesy.EcefKarney class is a Python version of the Geocentric class transcribed from Karney's GeographicLib library in C++. That is one library to look into and perhaps other ones like pymap3d and oyb . The pymap3d package does support One other comment. Adding a vectorized version of the For example, those vectorized methods would accept a Also, to reduce the overhead, the vectorized methods would do little or no argument checking and return a fixed, minimally required result. Note, vectorize does not mean numpy.vectorize. However, it remains to be seen -and measured- what the actual performance difference would be, especially for the EcefKarney.reverse case. Because that method is far more complicated and compute-intensive than other |
I see, thanks for the response, I will show you an example to clarify the functional requirements. The Idea would be IMO to have a function call that does all the computation using numpy under the hood, if a list, tuple is passed it can be converted to numpy and the operations needed to do the forward and backward operations would be done using numpy arrays, this would yield a significant speedup compared to the normal for loop approach. since numpy.vectorize is essentially a for loop under the hood. |
Great, looking forward to that. Also do check the PyMap3d package, it uses numpy provided that is installed. It wraps several Python functions with numpy.vectorize. However, it is unclear how much different/better that is versus calling the function from Python. |
Hello, I have large vectors of lat, lon, alt that I would like to convert to a local coordinate system some "enu" frame such that I can do calculations the ecef.Cartesian and the ecef.EcefKarney are doing the job but it is insanely slow to iterate over such a large number ~400,000 points. I believe that this would be much much faster if it could be vectorized with numpy and accept numpy vectors as input. Is this in anyway planned ?
what kind of effort would you estimate it would be to make such a change ? is there an alternative lib that I missed ?
I was also curious to know why the internal data types and not depend on numpy under the hood :), thanks in advance and for the great development :)
The text was updated successfully, but these errors were encountered: