Thursday, September 10, 2015

Spherical harmonics displayed

A few days ago, I noted that the climate debate was getting a bit quiet, and while keeping up with data etc, I would try also to talk a bit more about math. And I said a bit about how to implement spherical harmonics (SH), which I use in graphics.

Well, today I'd like to add a bit of color. I showed a Wiki illustration of the spherical harmonics. I thought that I could enhance the idea with some WebGL, and show higher orders (with world map added). So that is done here. You can choose between the orbital shapes, which are actually a kind of 3D polar plot, and just a surface shaded plot. The shapes are good for seeing the symmetries, but I think the shade plots may in the end be more informative.

I'm going to follow up further with SH. I'm using it for spatial integration, and I want to explore what can be done with spatial spectra. I'll blog about these soon. But for the moment, below the fold is the active WebGL display.

This plot is another variant of the generic sphere WebGL. It has the usual trackball capability. The options are
  • 3D button - toggles between the orbital shape and shaded surface view
  • Color - if you find the rainbow colors hurt your eyes, you can cycle through gentler alternatives
  • L,M - a text box where you can write in values. Remember, L is the latitude parameter, M longitude, and |M|≤L. You can enter values directly if you like, with L from 0 to 12. Out of range values will just make the box go red. But you may prefer to use the colorful squares top right. It's an integer array with L as x-variable, M as y. Just click, and the numbers will appear in the text box, and the corresponding shape will show.
  • Orient just restores the globe so the center line is N-S. "Plot New" probably won't be needed, unless you write in the LM text box directly.

The idea of showing the world map is that the spacing of the SH lobes gives an idea of the scale of temperature effects that can be resolves. This works better in the shaded surface version than the orbitals.


Post a Comment