3 #ifndef CARMA_PIPELINE_UTIL_SELFCALSTAGE_H
4 #define CARMA_PIPELINE_UTIL_SELFCALSTAGE_H
7 #include "carma/monitor/PipelineMonitorInput.h"
8 #include "carma/pipeline/pipelineUtils.h"
11 #include "carma/util/PthreadMutex.h"
19 namespace correlator {
21 class CorrelatorBaseline;
28 class PipelineMonitorInput;
29 class PipelineSubsystem;
38 class SelfCalStage :
public Stage {
48 const carma::pipeline::TsysStage& tsys,
49 carma::monitor::AstroSubsystem & astro,
50 const carma::monitor::PipelineMonitorInput & plmi,
51 carma::pipeline::PipelineType plType );
56 virtual ~SelfCalStage();
61 void setReferenceAntNo(
int antNo );
65 typedef int SidebandIndex;
67 typedef ::std::vector< carma::services::Complex > ComplexVector;
68 typedef ::std::vector< double > SnrVector;
69 typedef ::std::set< int > AntSet;
70 typedef ::std::pair< int, carma::monitor::PolType > AstroBandPolPair;
72 class SelfCalSidebandInfo {
75 SelfCalSidebandInfo( );
77 SelfCalSidebandInfo(
int antennas,
int maxIterations,
bool usb,
78 carma::monitor::SelfCal * mon,
81 SelfCalSidebandInfo(
const SelfCalSidebandInfo & rhs );
83 operator=(
const SelfCalSidebandInfo & rhs );
87 void setVis(
int antenna1No,
int antenna2No,
88 const std::complex< float > & avgVis,
91 void setBandPol(
int bandNo, carma::monitor::PolType pol );
93 AstroBandPolPair getBandPol()
const;
95 void calculateSelfCal(
double rootbtau );
97 void fillMonitorData( );
99 std::pair< bool, ComplexVector > getVis( )
const;
101 SnrVector getSnr( )
const;
103 void setRefAnt(
int antNo );
111 ComplexVector visErrors_;
115 int referenceAntennaNo_;
116 bool explicitRefAnt_;
121 carma::monitor::PolType pol_;
126 carma::monitor::SelfCal * mon_;
130 typedef ::std::pair< SelfCalSidebandInfo,
131 SelfCalSidebandInfo > UsbLsbInfoPair;
132 typedef ::std::vector< UsbLsbInfoPair > SelfCalInfoVec;
133 typedef ::std::map< AstroBandPolPair,
134 SelfCalInfoVec::size_type > AstroBandPolInfoIdxMap;
137 preprocess(
const carma::correlator::lib::CorrelatorDataPtr cd );
142 carma::correlator::lib::CorrelatorDataPtr
143 postprocess( carma::correlator::lib::CorrelatorDataPtr cd );
145 void fillMonitorData( );
147 void processBaseline(
150 std::set< SelfCalInfoVec::size_type > & seenInfos,
153 void writeChannelAvgsToMonitorSystem( );
155 double calculateWeight(
int input1Num,
159 double intTime )
const;
161 double calculateSystemNoise(
double rootbtau,
166 void zeroSelfcalSolutions( );
168 SelfCalInfoVec::size_type
169 getInfoIdx(
int astroBandNo, carma::monitor::PolType pol )
const;
171 SelfCalInfoVec selfCalInfo_;
174 carma::monitor::AstroSubsystem & astroMonitor_;
175 AstroBandPolInfoIdxMap bandPolToInfoIdx_;
176 const carma::pipeline::TsysStage & tsys_;
177 const carma::monitor::PipelineMonitorInput & plmi_;
178 const int maxIterations_;
182 const carma::pipeline::PipelineType plType_;
188 #endif // End #ifndef CARMA_PIPELINE_UTIL_SELFCALSTAGE_H
Class to hold a Band of Correlator Data.
Tagged: Wed Jun 29 11:00:27 PDT 2005.
Computes an amplitude or phase selfcal solution on a set of visibilities.
Class to hold Correlator Baseline data.
Abstract base class for retrieving pipeline monitor system components common between the spectral lin...
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...