rdireen / spherepy

Numerical routines written in python for working with spherical hamonics
GNU General Public License v3.0
12 stars 3 forks source link

Coefficients for Large N values #5

Closed anene closed 9 years ago

anene commented 9 years ago

High N values (>~1200) produce large coefficient values that seem odd (>10^64+)

rdireen commented 9 years ago

This sounds like it could possibly be a Gibbs ringing problem. This happens when you don't have the data in quite right. Discontinuities will cause ringing in higher n values. Instructions for formatting the data can be found here under the ScalarPatternUniform section. But, if you send me your data file I'll put it in correctly for ya.

Could you post the code you used to import the data with?

rdireen commented 9 years ago

@anene I've confirmed that this is actually a bug within the lower level routine of spherepy. In pysphi/csphi there is a routine called ynnm that has a loop that underflows. I'll get to this soon.

rdireen commented 9 years ago

I have fixed the dynamic range issues in pysphi and csphi. The Fourier coefficients ynunm generated by recursion formulas had underflow and overflow problems. I fixed the problem by dynamically changing the range with an extended exponent as I recursed through the values, and when I had a full vector of Fourier coefficients I adjusted their values with that extended exponent.