source: issm/trunk-jpl/externalpackages/mealpix/help/pix2alm_help.m@ 25367

Last change on this file since 25367 was 25367, checked in by adhikari, 5 years ago

NEW: matlab package for analyzing spherical harmonics based on Max Tegmark's HEALpix tool

  • Property svn:executable set to *
File size: 1.0 KB
Line 
1%% pix2alm
2% Find spherical harmonic decomposition of function on sphere
3
4%% Syntax
5% alm = pix2alm(v)
6% alm = pix2alm(v, lmax)
7
8%% Input Arguments
9% v array of pixel values
10% lMax (optional) max order of harmonic to calculate
11%
12% nPix = numel(v), with nPix = 12*nSide^2 for nSide a power of 2.
13% lMax defaults to 2*floor(nSide/3)
14
15%% Return Arguments
16% alm coefficients of spherical harmonic expansion
17
18%% Description
19% Let $x_k$ denote the location of pixel $k$ and $v_k$ the function value
20% at $x_k$. Then
21%
22% $$alm(j) = \frac{4\pi}{N}\sum_{k=0}^{N-1} Y_{LM}^{\dagger}(x_k) v_k$$
23%
24% where $j=(L+1)^2+M-L$ and $N$ is the number of pixels (12*nSide^2)
25
26%% Example
27% estimate alm of dummy data
28ns = 2^4;
29np = 12*ns^2;
30v = ylm(ns,1,1) + ylm(ns,2,-2) + ylm(ns,3,0) + rand(1,np)/10;
31lMax = 4;
32alm = pix2alm(v,lMax);
33for L = 0:3
34 fprintf('L = %d: ',L);
35 fprintf('%7.3f ',abs(alm((L+1)^2+(-L:L)-L)));
36 fprintf('\n');
37end
38
39%% See also
40% alm2pix
41
42%% Requires
43% ylm
44
45%%
46% Copyright 2010-2011 Lee Samuel Finn. <mealpix_notices.html Terms of Use>.
Note: See TracBrowser for help on using the repository browser.