Skip to content

Real matrix of Spherical Harmonics #60

@abhayap

Description

@abhayap

For multiple points on the sphere what's the best way to get a matrix where the columns are the points and the rows are the spherical harmonic modes for each of the points?

I did this but it does not work if only one point is passed in.

function Y(N::Integer, θ, ϕ)
    n, m = acnorder(N)
    Yres = computeYlm.(θ, ϕ, lmax = N, SHType = SphericalHarmonics.RealHarmonics())
    Ymat = reduce(hcat, Yres)
    # remove the Condon-Shortley phase
    condon = (-1).^m
    condon .* Ymat
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions