-
Notifications
You must be signed in to change notification settings - Fork 42
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
Nan when the SH order reaches 160 #3
Comments
The cause of this limitation is limited numerical precision. The largest word length for the representation of floating point numbers in Matlab is double precision i.e. 64 bit. This is far more than enough to represent reasonable input and output data for the processing. However, it can be a limiting factor in intermediate steps of the processing. In case of Spherical Harmincs, the Spherical-Harmonic-Transform/getSH.m Line 30 in c3c7419
This is what the Matlab documentation mentions about the function: In Matlab, the TL;DR: |
Thanks for the comments! I was playing with the code to reproduce the topography and crust of Mars and Moon. Please see the link as an example. Though the largest degree of the gravity model of the paper is 150, the highest degree used (in the reference) is 300+. |
Interesting. I have noticed before that Spherical Harmonics are also utilized in topography. Of course one certainly has to deal with much higher data densities in this context. So how are typical limitations in numerical precision dealt with in that context? AFAIK it is very cumbersome to get any regular programming language to deal with more than double precision. |
I guess that one may need to compute the spherical harmonics with associated Legendre polynomials and factorials combined. |
usually, the lgamma function is used to avoid large factorial division. Like this: |
Hi!
I like your code very much. However, I obtained NAN while using inverseSHT when the spherical harmonic order reaches 160. What is the upper bound of the order? Can you also compute higher order transform?
Many thanks,
Jia
The text was updated successfully, but these errors were encountered: