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
Plot power #50
Plot power #50
Conversation
before merging, I would like to implement the grid search for symmetry axes as well. |
|
yes. That should be the goal. Ultimately the underlying functions for particular spectra could become private.
yes
this is a question of definition. In my opinion the power spectrum should (!) depend on the normalization. It merely states how much energy you have in different basis functions. If the basis functions are normalized differently, the power spectrum needs to change as well. I agree that the 4pi normalized power is probably easiest to interpret physically because it corresponds to the harmonics variance in space. The unit normalized power corresponds to the total energy of the harmonic in space. The other normalizations I don't know about.
In my opinion,
OK. I'll provide better documentation. These methods are used e.g. in cosmology. Everything they do is to analyse whether energy is concentrated in high m (sectorial harmonics) or low m (zonal) coefficients. I think it is a nice addition that allows to go past the usual per degree analysis that throws away all information about orientation that is contained in a 2D spectrum. |
For the definition of the power spectrum, what I have been using is simply Parsival's theorem:
It is S(l) that I call the power spectrum. With this definition, the numerical value of S(l) is independent of normalization. However, the exact equation that relates S to the coefficients does depend on the normalization. We could define an (internal?) variable that is the L2 norm of the vector (i.e., sum of the coefficients squared) and then relate this to S(l). |
I think that's a good solution. Let's have a flag that states switches on the 4pi normalization or not instead of different subroutines. The 4pi normalized power has units power per unit area and per l, whereas the unit power has units (total) power per l. Parseval's theorem can simply be stated differently without the 1/(4 pi) and you will have a different definition ... Many (!) papers use the unit normalized L2 norm of the coefficients as 'power spectrum' (e.g. as in Dahlen & Tromp 1998). Therefore I don't think that the 4pi is a general rule . On the web I found this: Wikipedia has a very unclear definition in my opinion:
From Wolfram Mathworld it sounds like the power spectrum should be per unit area, i.e. 4pi normalized. Anyway that's just a choice of units:
|
Here is where the 4pi comes from
A lot of people work on the "unit sphere" where r=1, and in this case it is easy to find an argument to ignore the 4pi factor. However, as soon as the sphere has a radius that is not 1, it becomes more difficult to ignore this. |
You normalize power by the area of the sphere in this equation. This is an arbitrary definition that many people chose differently. They will have different units for their power spectrum. In my opinion this is just a matter of units and defintiions. We cannot claim that 4pi is what has to be used, even though it has really sensible units. EDIT: quick example. Think about quantum mechanics, where probability densities are expressed in spherical harmonics. In this case it makes really sense to use unit normalized spherical harmonics and the L2 norm of their coefficients as power, because it is the total power on the sphere that is interesting and not necessarily the power per unit area. |
Can you write the equation for the power that you are proposing for the function f(theta, phi), without any reference to spherical harmonics? Here are my two definitions for power and energy:
|
Well I have seen both definitions called 'power'. This is my intuition (now):
I think you are right Mark, at least following the standard definition from physics:
Maybe we should just call the proposed function energy then? Dahlen & Tromp 1998 has yet another definition or is just incorrect (?) Eq. B95 and following.
This doesn't make sense in my opinion. |
another proposal:
what do you think? |
here one more definition of power, as coefficient variance of orthonormal harmonics: often it is just called spectral density function which avoids the physical connotations of power and energy... E.g.: To sum up, there are different definitions in different communities. SHTOOLS seems to follow the signal processing definitions. |
For the publication that we will eventually write, we will have to summarize all of these definitions. The best way to do this will probably be to provide the equation that relates the quantity measured in the space domain to the corresponding equations using spherical harmonic coefficents. What makes this so confusing is that most people only provide the equation for I wonder if we should break this pull request into several smaller ones:
|
I'll split it up. Pls leave this PR open ... |
Can you refactor this pull request, given that most of the powerspectrum stuff has been added to master? |
I'm going to close this issue as no progress has been made in over a year, and many aspects of this have already been implemented. Concerning the anisotropy spectrum, I think that we might want to also look at the approach in Bills and Lemoine 1995 who define this as the ratio of the RMS slopes in the NS and EW direction. |
This is a proposition to provide a single function to plot power spectra.
.plot_powerspectrum(unit=xxx)
(i.e. summed power).plot_powerspectrum(unit='per_l')
plots the standard total power of a degree l.plot_powerspectrum(unit='per_lm')
plots the power of the individual coefficients in a 2d plot (see image below).plot_powerspectrum(unit='per_band', bandwidth=2)
plots the summed power in an octave bandI propose to keep all sums it in coefficient normalization as opposed to always converting to 4pi.
The next step is to define
powerspectraldensity
in a clean way, although I think this will be quite difficult because 1) density implies always a 'power per something' and 2) it implies some kind of averaging (in frequency or in space) over something. E.g. right nowSHPowerSpectrumDensity
is the power per lm averaged over one particular l. Many other power spectral densities are possible. In the random model world, the global power per degree l (and a small neighbourhood) can be seen as the power per degree l averaged over local subregions of the model. I don't know what the best clean distinction is.new plots:
Earth spectrum (linear plot). Slight North-South anisotropy at degrees 3-5
This is the Mars spectrum (log plot), zonal degree 1/2...