-
Notifications
You must be signed in to change notification settings - Fork 3
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
legendre_assoc(): overflow #9
Comments
Can you do me a favor and track down exactly where this is coming from and/or provide me a test case? |
I'm just going to keep encouraging you to get your hands dirty and start writing/fixing code :). |
here is my case:
|
Could you provide a reference for your implementation, please? It might help to identify possible sources of numerical instability... Thanks! |
Mmmm there is no real reference besides numpy's docs: |
@tjlane: I don't understand your answer. I am looking for a reference for the formulae in lines https://github.com/tjlane/thor/blob/master/src/python/math2.py#L343 and following. |
aha yes, I gotcha now! I stole it from here: http://mpmath.googlecode.com/svn/trunk/doc/build/functions/orthogonal.html?highlight=legendre#legenp There is likely a better way. Note that as Robert mentioned previously, scipy is working on improving their spherical harmonic/legendre implementations this summer, so we should team up with them if possible. |
Ok. Many thanks! What do you mean by "I stole it"? Did you copy their source code or did you just write down their description at |
Ah I just did my own implementation of their math equation. Didn't copy any code -- though that might have been a good idea. TBH I was looking for the fastest thing (in TJ time, not computer time) I could get working! |
Thank you for your help. |
@CoChrists going through old issues and this one came up. Should we just wait for scipy to improve their associated legendre implementation? Or would it be helpful for you if we tackled this? |
I have not looked into this for a while, but yes, it would be great if these functions would work reliably. We can start investigating again, by trying to reproduce the issue and then go on from there? |
Using
thor.scatter.sph_hrm_coefficients()
withq_magnitudes = (1.0, 2.0, 3.0)
andnum_coefficients = 32
I get this warning:Sounds serious to me...
The text was updated successfully, but these errors were encountered: