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

powspec.h

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 /*
00028  *  Copyright (C) 2003, 2004 Max-Planck-Society
00029  *  Author: Martin Reinecke
00030  */
00031 
00032 #ifndef POWSPEC_H
00033 #define POWSPEC_H
00034 
00035 #include "arr.h"
00036 
00037 /*! Class for storing unpolarised and polarised power spectra. */
00038 class PowSpec
00039   {
00040   private:
00041     arr<double> tt_, gg_, cc_, tg_, tc_, gc_;
00042     int num_specs;
00043 
00044     void dealloc();
00045 
00046   public:
00047     /*! */
00048     PowSpec() {}
00049     /*! Constructs a \a PowSpec with \a nspec components and a maximum
00050         multipole of \a lmax. \a nspec can be 1 (TT), 4 (TT,GG,CC,TG) or
00051         6 (TT,GG,CC,TG,TC,GC). */
00052     PowSpec(int nspec, int lmax)
00053       : num_specs(nspec)
00054       {
00055       planck_assert ((num_specs==1) || (num_specs==4) || (num_specs==6),
00056         "wrong number of spectrums");
00057       tt_.alloc(lmax+1);
00058       if (num_specs>1)
00059         {
00060         gg_.alloc(lmax+1);
00061         cc_.alloc(lmax+1);
00062         tg_.alloc(lmax+1);
00063         }
00064       if (num_specs>4)
00065         {
00066         tc_.alloc(lmax+1);
00067         gc_.alloc(lmax+1);
00068         }
00069       }
00070 
00071     /*! Returns the number of spectral components. */
00072     int Num_specs() const { return num_specs; }
00073     /*! Returns the maximum \a l. */
00074     int Lmax() const { return tt_.size()-1; }
00075     /*! Returns the TT array (read-only). */
00076     const arr<double> &tt() const { return tt_; }
00077     /*! Returns the GG array (read-only). */
00078     const arr<double> &gg() const { return gg_; }
00079     /*! Returns the CC array (read-only). */
00080     const arr<double> &cc() const { return cc_; }
00081     /*! Returns the TG array (read-only). */
00082     const arr<double> &tg() const { return tg_; }
00083     /*! Returns the TC array (read-only). */
00084     const arr<double> &tc() const { return tc_; }
00085     /*! Returns the GC array (read-only). */
00086     const arr<double> &gc() const { return gc_; }
00087     /*! Returns TT(l) (read-write). */
00088     double &tt (int l) { return tt_[l]; }
00089     /*! Returns GG(l) (read-write). */
00090     double &gg (int l) { return gg_[l]; }
00091     /*! Returns CC(l) (read-write). */
00092     double &cc (int l) { return cc_[l]; }
00093     /*! Returns TG(l) (read-write). */
00094     double &tg (int l) { return tg_[l]; }
00095     /*! Returns TC(l) (read-write). */
00096     double &tc (int l) { return tc_[l]; }
00097     /*! Returns GC(l) (read-write). */
00098     double &gc (int l) { return gc_[l]; }
00099     /*! Returns TT(l) (read-only). */
00100     const double &tt (int l) const { return tt_[l]; }
00101     /*! Returns GG(l) (read-only). */
00102     const double &gg (int l) const { return gg_[l]; }
00103     /*! Returns CC(l) (read-only). */
00104     const double &cc (int l) const { return cc_[l]; }
00105     /*! Returns TG(l) (read-only). */
00106     const double &tg (int l) const { return tg_[l]; }
00107     /*! Returns TC(l) (read-only). */
00108     const double &tc (int l) const { return tc_[l]; }
00109     /*! Returns GC(l) (read-only). */
00110     const double &gc (int l) const { return gc_[l]; }
00111 
00112     /*! Sets the whole TT array. */
00113     void Set(arr<double> &tt_new);
00114     /*! Sets all components. */
00115     void Set(arr<double> &tt_new, arr<double> &gg_new,
00116              arr<double> &cc_new, arr<double> &tg_new);
00117     /* Smooths the spectrum with a Gaussian beam.
00118        \a fwhm is given in radian.
00119        \note This is only implememted for 1 and 4 spectra so far. */
00120     void Smooth_with_Gauss (double fwhm);
00121   };
00122 
00123 #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