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:
874 bytes
|
Rev | Line | |
---|
[25367] | 1 | %% vec2pix
|
---|
| 2 | % Convert cartesian direction vectors to MEALPix pixel numbers
|
---|
| 3 |
|
---|
| 4 | %% Syntax
|
---|
| 5 | % nPix = vec2pix(nSide,xyz,'Param1',Value1,...);
|
---|
| 6 |
|
---|
| 7 | %% Input Arguments
|
---|
| 8 | % nSide HEALPix resolution parameter
|
---|
| 9 | % xyz cell array of [3,1] cartesian direction vectors
|
---|
| 10 | %
|
---|
| 11 | % Param Value
|
---|
| 12 | % 'nest' use nested indexing (true | {false})
|
---|
| 13 |
|
---|
| 14 | %% Return Arguments
|
---|
| 15 | % nPix size(xyz) pixel number array
|
---|
| 16 |
|
---|
| 17 | %% Example
|
---|
| 18 | % Find pixels corresponding to a [4,5] set of (unnormalized) cartesian
|
---|
| 19 | % vectors:
|
---|
| 20 | nSide = 4;
|
---|
| 21 | xyz0 = squeeze(num2cell(2*rand(3,4,5)-1,1));
|
---|
| 22 | nPix = vec2pix(nSide,xyz0)
|
---|
| 23 |
|
---|
| 24 | % Find the normalized vectors corresponding to the pixels
|
---|
| 25 | xyz1 = pix2vec(nSide,nPix);
|
---|
| 26 |
|
---|
| 27 | % Find angular distance from vectors to pixels
|
---|
| 28 | d = angDist(xyz0,xyz1)
|
---|
| 29 |
|
---|
| 30 | %% See also
|
---|
| 31 | % ang2pix, pix2ang, pix2vec
|
---|
| 32 |
|
---|
| 33 | %% Requires
|
---|
| 34 | % ring2nest
|
---|
| 35 |
|
---|
| 36 | %%
|
---|
| 37 | % Copyright 2010-2011 Lee Samuel Finn. <mealpix_notices.html Terms of Use>. |
---|
Note:
See
TracBrowser
for help on using the repository browser.