module cswt_swav_mod ! Uses use cswt_error_mod use s2_types_mod use s2_sky_mod ! Types public type cswt_swav ! Variables integer, public, parameter :: CSWT_SWAV_DEFAULT_PIX_SCHEME = S2_SKY_RING character (len=*), public, parameter :: CSWT_SWAV_DEFAULT_NAME = 'Not specified' integer, public, parameter :: CSWT_SWAV_DILATION_DIM = 2 ! Interfaces public interface cswt_swav_init ! Subroutines and functions private function cswt_swav_init_fun (fun, nside, pix_scheme_in, lmax, mmax, param, name, dilation, alpha, beta, gamma, fun_type, norm_preserve) result (swav) private function cswt_swav_init_sky (sky, name, dilation, alpha, beta, gamma, norm_preserve) result (swav) private function cswt_swav_init_file (filename, name, dilation, alpha, beta, gamma, norm_preserve) result (swav) private function cswt_swav_init_copy (orig) result (copy) public subroutine cswt_swav_free (swav) public subroutine cswt_swav_dilate (swav, dilation, norm_preserve_in) public subroutine cswt_swav_rotate (swav, alpha, beta, gamma) public function cswt_swav_azimuthal_bl (swav, cutoff_prop) result (mmax_min) public subroutine cswt_swav_compute_alm (swav, lmax, mmax, message) public subroutine cswt_swav_write_map_file (swav, filename, comment) public function cswt_swav_get_init (swav) result (init) public function cswt_swav_get_sky (swav) result (sky) public subroutine cswt_swav_get_sky_alm (swav, alm) public function cswt_swav_get_map_status (swav) result (map_status) public function cswt_swav_get_alm_status (swav) result (alm_status) public function cswt_swav_get_nside (swav) result (nside) public function cswt_swav_get_pix_scheme (swav) result (pix_scheme) public function cswt_swav_get_name (swav) result (name) public function cswt_swav_get_admiss (swav) result (admiss) public function cswt_swav_get_admiss_perc (swav) result (admiss_perc) public function cswt_swav_get_dilation (swav) result (dilation) public function cswt_swav_get_alpha (swav) result (alpha) public function cswt_swav_get_beta (swav) result (beta) public function cswt_swav_get_gamma (swav) result (gamma) end module cswt_swav_modProvides functionality to support and manipulate a spherical wavelet. The spherical wavelet data structure includes the wavelet sky plus its parameters.
Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)
Version: 0.1 - November 2004
public type cswt_swav private logical :: init = .false. type (s2_sky) :: sky character (len=S2_STRING_LEN) :: name = trim (CSWT_SWAV_DEFAULT_NAME) real (kind=s2_sp) :: admiss = 0.0e0 real (kind=s2_sp), dimension (CSWT_SWAV_DILATION_DIM) :: dilation = (/ 1.0e0, 1.0e0 /) real (kind=s2_sp) :: alpha = 0.0e0 real (kind=s2_sp) :: beta = 0.0e0 real (kind=s2_sp) :: gamma = 0.0e0 end type cswt_swav
integer, public, parameter :: CSWT_SWAV_DEFAULT_PIX_SCHEME = S2_SKY_RINGDefault healpix pixelisation scheme.
character (len=*), public, parameter :: CSWT_SWAV_DEFAULT_NAME = 'Not specified'Default wavelet name if not specified.
integer, public, parameter :: CSWT_SWAV_DILATION_DIM = 2Dimension of dilation.
public interface cswt_swav_init module procedure cswt_swav_init_fun module procedure cswt_swav_init_sky module procedure cswt_swav_init_file module procedure cswt_swav_init_copy end interface cswt_swav_init
private function cswt_swav_init_fun (fun, nside, pix_scheme_in, lmax, mmax, param, name, dilation, alpha, beta, gamma, fun_type, norm_preserve) result (swav) interface fun function fun (x, phi, param) result (val) real (kind=s2_sp), intent(in) :: x real (kind=s2_sp), intent(in) :: phi real (kind=s2_sp), optional, intent(in), dimension (:) :: param real (kind=s2_sp) :: val end function fun end interface fun integer, intent(in) :: nside integer, optional, intent(in) :: pix_scheme_in integer, optional, intent(in) :: lmax integer, optional, intent(in) :: mmax real (kind=s2_sp), optional, intent(in), dimension (:) :: param character (len=*), optional, intent(in) :: name real (kind=s2_sp), optional, intent(in), dimension (CSWT_SWAV_DILATION_DIM) :: dilation real (kind=s2_sp), optional, intent(in) :: alpha real (kind=s2_sp), optional, intent(in) :: beta real (kind=s2_sp), optional, intent(in) :: gamma integer, optional, intent(in) :: fun_type logical, optional, intent(in) :: norm_preserve type (cswt_swav) :: swav ! Calls: cswt_error, cswt_swav_dilate, cswt_swav_rotate end function cswt_swav_init_funInitialise a swav (spherical wavelet) from a template function defined either on the sphere or plane.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_init_sky
private function cswt_swav_init_sky (sky, name, dilation, alpha, beta, gamma, norm_preserve) result (swav) type (s2_sky), intent(in) :: sky character (len=*), optional, intent(in) :: name real (kind=s2_sp), optional, intent(in), dimension (CSWT_SWAV_DILATION_DIM) :: dilation real (kind=s2_sp), optional, intent(in) :: alpha real (kind=s2_sp), optional, intent(in) :: beta real (kind=s2_sp), optional, intent(in) :: gamma logical, optional, intent(in) :: norm_preserve type (cswt_swav) :: swav ! Calls: cswt_error, cswt_swav_dilate, cswt_swav_rotate end function cswt_swav_init_skyInitialise a swav (spherical wavelet) from a predefined sky.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_init_file
private function cswt_swav_init_file (filename, name, dilation, alpha, beta, gamma, norm_preserve) result (swav) character (len=*), intent(in) :: filename character (len=*), optional, intent(in) :: name real (kind=s2_sp), optional, intent(in), dimension (CSWT_SWAV_DILATION_DIM) :: dilation real (kind=s2_sp), optional, intent(in) :: alpha real (kind=s2_sp), optional, intent(in) :: beta real (kind=s2_sp), optional, intent(in) :: gamma logical, optional, intent(in) :: norm_preserve type (cswt_swav) :: swav ! Calls: cswt_error, s2_sky_free end function cswt_swav_init_fileInitialise a swav (spherical wavelet) from a sky read from an input file.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_init_copy
private function cswt_swav_init_copy (orig) result (copy) type (cswt_swav), intent(in) :: orig type (cswt_swav) :: copy ! Calls: cswt_error end function cswt_swav_init_copyInitialise a new swav (spherical wavelet) as a copy of another swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_free
public subroutine cswt_swav_free (swav) type (cswt_swav), intent(inout) :: swav ! Calls: cswt_error, s2_sky_free end subroutine cswt_swav_freeFree all data associated with an initialised swav and reset all other attributes.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_dilate
public subroutine cswt_swav_dilate (swav, dilation, norm_preserve_in) type (cswt_swav), intent(inout) :: swav real (kind=s2_sp), intent(in), dimension (CSWT_SWAV_DILATION_DIM) :: dilation logical, optional, intent(in) :: norm_preserve_in ! Calls: cswt_error, s2_sky_dilate end subroutine cswt_swav_dilateDilate the spherical wavelet and update the dilation parameter. Only a mother wavelet with dilation of one may be dilated (otherwise a different dilation would have to be performed to give the correct final dilation).
Notes:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_rotate
public subroutine cswt_swav_rotate (swav, alpha, beta, gamma) type (cswt_swav), intent(inout) :: swav real (kind=s2_sp), intent(in) :: alpha real (kind=s2_sp), intent(in) :: beta real (kind=s2_sp), intent(in) :: gamma ! Calls: cswt_error, s2_sky_rotate end subroutine cswt_swav_rotateRotate a spherical wavelet. Only an originally non-rotated wavelet may be rotated (otherwise a different rotation would have to be performed to give the correct final rotation).
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_azimuthal_bl
public function cswt_swav_azimuthal_bl (swav, cutoff_prop) result (mmax_min) type (cswt_swav), intent(inout) :: swav real (kind=s2_sp), optional, intent(in) :: cutoff_prop integer :: mmax_min ! Calls: cswt_error end function cswt_swav_azimuthal_blFind azimuthal band limit of wavelet. Finds lowest m' value such that cutoff_prop*100 percent of the cm power is contained in the alms with m index below m'.
Notes:
Author: J. D. McEwen
Version: 0.1 May 2005
cswt_swav_compute_alm
public subroutine cswt_swav_compute_alm (swav, lmax, mmax, message) type (cswt_swav), intent(inout) :: swav integer, intent(in) :: lmax integer, intent(in) :: mmax logical, optional, intent(in) :: message ! Calls: cswt_error, s2_sky_compute_alm end subroutine cswt_swav_compute_almCompute the spherical wavelet sky alms.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_write_map_file
public subroutine cswt_swav_write_map_file (swav, filename, comment) type (cswt_swav), intent(in) :: swav character (len=*), intent(in) :: filename character (len=*), optional, intent(in) :: comment ! Calls: cswt_error, s2_sky_write_map_file end subroutine cswt_swav_write_map_fileWrite the spherical wavelet sky to an output file.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_init
public function cswt_swav_get_init (swav) result (init) type (cswt_swav), intent(in) :: swav logical :: init end function cswt_swav_get_initGet init variable from the passed swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_sky
public function cswt_swav_get_sky (swav) result (sky) type (cswt_swav), intent(in) :: swav type (s2_sky) :: sky ! Calls: cswt_error end function cswt_swav_get_skyGet sky variable from the passed swav.
Notes:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_sky_alm
public subroutine cswt_swav_get_sky_alm (swav, alm) type (cswt_swav), intent(in) :: swav complex (kind=s2_spc), intent(out), dimension (:,:) :: alm ! Calls: cswt_error, s2_sky_get_alm end subroutine cswt_swav_get_sky_almGet alm of the swav sky.
Variables:
Author: J. D. McEwen
Version: 0.1 July 2005
cswt_swav_get_map_status
public function cswt_swav_get_map_status (swav) result (map_status) type (cswt_swav), intent(in) :: swav logical :: map_status ! Calls: cswt_error end function cswt_swav_get_map_statusGet map_status of the sky of the passed swav. Note that the map status is stored within the wavelet sky object.
Variables:
Author: J. D. McEwen
Version: 0.1 - April 2005
cswt_swav_get_alm_status
public function cswt_swav_get_alm_status (swav) result (alm_status) type (cswt_swav), intent(in) :: swav logical :: alm_status ! Calls: cswt_error end function cswt_swav_get_alm_statusGet alm_status of the sky of the passed swav. Note that the alm status is stored within the wavelet sky object.
Variables:
Author: J. D. McEwen
Version: 0.1 - April 2005
cswt_swav_get_nside
public function cswt_swav_get_nside (swav) result (nside) type (cswt_swav), intent(in) :: swav integer :: nside ! Calls: cswt_error end function cswt_swav_get_nsideGet nside of the sky of the passed swav. Note that the alm status is stored within the wavelet sky object.
Variables:
Author: J. D. McEwen
Version: 0.1 - April 2005
cswt_swav_get_pix_scheme
public function cswt_swav_get_pix_scheme (swav) result (pix_scheme) type (cswt_swav), intent(in) :: swav integer :: pix_scheme ! Calls: cswt_error end function cswt_swav_get_pix_schemeGet pix_scheme of the sky of the passed swav. Note that the alm status is stored within the wavelet sky object.
Variables:
Author: J. D. McEwen
Version: 0.1 - April 2005
cswt_swav_get_name
public function cswt_swav_get_name (swav) result (name) type (cswt_swav), intent(in) :: swav character (len=S2_STRING_LEN) :: name ! Calls: cswt_error end function cswt_swav_get_nameGet name variable from the passed swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_admiss
public function cswt_swav_get_admiss (swav) result (admiss) type (cswt_swav), intent(in) :: swav real (kind=s2_sp) :: admiss ! Calls: cswt_error end function cswt_swav_get_admissGet normalised numerical admissibility of the passed swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_admiss_perc
public function cswt_swav_get_admiss_perc (swav) result (admiss_perc) type (cswt_swav), intent(in) :: swav real (kind=s2_sp) :: admiss_perc ! Calls: cswt_error end function cswt_swav_get_admiss_percGet admissibility percentage of the passed swav.
Notes:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_dilation
public function cswt_swav_get_dilation (swav) result (dilation) type (cswt_swav), intent(in) :: swav real (kind=s2_sp), dimension (CSWT_SWAV_DILATION_DIM) :: dilation ! Calls: cswt_error end function cswt_swav_get_dilationGet dilation variable from the passed swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_alpha
public function cswt_swav_get_alpha (swav) result (alpha) type (cswt_swav), intent(in) :: swav real (kind=s2_sp) :: alpha ! Calls: cswt_error end function cswt_swav_get_alphaGet alpha Euler angle from the passed swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_beta
public function cswt_swav_get_beta (swav) result (beta) type (cswt_swav), intent(in) :: swav real (kind=s2_sp) :: beta ! Calls: cswt_error end function cswt_swav_get_betaGet beta Euler angle from the passed swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004
cswt_swav_get_gamma
public function cswt_swav_get_gamma (swav) result (gamma) type (cswt_swav), intent(in) :: swav real (kind=s2_sp) :: gamma ! Calls: cswt_error end function cswt_swav_get_gammaGet gamma Euler angle from the passed swav.
Variables:
Author: J. D. McEwen
Version: 0.1 - November 2004