NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links

alm_map_tools.h

Go to the documentation of this file.
00001 /*
00002  *  This file is part of Healpix_cxx.
00003  *
00004  *  Healpix_cxx is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  Healpix_cxx is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with Healpix_cxx; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017  *
00018  *  For more information about HEALPix, see http://healpix.jpl.nasa.gov
00019  */
00020 
00021 /*
00022  *  Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik
00023  *  and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
00024  *  (DLR).
00025  */
00026 
00027 /*! \file alm_map_tools.h
00028  *  Copyright (C) 2005 Max-Planck-Society
00029  *  \author Martin Reinecke
00030  */
00031 
00032 #ifndef PLANCK_ALM_MAP_TOOLS_H
00033 #define PLANCK_ALM_MAP_TOOLS_H
00034 
00035 #include <vector>
00036 #include "cxxutils.h"
00037 #include "alm.h"
00038 #include "xcomplex.h"
00039 
00040 /*! A class holding information about a ring of pixels in a spherical map. */
00041 class ringinfo
00042   {
00043   public:
00044     double theta, phi0, weight, cth, sth;
00045     int nph, ofs;
00046 
00047     ringinfo()
00048       : nph(0) {}
00049     /*! Constructs a \a ringinfo object.
00050         \param theta_ colatitude of the ring (in radian)
00051         \param phi0_ longitude of the first pixel in the ring (in radian)
00052         \param weight_ weighting factor for all pixels in the ring. This
00053                is typically the surface of a pixel in sterad.
00054         \note \a weight_ is only needed for map analysis, not synthesis.
00055         \param nph_ number of pixels in the ring
00056         \param ofs_ index of the first ring pixel in the total map array
00057                (counting from zero) */
00058     ringinfo (double theta_, double phi0_, double weight_, int nph_, int ofs_)
00059       : theta(theta_), phi0(phi0_), weight(weight_),
00060         cth(cos(theta)), sth(sin(theta)), nph(nph_), ofs(ofs_)
00061       {}
00062   };
00063 
00064 /*! A class holding information about a ring pair in a spherical map. */
00065 class ringpair
00066   {
00067   public:
00068     ringinfo r1, r2;
00069 
00070     /*! Initialize the object with the ring described by \a info.
00071         The second ring is left empty. */
00072     ringpair (const ringinfo &info)
00073       : r1(info) {}
00074     /*! Initialize the object with the rings described by \a info1
00075         and \a info2.
00076         \note The colatitude of \a info2 must be \f$\pi\f$ minus the colatitude
00077         of \a info1. */
00078     ringpair (const ringinfo &info1,const ringinfo &info2)
00079       : r1(info1), r2(info2)
00080       {
00081       planck_assert(approx(r1.theta,pi-r2.theta,1e-10), "invalid ringpair");
00082       }
00083   };
00084 
00085 void info2pair(const std::vector<ringinfo> &info, std::vector<ringpair> &pair);
00086 
00087 template<typename T> void map2alm (const std::vector<ringpair> &pair,
00088   const T *map, Alm<xcomplex<T> > &alm, bool add_alm);
00089 
00090 template<typename T> void map2alm_pol
00091   (const std::vector<ringpair> &pair, const T *mapT, const T *mapQ,
00092    const T *mapU, Alm<xcomplex<T> > &almT, Alm<xcomplex<T> > &almG,
00093    Alm<xcomplex<T> > &almC, bool add_alm);
00094 
00095 template<typename T> void map2alm_pol
00096   (const std::vector<ringpair> &pairT, const T *mapT,
00097    const std::vector<ringpair> &pairQ, const T *mapQ,
00098    const std::vector<ringpair> &pairU, const T *mapU,
00099    Alm<xcomplex<T> > &almT, Alm<xcomplex<T> > &almG,
00100    Alm<xcomplex<T> > &almC, bool add_alm);
00101 
00102 template<typename T> void alm2map (const Alm<xcomplex<T> > &alm,
00103   const std::vector<ringpair> &pair, T *map);
00104 
00105 template<typename T> void alm2map_pol
00106   (const Alm<xcomplex<T> > &almT, const Alm<xcomplex<T> > &almG,
00107    const Alm<xcomplex<T> > &almC, const std::vector<ringpair> &pair,
00108    T *mapT, T *mapQ, T *mapU);
00109 
00110 template<typename T> void alm2map_der1 (const Alm<xcomplex<T> > &alm,
00111    const std::vector<ringpair> &pair, T *map, T *dth, T *dph);
00112 
00113 #endif

Generated on Fri Jun 18 16:12:30 2010 for Healpix C++
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650