powspec.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef POWSPEC_H
00033 #define POWSPEC_H
00034
00035 #include "arr.h"
00036
00037
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
00050
00051
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
00072 int Num_specs() const { return num_specs; }
00073
00074 int Lmax() const { return tt_.size()-1; }
00075
00076 const arr<double> &tt() const { return tt_; }
00077
00078 const arr<double> &gg() const { return gg_; }
00079
00080 const arr<double> &cc() const { return cc_; }
00081
00082 const arr<double> &tg() const { return tg_; }
00083
00084 const arr<double> &tc() const { return tc_; }
00085
00086 const arr<double> &gc() const { return gc_; }
00087
00088 double &tt (int l) { return tt_[l]; }
00089
00090 double &gg (int l) { return gg_[l]; }
00091
00092 double &cc (int l) { return cc_[l]; }
00093
00094 double &tg (int l) { return tg_[l]; }
00095
00096 double &tc (int l) { return tc_[l]; }
00097
00098 double &gc (int l) { return gc_[l]; }
00099
00100 const double &tt (int l) const { return tt_[l]; }
00101
00102 const double &gg (int l) const { return gg_[l]; }
00103
00104 const double &cc (int l) const { return cc_[l]; }
00105
00106 const double &tg (int l) const { return tg_[l]; }
00107
00108 const double &tc (int l) const { return tc_[l]; }
00109
00110 const double &gc (int l) const { return gc_[l]; }
00111
00112
00113 void Set(arr<double> &tt_new);
00114
00115 void Set(arr<double> &tt_new, arr<double> &gg_new,
00116 arr<double> &cc_new, arr<double> &tg_new);
00117
00118
00119
00120 void Smooth_with_Gauss (double fwhm);
00121 };
00122
00123 #endif