Module s2_ylm_mod

module s2_ylm_mod

        ! Uses
    use s2_types_mod
    use s2_error_mod
    use s2_dl_mod
    use s2_sky_mod

        ! Variables
    integer, public, parameter :: S2_YLM_EVAL_METHOD_LEG = 1
    integer, public, parameter :: S2_YLM_EVAL_METHOD_WIG = 2
    integer, public, parameter :: S2_YLM_REALITY_REAL = 1
    integer, public, parameter :: S2_YLM_REALITY_IMAG = 2
    integer, public, parameter :: S2_YLM_REALITY_ABS = 3

        ! Subroutines and functions
    public function s2_ylm_sky (el, m, nside, reality, pix_scheme_in, method_in) result (ylm)
    private function s2_ylm_eval_wig (el, m, theta, phi) result (ylm)
    public function s2_ylm_eval_leg (el, m, theta, phi) result (ylm)
    private function s2_ylm_plm (el, m, x) result (plm)
    private function logfact (n) result (logfactn)

end module s2_ylm_mod
Provides functionality to compute spherical harmonic functions.

Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)

Version: 0.1 February 2008


Description of Variables

S2_YLM_EVAL_METHOD_LEG

integer, public, parameter :: S2_YLM_EVAL_METHOD_LEG = 1
Evalute ylms using associated Legendre functions.

S2_YLM_EVAL_METHOD_WIG

integer, public, parameter :: S2_YLM_EVAL_METHOD_WIG = 2
Evaluate ylms using Wigner functions.

S2_YLM_REALITY_REAL

integer, public, parameter :: S2_YLM_REALITY_REAL = 1
Evaluate real part of ylms.

S2_YLM_REALITY_IMAG

integer, public, parameter :: S2_YLM_REALITY_IMAG = 2
Evaluate imaginary part of ylms.

S2_YLM_REALITY_ABS

integer, public, parameter :: S2_YLM_REALITY_ABS = 3
Evaluate absolute value of ylms.

Description of Subroutines and Functions

s2_ylm_sky

public function s2_ylm_sky (el, m, nside, reality, pix_scheme_in, method_in) result (ylm)
    integer, intent(in) :: el
    integer, intent(in) :: m
    integer, intent(in) :: nside
    integer, intent(in) :: reality
    integer, optional, intent(in) :: pix_scheme_in
    integer, optional, intent(in) :: method_in
    type (s2_sky) :: ylm
    ! Calls: pix2ang_nest, pix2ang_ring, s2_error
end function s2_ylm_sky
Evaluate spherical harmonic function Ylm over full sky.

Variables:

Author: J. D. McEwen

Version: 0.1 February 2008

s2_ylm_eval_wig

private function s2_ylm_eval_wig (el, m, theta, phi) result (ylm)
    integer, intent(in) :: el
    integer, intent(in) :: m
    real (kind=s2_dp), intent(in) :: theta
    real (kind=s2_dp), intent(in) :: phi
    complex (kind=s2_dpc) :: ylm
    ! Calls: s2_dl_beta_operator, s2_error
end function s2_ylm_eval_wig
Evaluate spherical harmonic function Ylm at specified value of theta and phi using Wigner dlmn function evaluations.

Notes:

Variables:

Author: J. D. McEwen

Version: 0.1 February 2008

s2_ylm_eval_leg

public function s2_ylm_eval_leg (el, m, theta, phi) result (ylm)
    integer, intent(in) :: el
    integer, intent(in) :: m
    real (kind=s2_dp), intent(in) :: theta
    real (kind=s2_dp), intent(in) :: phi
    complex (kind=s2_dpc) :: ylm
end function s2_ylm_eval_leg
Evaluate spherical harmonic function Ylm at specified value of theta and phi using associated Legendre function evaluations.

Variables:

Author: J. D. McEwen

Version: 0.1 February 2008

s2_ylm_plm

private function s2_ylm_plm (el, m, x) result (plm)
    integer, intent(in) :: el
    integer, intent(in) :: m
    real (kind=s2_dp), intent(in) :: x
    real (kind=s2_dp) :: plm
    ! Calls: s2_error
end function s2_ylm_plm
Computes the associated Legendre function for x, l and m. Adapted from numerical recipes.

Notes:

Variables:

Author: J. D. McEwen

Version: 0.1 June 2005

logfact

private function logfact (n) result (logfactn)
    integer, intent(in) :: n
    real (kind=s2_dp) :: logfactn
    ! Calls: s2_error
end function logfact
Computes the natural logarithm of an (integer) factorial.

Variables:

Author: J. D. McEwen

Version: 0.1 October 2007