comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: spherical harmonic representation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: spherical harmonic representation [message #67224] Tue, 21 July 2009 07:55
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <k-bowman-C664B6.09160321072009@news.tamu.edu>,
"Kenneth P. Bowman" <k-bowman@null.edu> wrote:

Had the theta and phi arguments switched. This works.

Ken


pro sph_plot

l=5 ;harmonic degree
m=2 ;azimuthal order |m| <= l
np = 101 ;No. of inclination angle(theta) and azimuthal angle(phi)

x = 360.0D0*DINDGEN(np)/(np-1) ;phi = 0, 360
y = 180.0D0*DINDGEN(np)/(np-1) ;theta = 0, 180
xx = REBIN(x, np, np)
yy = REBIN(REFORM(y, 1, np), np, np)

ff = real_part(spher_harm(yy*!dtor, xx*!dtor, l, m, /doub))

window, 0, xsize = 512, ysize = 512, title = 'Spherical Harmonic'

MAP_SET, /CYLINDRICAL

contour, ff, x, y-90.0, /ove, nlevels=10

isurface, ff, x, y-90.0

end
Re: spherical harmonic representation [message #67225 is a reply to message #67224] Tue, 21 July 2009 07:16 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<44077862-b715-4e61-a59c-0d4e390c4e6a@r2g2000yqm.googlegroups.com>,
maurya <ramaurya98@gmail.com> wrote:

> Hi everybody,
>
> I want to display spherical harmonics on a sphere, as given on web
> page:
>
>
> But, it is not giving results as expected (as given on the above web
> page).
>
> Can anyone help me.
>
> Thanks

There are two immediate errors that I see. Theta is the co-latitude, not the latitude,
and should range from 0 to 180, not -90 to 90. If you want to plot the whole sphere,
the longitude angle phi should range from 0 to 360 (or -180 to 180), not -90 to 90.

When I fix these things there is still something wrong. The longitudinal variation
should be a single wave-5 sinusoid, but it is not. Either I am still missing something,
or there is a bug in SPHER_HARM.

(I changed a few details to make it easier for me to understand.)

Ken Bowman



pro sph_plot

l=5 ;harmonic degree
m=2 ;azimuthal order |m| <= l
np = 101 ;No. of inclination angle(theta) and azimuthal angle(phi)

x = 360.0D0*DINDGEN(np)/(np-1) ;phi = 0, 360
y = 180.0D0*DINDGEN(np)/(np-1) ;theta = 0, 180
xx = REBIN(x, np, np)
yy = REBIN(REFORM(y, 1, np), np, np)

ff = real_part(spher_harm(xx*!dtor, yy*!dtor, l, m, /doub))
;ff = IMAGINARY(spher_harm(xx*!dtor, yy*!dtor, l, m, /doub))

window, 0, xsize = 512, ysize = 512, title = 'Spherical Harmonic'

MAP_SET, /CYLINDRICAL

contour, ff, x, y-90.0, /ove, nlevels=10

isurface, ff, x, y-90.0

end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: spherical harmonic representation
Next Topic: stregex question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:50:28 PDT 2025

Total time taken to generate the page: 0.00661 seconds