Commit 6624368a authored by Matthieu Tristram's avatar Matthieu Tristram
Browse files

WARNING: change of parameters !!!

No need for all foreground parameters:
- when considering TE: only AdustTP
- when considering EE: only AdustPP
- when considering TT: AdustTT, Asz, Acib, Aksz, Aszxcib, and all Aps
parent 63469ed9
......@@ -472,17 +472,18 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
for(unsigned int i = 0; i < _nMap; i++) {sprintf(tmpPar,"c%d",i); _n.push_back(tmpPar);}
// End: Calibration
//SP 9/3/15: global calibration factor
//global calibration factor
_n.push_back("A_planck");
//SP comment
// Begin: First beam eigenmode amplitudes
//for(unsigned int c = 0; c < _nXSpectra; c++) {sprintf(tmpPar,"beta%d",c); _n.push_back(tmpPar);}
// End: First beam eigenmode amplitudes
// Begin: Amplitudes of the point sources power spectrum
if( _typeStatus[0]) {
for(unsigned int f = 0; f < _nXFreq; f++) {sprintf(tmpPar,"Aps%s",_XFreq[f].c_str()); _n.push_back(tmpPar);}
}
// End: Amplitudes of the point sources power spectrum
......@@ -499,6 +500,7 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
}
// tSZ spectrum template, in Dl=l(l+1)/2pi Cl, units uK at 143GHz
if( _typeStatus[0]) {
planck_assert(file_present(SZFile),string("missing file : ")+SZFile);
fitshandle * SZInput = new fitshandle();
......@@ -527,6 +529,7 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
delete SZInput;
_n.push_back("Asz");
}
// End : tSZ
......@@ -543,6 +546,7 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
}
// CIB spectra
if( _typeStatus[0]) {
_ClCIB.resize(_nXFreq);
for(unsigned int f = 0; f < _nXFreq; f++) {
//sprintf(tmpFile,"%s_%s.fits",pathToCIBSpectra.c_str(),_XFreq[f].c_str());
......@@ -576,6 +580,7 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
}
_n.push_back("Acib");
}
// End : CIB
......@@ -630,13 +635,14 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
delete DustInput;
}
_n.push_back("AdustTT");
_n.push_back("AdustPP");
_n.push_back("AdustTP");
if( _typeStatus[0]) _n.push_back("AdustTT");
if( _typeStatus[1] || _typeStatus[2]) _n.push_back("AdustPP");
if( _typeStatus[3]) _n.push_back("AdustTP");
// End: Dust
// Begin : kSZ
if( _typeStatus[0]) {
planck_assert(file_present(kSZFile),string("missing file : ")+kSZFile);
fitshandle * kSZInput = new fitshandle();
......@@ -660,10 +666,12 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
delete kSZInput;
_n.push_back("Aksz");
}
// End : kSZ
// Begin: tSZxCIB spectra
if( _typeStatus[0]) {
_ClSZxCIB.resize(_nXFreq);
for(unsigned int f = 0; f < _nXFreq; f++) {
//sprintf(tmpFile,"%s_%s.fits",pathToSZxCIBSpectra.c_str(),_XFreq[f].c_str());
......@@ -695,6 +703,7 @@ void HiLLiPOP::ProcessNuisanceVariables(const string SZFile,const string pathToC
}
_n.push_back("Aszxcib");
}
// End : SZxCIB
#ifdef PolarizationEfficiency
......@@ -944,6 +953,9 @@ void HiLLiPOP::computeResiduals( vector<double> ClCMB, vector<double>& nuisance,
double foregrounds = 0;
unsigned int modeOffset = 0;
char tmpPar[32];
vector<double> Aps(_nXFreq);
double Asz, Acib, Aksz, Aszxcib;
double AdustTT, AdustTP, AdustPP;
_residual.resize(5);
_instrumental.resize(5);
......@@ -965,28 +977,29 @@ void HiLLiPOP::computeResiduals( vector<double> ClCMB, vector<double>& nuisance,
#endif
// Amplitudes of the point sources
vector<double> Aps(_nXFreq);
if( _typeStatus[0]) {
for(unsigned int f = 0; f < _nXFreq; f++) {
sprintf(tmpPar,"Aps%s",_XFreq[f].c_str());
Aps[f] = nuisance[getIndex(tmpPar)];
}
}
// tSZ amplitude
double Asz = nuisance[getIndex("Asz")];
if( _typeStatus[0]) Asz = nuisance[getIndex("Asz")];
// CIB amplitude
double Acib = nuisance[getIndex("Acib")];
if( _typeStatus[0]) Acib = nuisance[getIndex("Acib")];
// Dust amplitude
double AdustTT = nuisance[getIndex("AdustTT")];
double AdustPP = nuisance[getIndex("AdustPP")];
double AdustTP = nuisance[getIndex("AdustTP")];
if( _typeStatus[0]) AdustTT = nuisance[getIndex("AdustTT")];
if( _typeStatus[1] || _typeStatus[2]) AdustPP = nuisance[getIndex("AdustPP")];
if( _typeStatus[3]) AdustTP = nuisance[getIndex("AdustTP")];
// kSZ amplitude
double Aksz = nuisance[getIndex("Aksz")];
if( _typeStatus[0]) Aksz = nuisance[getIndex("Aksz")];
// tSZxCIB amplitude
double Aszxcib = nuisance[getIndex("Aszxcib")];
if( _typeStatus[0]) Aszxcib = nuisance[getIndex("Aszxcib")];
#ifdef PolarizationEfficiency
// Polarization efficiency
......@@ -1298,14 +1311,16 @@ void HiLLiPOP::WriteOutput(const vector<double>& ClCMB,const vector<double>& nui
of << "\t Residual" << CMBmode[m] << _XFreq[f];
//of << "\t Instrumental" << CMBmode[m] << _XFreq[f];
}
if( _typeStatus[0]) {
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t PS" << _XFreq[f];
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t SZ" << _XFreq[f];
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t CIB" << _XFreq[f];
of << "\t kSZ";
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t SZxCIB" << _XFreq[f];
}
for(unsigned int m = 0; m < 4; m++)
if( _modeStatus[m] || (m==3 && (_modeStatus[3] || _modeStatus[4])))
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t Dust" << CMBmode[m] << _XFreq[f];
of << "\t kSZ";
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t SZxCIB" << _XFreq[f];
of << endl;
// End: header
......@@ -1319,12 +1334,16 @@ void HiLLiPOP::WriteOutput(const vector<double>& ClCMB,const vector<double>& nui
else of << " " << 0;// << " " << 0;
}
}
if( _typeStatus[0]) {
for(unsigned int f = 0; f < _nXFreq; f++) {
sprintf(tmpPar,"Aps%s",_XFreq[f].c_str());
of << " " << nuisance[getIndex(tmpPar)];
}
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Asz")]*_ClSZ[f][l];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Acib")]*_ClCIB[f][l];
of << " " << nuisance[getIndex("Aksz")]*_ClkSZ[l];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Aszxcib")]*_ClSZxCIB[f][l];
}
for(unsigned int m = 0; m < 4; m++) {
if( _modeStatus[m] || (m==3 && (_modeStatus[3] || _modeStatus[4])))
for(unsigned int f = 0; f < _nXFreq; f++) {
......@@ -1335,8 +1354,6 @@ void HiLLiPOP::WriteOutput(const vector<double>& ClCMB,const vector<double>& nui
if( m == 3 && _modeStatus[3] && _modeStatus[4] ) of << " " << nuisance[getIndex("AdustTP")]*(_ClDust[f][3*(_maxOflmax[0]+1)+l]+_ClDust[f][4*(_maxOflmax[0]+1)+l])/2.;
}
}
of << " " << nuisance[getIndex("Aksz")]*_ClkSZ[l];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Aszxcib")]*_ClSZxCIB[f][l];
of << endl;
}
of.close();
......
......@@ -498,6 +498,7 @@ void Hillipop::ProcessNuisanceVariables(const string SZFile,const string pathToC
#endif
// Begin: Amplitudes of the point sources power spectrum (MJy^2.sr-1)
if( _typeStatus[0]) {
double radio[6] = { 7.76, 5.36, 4.26, 4.83, 3.6, 3.22};
double dusty[6] = { 0.18179145, 0.47110054, 1.90295795, 1.24375538, 5.06409993, 20.99528025};
_ClpsRadio.resize( _nXFreq);
......@@ -508,11 +509,13 @@ void Hillipop::ProcessNuisanceVariables(const string SZFile,const string pathToC
}
_n.push_back( "Aradio");
_n.push_back( "Adusty");
}
// End: Amplitudes of the point sources power spectrum
// Begin : tSZ
// frequency dependence (100,143,217,353,545,857) GHz of the SZ effect
if( _typeStatus[0]) {
double fnu[6] = {-4.031, -2.785, 0.187, 6.205, 14.455, 26.335};
_fnu.resize(_nXFreq);
for(unsigned int f = 0; f < _nXFreq; f++) {
......@@ -552,10 +555,12 @@ void Hillipop::ProcessNuisanceVariables(const string SZFile,const string pathToC
delete SZInput;
_n.push_back("Asz");
}
// End : tSZ
// Begin : CIB
if( _typeStatus[0]) {
_ClCIB.resize(_nXFreq);
for(unsigned int f = 0; f < _nXFreq; f++) {
//sprintf(tmpFile,"%s_%s.fits",pathToCIBSpectra.c_str(),_XFreq[f].c_str());
......@@ -589,6 +594,7 @@ void Hillipop::ProcessNuisanceVariables(const string SZFile,const string pathToC
}
_n.push_back("Acib");
}
// End : CIB
......@@ -643,13 +649,14 @@ void Hillipop::ProcessNuisanceVariables(const string SZFile,const string pathToC
delete DustInput;
}
_n.push_back("AdustTT");
_n.push_back("AdustPP");
_n.push_back("AdustTP");
if( _typeStatus[0]) _n.push_back("AdustTT");
if( _typeStatus[1] || _typeStatus[2]) _n.push_back("AdustPP");
if( _typeStatus[3]) _n.push_back("AdustTP");
// End: Dust
// Begin : kSZ
if( _typeStatus[0]) {
planck_assert(file_present(kSZFile),string("missing file : ")+kSZFile);
fitshandle * kSZInput = new fitshandle();
......@@ -673,10 +680,12 @@ void Hillipop::ProcessNuisanceVariables(const string SZFile,const string pathToC
delete kSZInput;
_n.push_back("Aksz");
}
// End : kSZ
// Begin: tSZxCIB spectra
if( _typeStatus[0]) {
_ClSZxCIB.resize(_nXFreq);
for(unsigned int f = 0; f < _nXFreq; f++) {
//sprintf(tmpFile,"%s_%s.fits",pathToSZxCIBSpectra.c_str(),_XFreq[f].c_str());
......@@ -708,6 +717,7 @@ void Hillipop::ProcessNuisanceVariables(const string SZFile,const string pathToC
}
_n.push_back("Aszxcib");
}
// End : SZxCIB
#ifdef PolarizationEfficiency
......@@ -858,15 +868,17 @@ void Hillipop::WriteOutput(const vector<double>& ClCMB,const vector<double>& nui
of << "\t Residual" << CMBmode[m] << _XFreq[f];
// of << "\t Instrumental" << CMBmode[m] << _XFreq[f];
}
if( _typeStatus[0]) {
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t PSradio" << _XFreq[f];
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t PSdusty" << _XFreq[f];
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t SZ" << _XFreq[f];
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t CIB" << _XFreq[f];
of << "\t kSZ";
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t SZxCIB" << _XFreq[f];
}
for(unsigned int m = 0; m < 4; m++)
if( _modeStatus[m] || (m==3 && (_modeStatus[3] || _modeStatus[4])))
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t Dust" << CMBmode[m] << _XFreq[f];
of << "\t kSZ";
for(unsigned int f = 0; f < _nXFreq; f++) of << "\t SZxCIB" << _XFreq[f];
of << endl;
// End: header
......@@ -880,10 +892,14 @@ void Hillipop::WriteOutput(const vector<double>& ClCMB,const vector<double>& nui
else of << " " << 0; // << " " << 0;
}
}
if( _typeStatus[0]) {
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Aradio")]*_ClpsRadio[f];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Adusty")]*_ClpsDusty[f];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Asz")]*_ClSZ[f][l];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Acib")]*_ClCIB[f][l];
of << " " << nuisance[getIndex("Aksz")]*_ClkSZ[l];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Aszxcib")]*_ClSZxCIB[f][l];
}
for(unsigned int m = 0; m < 4; m++) {
if( _modeStatus[m] || (m==3 && (_modeStatus[3] || _modeStatus[4])))
for(unsigned int f = 0; f < _nXFreq; f++) {
......@@ -894,8 +910,6 @@ void Hillipop::WriteOutput(const vector<double>& ClCMB,const vector<double>& nui
if( m == 3 && _modeStatus[3] && _modeStatus[4] ) of << " " << nuisance[getIndex("AdustTP")]*(_ClDust[f][3*(_maxOflmax[0]+1)+l]+_ClDust[f][4*(_maxOflmax[0]+1)+l])/2.;
}
}
of << " " << nuisance[getIndex("Aksz")]*_ClkSZ[l];
for(unsigned int f = 0; f < _nXFreq; f++) of << " " << nuisance[getIndex("Aszxcib")]*_ClSZxCIB[f][l];
of << endl;
}
of.close();
......@@ -911,6 +925,8 @@ void Hillipop::computeResiduals( vector<double> ClCMB, vector<double>& nuisance,
double tmpBeamEigenmodes = 1.;
double foregrounds = 0;
unsigned int modeOffset = 0;
double ApsRadio, ApsDusty, Asz, Acib, Aksz, Aszxcib;
double AdustTT, AdustTP, AdustPP;
_residual.resize(5);
_instrumental.resize(5);
......@@ -932,25 +948,25 @@ void Hillipop::computeResiduals( vector<double> ClCMB, vector<double>& nuisance,
#endif
// Amplitudes of the point sources
double ApsRadio = nuisance[getIndex("Aradio")];
double ApsDusty = nuisance[getIndex("Adusty")];
if( _typeStatus[0]) ApsRadio = nuisance[getIndex("Aradio")];
if( _typeStatus[0]) ApsDusty = nuisance[getIndex("Adusty")];
// tSZ amplitude
double Asz = nuisance[getIndex("Asz")];
if( _typeStatus[0]) Asz = nuisance[getIndex("Asz")];
// CIB amplitude
double Acib = nuisance[getIndex("Acib")];
if( _typeStatus[0]) Acib = nuisance[getIndex("Acib")];
// Dust amplitude
double AdustTT = nuisance[getIndex("AdustTT")];
double AdustPP = nuisance[getIndex("AdustPP")];
double AdustTP = nuisance[getIndex("AdustTP")];
if( _typeStatus[0]) AdustTT = nuisance[getIndex("AdustTT")];
if( _typeStatus[1] || _typeStatus[2]) AdustPP = nuisance[getIndex("AdustPP")];
if( _typeStatus[3]) AdustTP = nuisance[getIndex("AdustTP")];
// kSZ amplitude
double Aksz = nuisance[getIndex("Aksz")];
if( _typeStatus[0]) Aksz = nuisance[getIndex("Aksz")];
// tSZxCIB amplitude
double Aszxcib = nuisance[getIndex("Aszxcib")];
if( _typeStatus[0]) Aszxcib = nuisance[getIndex("Aszxcib")];
#ifdef PolarizationEfficiency
// Polarization efficiency
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment