source:
issm/oecreview/Archive/19101-20495/ISSM-19322-19323.diff@
20498
Last change on this file since 20498 was 20498, checked in by , 9 years ago | |
---|---|
File size: 1.0 KB |
-
../trunk-jpl/src/m/psl/shlm.m
1 function sh_lm = shlm(index,sh,lMax,func,areas) 2 3 %SHLM :: a function to compute SH coefficients of a function 4 % 5 %USAGE: sh_lm = shlm(index,sh,lMax,func,areas); 6 % 7 %index (md.mesh.elements) 8 %sh (spherical harmonics) 9 %lMax (maximum SH degree to be considered) 10 %func (any function) 11 %areas (area of elements) 12 % 13 14 p = 0; 15 16 sh_lm = zeros((lMax+1)^2,1); 17 %sh_lm = zeros(1,(lMax+1)^2); 18 19 % weighted area integration over the unit sphere 20 for l=0:lMax 21 for m=-l:l 22 func0 = sh(:,1+p).*func; 23 sh_lm(1+p) = sum(mean(func0(index),2).*areas); 24 p = p+1; 25 end 26 end 27 sh_lm = sh_lm/sum(areas); 28 %sh_lm = sh_lm*4*pi/sum(areas); 29
Note:
See TracBrowser
for help on using the repository browser.