Commit 2252f694 authored by Matthieu Tristram's avatar Matthieu Tristram
Browse files

Upgrade spectra process to select only some of the cross-spectra

parent e92c164f
......@@ -126,6 +126,8 @@ void Hillipop::ProcessMultipoles(const string multipolesFile)
{
planck_assert(file_present(multipolesFile),string("missing file : ")+multipolesFile);
string gModeName[] = {"TT","EE","BB","TE","ET"};
// Cross-spectra
_lminXSpectra.resize(5);
_lmaxXSpectra.resize(5);
......@@ -174,25 +176,47 @@ void Hillipop::ProcessMultipoles(const string multipolesFile)
for(unsigned int m = 0; m < 5; m++) {
_lminXFreq[m].resize(_nXFreq,0);
_lmaxXFreq[m].resize(_nXFreq,0);
_XFreqStatus[m].resize(_nXFreq);
_XFreqStatus[m].resize(_nXFreq,0);
for(unsigned int f = 0; f < _nXFreq; f++) {
unsigned int lminXFreq = 0;
unsigned int lmaxXFreq = 0;
for(unsigned int c = 0; c < _XFreq2XSpectra[f].size(); c++) {
if( _XSpectraStatus[m][_XFreq2XSpectra[f][c]] ) _XFreqStatus[m][f] = 1;
if( c == 0 ) {
if( _XSpectraStatus[m][_XFreq2XSpectra[f][c]] ) {
if( _XFreqStatus[m][f] == 0 ) {
lminXFreq = _lminXSpectra[m][_XFreq2XSpectra[f][c]];
lmaxXFreq = _lmaxXSpectra[m][_XFreq2XSpectra[f][c]];
}
else {
} else {
lminXFreq = min(lminXFreq,_lminXSpectra[m][_XFreq2XSpectra[f][c]]);
lmaxXFreq = max(lmaxXFreq,_lmaxXSpectra[m][_XFreq2XSpectra[f][c]]);
}
_XFreqStatus[m][f] = 1;
}
}
_lminXFreq[m][f] = lminXFreq;
_lmaxXFreq[m][f] = lmaxXFreq;
}
}
for(unsigned int m = 0; m < 4; m++) {
if( _typeStatus[m]) {
cout << gModeName[m] << "XspectraStatus: ";
for(unsigned int c = 0; c < _nXSpectra; c++) cout << " " << _XSpectraStatus[m][c];
cout << endl;
cout << gModeName[m] << " XFreqStatus: ";
for(unsigned int c = 0; c < _nXFreq; c++) cout << " " << _XFreqStatus[m][c];
cout << endl;
cout << gModeName[m] << " lmin ";
for( unsigned int f=0; f<_nXFreq; f++)
cout << "\t" << _lminXFreq[m][f];
cout << endl;
cout << gModeName[m] << " lmax ";
for( unsigned int f=0; f<_nXFreq; f++)
cout << "\t" << _lmaxXFreq[m][f];
cout << endl;
}
}
}
......@@ -390,8 +414,9 @@ void Hillipop::ProcessCovMatrix(const string pathToCovMatrix)
input->goto_hdu(2);
unsigned int size = input->nelems(1);
double * cov = new double[size];
if( size != long(side)*long(side)) { cout << "Wrong Matrix size ! (read:" << size << " need:" << side*side << ")" << endl; exit(-1);};
double * cov = new double[size];
input->read_column_raw(1,cov,size);
for(unsigned int m1 = 0; m1 < 4; m1++) {
......@@ -422,6 +447,7 @@ void Hillipop::ProcessCovMatrix(const string pathToCovMatrix)
delete [] cov;
input->close();
delete input;
/*
cout << "side " << side << endl;
cout << "lmin " << _lminXFreq[0][0] << endl;
......
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