Healpix C++  3.83
alm_powspec_tools.h
Go to the documentation of this file.
1 /*
2  * This file is part of Healpix_cxx.
3  *
4  * Healpix_cxx is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Healpix_cxx is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Healpix_cxx; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * For more information about HEALPix, see http://healpix.sourceforge.net
19  */
20 
21 /*
22  * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik
23  * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
24  * (DLR).
25  */
26 
27 /*! \file alm_powspec_tools.h
28  * Copyright (C) 2003-2014 Max-Planck-Society
29  * \author Martin Reinecke
30  */
31 
32 #ifndef PLANCK_ALM_POWSPEC_TOOLS_H
33 #define PLANCK_ALM_POWSPEC_TOOLS_H
34 
35 #include "xcomplex.h"
36 
37 template<typename T> class Alm;
38 class PowSpec;
39 class planck_rng;
40 class rotmatrix;
41 
42 /*! \defgroup alm_ps_group Conversions between a_lm and power spectra */
43 /*! \{ */
44 
45 /*! Creates a Gaussian realisation of the input power spectrum \a powspec,
46  using the random number generator \a rng, and returns the result
47  in \a alm. */
48 template<typename T> void create_alm (const PowSpec &powspec,
49  Alm<xcomplex<T> > &alm, planck_rng &rng);
50 
51 /*! Creates a Gaussian realisation of the polarised input power spectrum
52  \a powspec, using the random number generator \a rng, and returns the
53  result in \a almT, \a almG and \a almC. */
54 template<typename T> void create_alm_pol
55  (const PowSpec &powspec,
56  Alm<xcomplex<T> > &almT,
57  Alm<xcomplex<T> > &almG,
58  Alm<xcomplex<T> > &almC,
59  planck_rng &rng);
60 
61 /*! Returns the unpolarised power spectrum of \a alm in \a powspec. */
62 template<typename T> void extract_powspec
63  (const Alm<xcomplex<T> > &alm, PowSpec &powspec);
64 /*! Returns the cross power spectrum of \a alm1 and \a alm2 in \a powspec. */
65 template<typename T> void extract_crosspowspec
66  (const Alm<xcomplex<T> > &alm1,
67  const Alm<xcomplex<T> > &alm2, PowSpec &powspec);
68 /*! Returns the polarised power spectrum of \a almT, \a almG and \a almC
69  in \a powspec. */
70 template<typename T> void extract_powspec
71  (const Alm<xcomplex<T> > &almT,
72  const Alm<xcomplex<T> > &almG,
73  const Alm<xcomplex<T> > &almC,
74  PowSpec &powspec);
75 
76 /*! \} */
77 
78 /*! Applies a convolution with a Gaussian beam with an FWHM of
79  \a fwhm (in radian) to \a alm.
80  \note If \a fwhm<0, a deconvolution with \a -fwhm is performed.
81  \relates Alm */
82 template<typename T> void smoothWithGauss
83  (Alm<xcomplex<T> > &alm, double fwhm);
84 /*! Applies a convolution with a Gaussian beam with an FWHM of
85  \a fwhm (in radian) to \a almT, \a almG and \a almC.
86  \note If \a fwhm<0, a deconvolution with \a -fwhm is performed.
87  \relates Alm */
88 template<typename T> void smoothWithGauss
89  (Alm<xcomplex<T> > &almT,
90  Alm<xcomplex<T> > &almG,
91  Alm<xcomplex<T> > &almC,
92  double fwhm);
93 
94 /*! Applies a function to \a alm that is 1 for all \c l<=lmin, 0 for all
95  \c l>=lmax, and \c 0.5*(1+cos((l-lmin)/(lmax-lmin)*pi)) in between.
96  \relates Alm */
97 template<typename T> void applyCosineWindow
98  (Alm<xcomplex<T> > &alm, int lmin, int lmax);
99 
100 template<typename T> inline void applyCosineWindow
101  (Alm<xcomplex<T> > &almT, Alm<xcomplex<T> > &almG, Alm<xcomplex<T> > &almC,
102  int lmin, int lmax)
103  {
104  applyCosineWindow(almT,lmin,lmax);
105  applyCosineWindow(almG,lmin,lmax);
106  applyCosineWindow(almC,lmin,lmax);
107  }
108 
109 /*! Rotates \a alm through the Euler angles \a psi, \a theta and \a phi.
110  The Euler angle convention is right handed, rotations are active.
111  - \a psi is the first rotation about the z-axis (vertical)
112  - then \a theta about the ORIGINAL (unrotated) y-axis
113  - then \a phi about the ORIGINAL (unrotated) z-axis (vertical)
114  \relates Alm */
115 template<typename T> void rotate_alm (Alm<xcomplex<T> > &alm,
116  double psi, double theta, double phi);
117 
118 /*! Rotates \a almT, \a almG and \a almC through the Euler angles
119  \a psi, \a theta and \a phi.
120  The Euler angle convention is right handed, rotations are active.
121  - \a psi is the first rotation about the z-axis (vertical)
122  - then \a theta about the ORIGINAL (unrotated) y-axis
123  - then \a phi about the ORIGINAL (unrotated) z-axis (vertical)
124  \relates Alm */
125 template<typename T> void rotate_alm (Alm<xcomplex<T> > &almT,
126  Alm<xcomplex<T> > &almG, Alm<xcomplex<T> > &almC,
127  double psi, double theta, double phi);
128 
129 /*! Rotates \a alm through the rotation matrix \a mat.
130  \relates Alm */
131 template<typename T> void rotate_alm (Alm<xcomplex<T> > &alm,
132  const rotmatrix &mat);
133 
134 /*! Rotates \a almT, \a almG and \a almC through the rotation matrix \a mat.
135  \relates Alm */
136 template<typename T> void rotate_alm (Alm<xcomplex<T> > &almT,
137  Alm<xcomplex<T> > &almG, Alm<xcomplex<T> > &almC,
138  const rotmatrix &mat);
139 
140 #endif
void create_alm_pol(const PowSpec &powspec, Alm< xcomplex< T > > &almT, Alm< xcomplex< T > > &almG, Alm< xcomplex< T > > &almC, planck_rng &rng)
void applyCosineWindow(Alm< xcomplex< T > > &alm, int lmin, int lmax)
Definition: alm.h:88
void extract_powspec(const Alm< xcomplex< T > > &alm, PowSpec &powspec)
void smoothWithGauss(Alm< xcomplex< T > > &alm, double fwhm)
void extract_crosspowspec(const Alm< xcomplex< T > > &alm1, const Alm< xcomplex< T > > &alm2, PowSpec &powspec)
void rotate_alm(Alm< xcomplex< T > > &alm, double psi, double theta, double phi)
void create_alm(const PowSpec &powspec, Alm< xcomplex< T > > &alm, planck_rng &rng)

Generated on Wed Nov 13 2024 12:18:30 for Healpix C++