These are chat archives for SHTOOLS/SHTOOLS
mfor the y-axis
unit=l2norm. This is trivial if you think its useful : SHTOOLS/SHTOOLS#65
'l2norm' returns the sum of the magnitude squared of the coefficients for all angular orders as a function of spherical harmonic degree l.
cross power spectrumcan also become
return. Everything that follows is one word.
powerspectrum()is a function. The method calculates it, and then returns it (i.e., it is not already stored in the class). On the other hand, something like
set_modifies the data stored in the class, and something like
to_takes the data out of the class and returns it in another (standard) format.
powerspectrum()are all similar in that regard.
powerspectrum()is more like accessing an attribute of the class
rotate()actually modifies it
expand()returns definitely not an attribute
get_is used whenever an attribute is accessed. You are right that the power spectrum is not really an attribute, but I saw it as accessing a property of the coefficients, without modifying them
The terms get/set must be used where an attribute is accessed directly.
lons()is returning data stored in the attributes, and hence could be used with
get_, but I just thought it was too verbose. On top of that, these are not explicitly stored, but calculated when called...
power_spectrum? I'm still not sure about that one.
power_spectrumif we return the energy_spectrum
energyand then keep
power_spectrum. The difference between the two is only a factor of 4pi, and it could be argued that this optional argument might just cause confusion.
spectrumkeeping energy. Otherwise we shut out all physicists and all seismologists that don't use 4pi convention usually.
energy=True or False, we could do the following:
clm.spectrum(convention='power' or 'energy')
plot_coeffs(convention='power' or 'energy').
plot_coeffs(), it doesn't make sense to have
convention=l2norm, as we are only plotting a single coefficient. This is the only reason I can think of for having
l2normis now a
convention. When specified, the
unitsparameter is not used, given that we only plot/calculate sqaures of the coeffs. If we were to choose
l2normto be a
unit, then convention could be neither
from_grid(). The reason is that the SHWindow class needs to output both coeffs and grids as ndarrays, and we are using
gridto distinguish the two there.
per_lmas well. I don't see why it shouldn't be valid ...
plot_coeffs(), why don't we put it in the
plot_spectrumroutine should just have an argument, as the unit argument, about the way how it is plotted: as a function of l or as a function of l and m
to_grid()methods. This class already has
to_SHGrid(), so you could get the numpy array by
plot_coeffs(), this could be done, but it might be complicated with all the optional parameters (there is power vs. l, and color vs. l vs. m.).
SHWindow.to_array/grid()and then keeping just
SHWindow.to_SHCoeffs/SHGrid(). Last thing to resolve is
plot_coeffs/spectrum(). Let me think about how to combine these two...