10 std::vector<int> empty;
16 if(channels.size() != averagePulses.size()) {
18 std::stringstream msg;
19 msg<<
"averagePulses.size() differs from channels.size(): "<<channels.size()<<
" vs "<<averagePulses.size();
20 err.SetDescription(__FILE__,__LINE__,msg.str());
24 std::vector<int> empty;
30 std::vector<int>::const_iterator iter = std::find(
fChannels.begin(),
fChannels.end(),chan);
33 std::stringstream msg;
34 msg<<
"Channel "<<chan<<
" not present in fChannels";
35 err.SetDescription(__FILE__,__LINE__,msg.str());
48 size_t size = reducedCovarianceMatrix.
GetNFreq();
55 int maxpos = normAP.GetMaxIndex();
56 QVector baseline(size);
57 size_t baseLength = 3*
maxpos/4;
58 baseline.Initialize(normAP.Sum(baseLength,0)/baseLength);
62 max = normAP.GetMax();
64 normAP /= normAP.GetMax();
72 for(
size_t j = 0; j < allChannels.size(); j++) {
73 int chanJ = allChannels[j];
78 W+=APFreq[i].Conj().Mult(reducedCovarianceMatrix.
GetCovariance(chanJ,chanI));
86 vector<const QVector*> inputs,sideInputs;
91 Filter(inputs,sideInputs,output);
106 outputFreq.Initialize(0,0);
108 for(i =0; i < inputs.size(); i++) {
110 outputFreq +=
fWeights[i].Mult(tmp);
112 for(j =0; j < sideInputs.size(); j++) {
114 outputFreq +=
fWeights[i+j].Mult(tmp);
Complex covariance matrix of an array of bolometers.
QChannelCovariance GetSubMatrix(const std::vector< int > &channels) const
Get sub matrix of channels.
size_t GetNFreq() const
get number of frequencies
Diana::QVectorC GetCovariance(int chI, int chJ) const
get covariance between channel I and J
error class with error type and description
double fNorm
filter normalization
int fShift
filter original -delay
void Init(const std::vector< int > &allChannels)
get expected resolution after filtering
const Diana::QVector & GetAveragePulse(const int chan) const
get average pulse
void Filter(const std::vector< const Diana::QVector * > &inputs, const std::vector< const Diana::QVector * > &sideInputs, Diana::QVector &output) const
filter, not implemented yet
QMultiChannelDecorrelatorOF(const std::vector< int > &channels, const QChannelCovariance *cov, const std::vector< Diana::QVector > &averagePulses)
ctor, by default all channels are used to decorrelate
std::vector< Diana::QVector > fAveragePulses
average pulses corresponding to fChannels
double fFilteredResolution
expected filtered resolution
double ComputeResolution(const Diana::QVector &powerSpectrum) const
compute resolution
Diana::QVector fOriginalPowerSpectrum
original power spectrum of this channel
std::vector< Diana::QVectorC > fWeights
coefficients used in decorrelation
double fScale
scale output
Diana::QVector fDecorrelatedPowerSpectrum
decorrelated power spectrum of this channel
double fOriginalResolution
original resolution
std::vector< int > fChannels
number of this channel
void SetSideChannels(const std::vector< int > &channels)
chose subset of channels to use for decorrelation
const QChannelCovariance * fCovarianceMatrix
pointer to global covariance matrix
Diana::QRealComplexFFT * fTransformer
FFT engine.
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...