polymv Usage Guide
This guide demonstrates how to use the main features of the polymv package for working with multipole vectors.
Setup
Import the necessary libraries:
Generating Test Data
Let's create a test set of \(a_{\ell m}\)s:
lmax = 1500
np.random.seed(1)
alm = hp.synalm(np.ones(2000), lmax=lmax)
alm = np.column_stack([alm.real, alm.imag])
alm.shape
Output:
Multipole Vectors (mvs)
To obtain multipole vectors from \(\ell=2\) to \(\ell=1500\):
Output:
You can view a sample of the multipole vectors:
Output:
array([[ 1.83441666, 1.37302603, 1.30717599, 1.52087956, 1.62071309],
[ 0.12767786, 1.33828394, -3.01391479, 0.19300013, -2.94859252]])
Utility Functions
Extracting Specific Multipole Vectors
Get multipole vectors for \(\ell=3\):
Output:
array([[ 2.73836992, 2.08191869],
[ 1.52087956, 0.19300013],
[ 1.62071309, -2.94859252],
[ 2.34022757, 0.13144151],
[ 0.40322273, -1.05967396],
[ 0.80136509, -3.01015115]])
Convert to Cartesian Coordinates
Convert the multipole vectors to Cartesian coordinates:
Output:
array([[ 0.95759438, 0.12293233, -0.26057752],
[ 0.22593142, 0.95412221, 0.19648358],
[-0.95759438, -0.12293233, 0.26057752]])
Filter for North Hemisphere
Get only vectors in the north hemisphere:
Output:
Fréchet Mean Vectors (fvs)
Compute Fréchet mean vectors for all multipoles:
Output:
Show a sample:
Output: