spherical harmonics [message #21988] |
Fri, 13 October 2000 00:00  |
Klaus Gottschaldt
Messages: 1 Registered: October 2000
|
Junior Member |
|
|
Hallo!
I want to analyze data on a sphere, representing them by spherical
harmonic coefficients.
This is somehow like a Fourier transform, but based on Legendre
polynoms, which are
defined on the surface of a sphere.
Unlike wavelets, this transform is global.
My data are given in the form [longitude, latitude, data_value], where
longitude, latitude
and data_value are vectors of the same length.
Data points are randomly scattered over the sphere with a resolution of
approx. 100km
on the Earth's surface.
Does somebody know, how to do this transform with idl?
Klaus
|
|
|
|
|
Re: spherical harmonics [message #76543 is a reply to message #21988] |
Thu, 16 June 2011 09:03   |
parama mukherjee
Messages: 4 Registered: June 2011
|
Junior Member |
|
|
Hi,
I downloaded the Spherepack application but meanwhile also chanced
upon the following code (I am posting only parts of it) in IDL that
claims to do spherical harmonic transforms. I did not want to use a
fortran/C code as I need to do transforms at every time step of my
calculation and thought going to and fro between IDL and Fortran may
not be very efficient. So if I can get this to work it will be really
helpful. The problem with the code right now is I cannot follow what
it means by collocation points, or the cp parameter that it lists as
one of its input. I post below the parts where it mentions about
collocation points :
; spherical_transform.pro - This routine performs a spherical
harmonic
; transform on a 2-D array.
;
; usage: B = spherical_transform(A,cp,lmax=lmax,period=period)
; where B(lmax,lmax) = transformed array ordered (l,m)
; A(n_phi,n_theta) = array to be transformed ordered
(phi,theta)
; cp = cosine of theta collocation points for theta grid
; lmax = maximum l in expansion (default is (2*n_theta-1)/
3)
; period = periodicity factor in phi
; This routine performs a spherical harmonic transformation on a 2-D
; (N_phi,N_theta) array. Currently all the work is done in idl, but
future
; versions may want to call C or Fortran routines for efficiency
reasons.
; The input parameters include the array A and the colocation points
for the
; grid (cos(theta)), which is of length N_theta, along with an
optional
; specification of lmax.
; preliminaries
costheta=double(cp)
------------------------------------------------------------ ----------------------
Now I was thinking maybe cp is an array of cos(theta) values for all
theta 0 - 180 but the costheta = double(cp) is unclear to me.
Please advice.
Thanks,
-Parama
|
|
|
|
Re: spherical harmonics [message #84618 is a reply to message #76537] |
Thu, 16 June 2011 14:07  |
parama mukherjee
Messages: 4 Registered: June 2011
|
Junior Member |
|
|
Hi,
Thanks for the piece of advice. So I downloaded the Sphere pack
application but at the same time would want to see this code work too.
Maybe can do a comparison later on.
Going by the definition in wikipedia for collocation point, I cannot
place it in the scheme of things here. Like my input array has data
points in a latitude-longitude grid and the ourput would be
coefficients for various l and m so what are collocation points and
what has cos(theta) to do with it. I tried cos(theta) : theta from -90
to 90 but does not work.
Could you please reflect on this?
Thanks,
-Parama
|
|
|