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
Faster spherical harmonics #413
Conversation
def spherical_harmonics(m, n, theta, phi): | ||
r""" Compute spherical harmonics | ||
|
||
This may take scalar or array arguments. The inputs will be broadcasted |
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.
This all looks awesome to me. My only comment is an English thing: I believe this should be simply broadcast
http://www.oed.com/view/Entry/23508?redirectedFrom=broadcasted#eid13325489
Also - what exactly do you mean by "inputs will be broadcast against each other"? theta
and phi
will be made to conform if they can be broadcast to each other's shape?
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.
I used what it was in the documentation of scipy.special.sph_harm
http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.special.sph_harm.html
I think it is fine to say broadcasted. Even if it is not in some dictionaries. It is commonly used.
Any thoughts about pushing this upstream to scipy? Is there any reason that the larger scipy community would not want to benefit from this awesomeness? Or is this already in the latest scipy and I don't know about it? |
BTW - any idea why Travis is seg-faulting on this one? Seems like just a On Fri, Sep 5, 2014 at 5:01 PM, Ariel Rokem arokem@gmail.com wrote:
|
Seems like that's already happening. See @stefanv's comments on gh-404. On Fri, Sep 5, 2014 at 3:01 PM, MrBago notifications@github.com wrote:
|
Hey guys, With the last commits I now address all your comments. I test sph_harm and in spherical_harmonics I check if scipy version is higher that 0.15.0. Enjoy the speed! Merge if you think is good so we can test the recalibration with real data! |
@@ -37,6 +37,7 @@ | |||
from dipy.core.onetime import auto_attr | |||
from dipy.reconst.cache import Cache | |||
|
|||
import scipy.version as SCIPY_VERSION |
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.
I think this should be scipy.version.version
.
Ok thx @MrBago! Ready here! |
Thanx @ChantalTax, @pv and @stefanv for helping with this. Here is a faster implementation of spherical harmonics. This should make the calculation of real spherical harmonics and complex spherical harmonics faster everywhere in dipy.
Let me know what you think! This is now 100X faster. :D