00001 #ifndef WMAP_3YR_OPTIONS_H 00002 #define WMAP_3YR_OPTIONS_H 00003 00004 /**************************************************************** 00005 * This file is part of the C++ port of the Fortran likelihood 00006 * code for the WMAP 5yr release provided by the WMAP team 00007 * at http://lambda.gsfc.nasa.gov/ . 00008 * 00009 * The code was ported by Georg Robbers for easier 00010 * interfacing with cmbeasy (http://www.cmbeasy.org). 00011 * Bugs in this port should be reported to the 00012 * cmbeasy authors (bugs@cmbeasy.org). 00013 ****************************************************************/ 00014 00015 #include <string> 00016 #include <iostream> 00017 00018 #ifdef USE_HIGHELL_TB 00019 #define num_WMAP 10 // number of individual chi2 terms in likelihood 00020 #else 00021 #define num_WMAP 8 // number of individual chi2 terms in likelihood 00022 #endif 00023 00024 //--------------------------------------------------- 00025 // likelihood terms from WMAP 00026 //--------------------------------------------------- 00027 #define ttlike 1 // master tttt chisq flag 00028 #define ttlowllike 2 // low tttt chisq flag 00029 #define ttlowldet 3 // low tttt determinant flag 00030 #define beamlike 4 // beam/pt source correction to tttt chisq flag 00031 #define telike 5 // master tete chisq flag 00032 #define tedet 6 // master tete determinant flag 00033 #define lowllike 7 // TE/EE/BB lowl chisq flag 00034 #define lowldet 8 // TE/EE/BB lowl determinant flag 00035 #define tblike 9 // master tbtb chisq flag 00036 #define tbdet 10 // master tbtb determinant flag 00037 00038 00039 // =========================================================================== 00040 // 00041 class WMAP_OPTIONS 00042 { 00043 // This module contains the options in the likelihood code 00044 // 00045 // =========================================================================== 00046 00047 public: 00048 static WMAP_OPTIONS* self(); 00049 00050 void setWMAP_data_dir(std::string str) { mWMAP_data_dir = str; } 00051 std::string WMAP_data_dir() { return mWMAP_data_dir; } 00052 void setTTmax(int ttmax) { mTTmax = ttmax; } // must be l.le.1000 00053 int ttmax() { return mTTmax; } // must be l.le.1000 00054 void setTTmin(int ttmin) { mTTmin = ttmin; } // must be l.ge.2 00055 int ttmin() { return mTTmin; } // must be l.ge.2 00056 void setTEmax(int temax) { mTEmax = temax; } // must be l.le.450 00057 int temax() { return mTEmax; } // must be l.le.450 00058 void setTEmin(int temin) { mTEmin=temin; } // must be l.ge.2 00059 int temin() { return mTEmin; } // must be l.ge.2 00060 void setLowl_max(int lowl_max) { mLowl_max=lowl_max; } // using low l TT code 2<l<lowl_max (max value lowl_max=12) 00061 int lowl_max() { return mLowl_max; } // using low l TT code 2<l<lowl_max (max value lowl_max=12) 00062 void set_lowl_tt_res(int lowl_tt_res) { mLowl_tt_res=lowl_tt_res; } // must be either 3 or 4 00063 int lowl_tt_res() { return mLowl_tt_res; } 00064 void setUsing_lowl_TT(bool b) { mUsing_lowl_TT=b; } // include TT pixel likelihood, for l<=lowl_max 00065 bool using_lowl_TT() { return mUsing_lowl_TT; } // include TT pixel likelihood, for l<=lowl_max 00066 void setUsing_lowl_pol(bool b) { mUsing_lowl_pol=b; } // include TE,EE,BB pixel likelihood for l<24 00067 bool using_lowl_pol() { return mUsing_lowl_pol; } // include TE,EE,BB pixel likelihood for l<24 00068 void setUsing_TT(bool b) { mUsing_TT=b; } // include MASTER TT in likelihood 00069 bool using_TT() { return mUsing_TT; } // include MASTER TT in likelihood 00070 void setUsing_TT_beam_ptsrc(bool b) { mUsing_TT_beam_ptsrc=b; } // include beam/ptsrc error 00071 bool using_TT_beam_ptsrc() { return mUsing_TT; } // include MASTER TT in likelihood 00072 void setUsing_TE(bool b) { mUsing_TE=b; } // include MASTER TE in likelihood 00073 bool using_TE() { return mUsing_TE; } // include MASTER TE in likelihood 00074 00075 void setUsing_gibbs_pol_cleaning(bool b) { mUsing_gibbs_pol_cleaning = b; } 00076 bool using_gibbs_pol_cleaning() { return mUsing_gibbs_pol_cleaning; } 00077 00078 void setUsing_gibbs(bool b) { mUsing_gibbs = b; } 00079 bool using_gibbs() { return mUsing_gibbs; } 00080 00081 void setGibbs_sigma_filename(const std::string& s) { mGibbs_sigma_filename = s; } 00082 std::string gibbs_sigma_filename() const { return mGibbs_sigma_filename; } 00083 00084 void setGibbs_first_iteration(long unsigned int i) { mGibbs_first_iteration=i; } 00085 long unsigned int gibbs_first_iteration() { return mGibbs_first_iteration; } 00086 00087 void setGibbs_last_iteration(long unsigned int i) { mGibbs_last_iteration=i; } 00088 long unsigned int gibbs_last_iteration() { return mGibbs_last_iteration; } 00089 00090 void setGibbs_skip (long unsigned int i) { mGibbs_skip=i; } 00091 long unsigned int gibbs_skip() { return mGibbs_skip; } 00092 00093 void setGibbs_ell_max (int l) { mGibbs_ell_max = l; } 00094 int gibbs_ell_max () { return mGibbs_ell_max; } 00095 00096 double tt_pixlike_lndet_offset() { return mtt_pixlike_lndet_offset4; } 00097 double teeebb_pixlike_lndet_offset() { return mteeebb_pixlike_lndet_offset; } 00098 double te_lndet_offset() { return mte_lndet_offset; } 00099 double tb_lndet_offset() { return mtb_lndet_offset; } 00100 00101 void wmap_print_options(); 00102 00103 ~WMAP_OPTIONS() {} 00104 protected: 00105 WMAP_OPTIONS(); 00106 static WMAP_OPTIONS* mSelf; 00107 private: 00108 //--------------------------------------------------- 00109 // location of input data 00110 // --------------------------------------------------- 00111 std::string mWMAP_data_dir; 00112 00113 //--------------------------------------------------- 00114 // l range to be used in the likelihood code 00115 // change these to consider a more limited l range in TTTT and TETE 00116 //--------------------------------------------------- 00117 int mTTmax ; 00118 int mTTmin ; 00119 int mTEmax ; 00120 int mTEmin ; 00121 00122 //--------------------------------------------------- 00123 // various likelihood options 00124 // change these to include/ exclude various likelihood aspects 00125 //--------------------------------------------------- 00126 bool mUsing_lowl_TT ; 00127 bool mUsing_lowl_pol ; 00128 bool mUsing_TT ; 00129 bool mUsing_TT_beam_ptsrc ; 00130 bool mUsing_TE ; 00131 bool mUsing_gibbs_pol_cleaning; 00132 00133 //--------------------------------------------------- 00134 // *** AN IMPORTANT CHANGE WITH REGARD TO THE TT LIKELIHOOD *** 00135 //--------------------------------------------------- 00136 // There are two options to choose from for evaluating the low-l temperature 00137 // likelihood. Both options produce the same results. 00138 // 00139 // (1) The direct evaluation of likelihood in pixel space using a resolution 4 temperature map. 00140 // (2) The Gibbs sampling. 00141 // 00142 // The option (2) is much faster to evaluate than the option (1). 00143 // 00144 // To use (1), set "use_gibbs = .false." and "lowl_max = 30". 00145 // To use (2), set "use_gibbs = .true." and "lowl_max = 32". 00146 // 00147 // Note that the resolution 3 option for (1) has been disabled. 00148 // 00149 00150 bool mUsing_gibbs; // = true by default 00151 00152 //--------------------------------------------------- 00153 // (1) Pixel likelihood 00154 //--------------------------------------------------- 00155 00156 00157 int mLowl_tt_res ; // = 4 // TT map resolution 00158 int mLowl_max ; // = 32 // use low l TT code 2<l<lowl_max 00159 00160 //--------------------------------------------------- 00161 // (2) Gibbs likelihood 00162 //--------------------------------------------------- 00163 // For using different sections of the sigmaElls file, 00164 // adjust gibbs_first_iteration, gibbs_last_iteration, 00165 // and gibbs_skip. 00166 // 00167 // For a 50,000 Gibbs sample file, it may be useful to set 00168 // gibbs_first_iteration = 100 00169 // gibbs_last_iteration = 25000 00170 // gibbs_skip = 3 00171 // for one parameter run (to use every third value from the first half 00172 // (approximately) of the file), and 00173 // gibbs_first_iteration = 25100 00174 // gibbs_last_iteration = 50000 00175 // gibbs_skip = 3 00176 // for another parameter run, to use the second half of the file (every third value). 00177 // 00178 // To get really fast (possibly inaccurate) likelihoods, 00179 // set gibbs_skip to be ~ 0.01 * (gibbs_last_iteration - gibbs_first_iteration) 00180 // 00181 // gibbs_first_iteration must be >= 1 00182 00183 std::string mGibbs_sigma_filename; 00184 long unsigned int mGibbs_first_iteration; // = 10; 00185 long unsigned int mGibbs_last_iteration; // = 30000; 00186 long unsigned int mGibbs_skip; // = 2; 00187 00188 // The sum in the BR estimator goes up to this value: 00189 int mGibbs_ell_max; // = 32 ; 00190 00191 00192 00193 //--------------------------------------------------- 00194 // ln(det) offsets 00195 //--------------------------------------------------- 00196 // The value of ln(L) returned by the likelihood code is renormalized 00197 // by subtracting off a constant offset: 00198 // 00199 // -2ln(L) = chi^2 + ln_det_C - ln_det_C_f 00200 // 00201 // The value of the offset, ln_det_C_f, is the sum of the determinant 00202 // contributions to -2ln(L) computed for the CMB spectrum in 00203 // data/test_cls_v3.dat: 00204 // 00205 // ln_det_C_f = tt_pixlike_lndet_offset(lowl_tt_res) 00206 // + teeebb_pixlike_lndet_offset 00207 // + te_lndet_offset 00208 // 00209 const double mtt_pixlike_lndet_offset4; 00210 const double mteeebb_pixlike_lndet_offset; 00211 const double mte_lndet_offset; 00212 const double mtb_lndet_offset; 00213 // 00214 // If you'd like to compare the values of ln(L) returned by this version 00215 // of the code with previous versions, use the following: 00216 // 00221 // 00222 // c++ port note: you can do this by changing the constructor in WMAP_3yr_options.cc 00223 }; 00224 #endif // WMAP_3YR_OPTIONS_H
1.4.6