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

Home » Public Forums » archive » RE: Legenders polynomial
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: Legenders polynomial [message #80364] Tue, 12 June 2012 01:44
Baro is currently offline  Baro
Messages: 19
Registered: May 2012
Junior Member
Hello Bringfried

Thank you for your concern.

Yes, their is a function in IDL. But I was doing this for GRACE satellite data analysis, I need to know the approach used in generating this data's. After a sleepless night I have solved the problem.

cheers
Guta
Re: Legenders polynomial [message #80369 is a reply to message #80364] Mon, 11 June 2012 12:39 Go to previous message
bstecklu is currently offline  bstecklu
Messages: 14
Registered: February 2012
Junior Member
May be I am missing something but if you mean the Legendre polynomial, idlhelp
states that the corresponding function exists in IDL since version 5.4. So was
this a kind of exercise?

Regards, Bringfried

gutewaqi wrote:
> Dear All,
>
> I was trying to compute the legender function. I wrote the code as shown
> below. But it is not working right. could you help. Thank you in advance
> -------------------------------------------------------
>
> PRO legenders_function,theta,lmax
>
> ;Give the IDL compiler information that changes some of the default rules
> COMPILE_OPT idl2, HIDDEN
>
> ; Error handling. ; CATCH, theError ; IF
> theError NE 0 THEN BEGIN ; Catch, /CANCEL ;
> void = ERROR_MESSAGE() ; RETURN ; ENDIF
>
> ;declare global variables COMMON MYGLOBAL,alm,blm ;set maximum degree,i.e
> lmax lmax = 60 ;initialization legenders function factors m = fltarr(lmax+1)
> l = fltarr(lmax+1) X = replicate(0.0,lmax+1, lmax+1) alm =
> replicate(0.0,lmax+1, lmax+1) blm = replicate(0.0,lmax+1, lmax+1) alm[2,2] =
> sqrt(3) ;compute the legenders function factors IF
> size(alm[*,0],/dimensions)LT lmax+1 THEN BEGIN FOR l=2,lmax-1 DO BEGIN
> alm[l+1,l+1] = sqrt((2.0*l+1.0)/(2.0*l)) ENDFOR FOR m=0,lmax-1 DO BEGIN FOR
> l=m+1,lmax-1 DO BEGIN X=(2.0*l+1.0)/((l+m)*(l-m)) alm = sqrt(X*(2.0*l-1.0))
> blm = sqrt(X*(l-m-1.0)*(l+m-1.0)/(2.0*l-3.0)) ENDFOR ENDFOR ENDIF
>
> ; set the values of theta in radian cosTheta = cos(3) sinTheta = sin(3)
> ;initialization of legenders function Plm = replicate(0.0,lmax+1, lmax+1)
> Plm[1,1] = 1.0 ;compute the legenders function values FOR l=0,lmax-1 DO BEGIN
> Plm[l+1,l+1] = alm[l+1,l+1]*sinTheta*Plm[l,l] ENDFOR
>
> FOR m=0,lmax-1 DO BEGIN Plm[m+2,m+1] = alm[m+2,m+1]*cosTheta*Plm[m+1,m+1]
> ENDFOR
>
> FOR m=0,lmax-1 DO BEGIN FOR l=m+2,lmax DO BEGIN Plm[l+1,m+1] =
> alm[l+1,m+1]*cosTheta*Plm[l,m+1]-blm[l+1,m+1]*Plm[l-1,m+1] ENDFOR ENDFOR
> print,'program completed' END
>
> --http://compgroups.net/comp.lang.idl-pvwave/
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: how to align the position of the absorption line for different files at one single postion
Next Topic: plot problem

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

Current Time: Wed Oct 08 15:58:04 PDT 2025

Total time taken to generate the page: 0.02410 seconds