CARMA C++
TsysStage.h
1 // $Id: TsysStage.h,v 1.2 2013/05/15 15:23:00 abeard Exp $
2 
3 #ifndef CARMA_PIPELINE_TSYSSTAGE_H
4 #define CARMA_PIPELINE_TSYSSTAGE_H
5 
6 #include "carma/monitor/PipelineCommon.h"
7 #include "carma/monitor/NoiseStatusCommon.h"
8 #include "carma/pipeline/pipelineUtils.h"
9 #include "carma/pipeline/Stage.h"
10 #include "carma/pipeline/TsysPipelineInfo.h"
11 #include "carma/util/PthreadRWLock.h"
12 #include "carma/util/PthreadMutex.h"
13 
23 namespace carma {
24 
25  namespace monitor {
26  class AstroSubsystem;
27  class PipelineSubsystem;
28  }
29 
30  namespace correlator {
31  namespace lib {
32  class CorrelatorData;
33  }
34  }
35 
36  namespace pipeline {
37 
38  class TsysStage : public Stage {
39  public:
40 
46  TsysStage(
48  const carma::monitor::PipelineMonitorInput & plmi,
49  enum carma::pipeline::PipelineType plType,
50  carma::monitor::AstroSubsystem & astroMonitor );
51 
55  virtual ~TsysStage();
56 
60  void resetTsys( const std::vector< int > & carmaAntNoVec );
61 
67  void applyTsysToData( bool apply );
68 
72  bool isTsysBeingApplied( ) const;
73 
77  void applyFluxCalibrationToData( bool apply );
78 
82  bool isFluxBeingApplied( ) const;
83 
87  void logCalibration( short astroband );
88 
94  const TsysPipelineInfo & getTsysPipelineInfo( ) const;
95 
96  private:
97 
98  void
99  preprocess( carma::correlator::lib::CorrelatorDataPtr cd );
100 
101  void
102  processBand( carma::correlator::lib::CorrelatorBand * cb );
103 
104  carma::correlator::lib::CorrelatorDataPtr
105  postprocess( carma::correlator::lib::CorrelatorDataPtr cd );
106 
107  void fillMonitorData();
108 
109  const carma::monitor::PipelineMonitorInput & plmi_;
110 
111  TsysPipelineInfo tsysInfo_;
112 
113  bool applyTsys_;
114  bool applyFlux_;
115  mutable carma::util::PthreadRWLock applyTsysAndFluxRWLock_;
116 
117  std::vector< int > resetPendingAntNoVec_;
118  mutable carma::util::PthreadMutex resetPendingMutex_;
119 
120  carma::monitor::NoiseStatusMonitorPointEnum::NOISESTATUS noiseStatus_;
121  bool noiseStatusValid_;
122 
123  carma::monitor::PipelineSubsystem & monitorData_;
124  carma::monitor::AstroSubsystem & astroMonitor_;
125 
126  const enum carma::pipeline::PipelineType plType_;
127 
128  short logBandOnce_;
129 
130  }; // class TsysStage
131 
132  } // namespace pipeline
133 } // namespace carma
134 #endif // #ifndef CARMA_PIPELINE_TSYSSTAGE_H
A simple wrapper class that makes use of ::pthread_rwlock_t easier in a C++ world.
Definition: PthreadRWLock.h:46
Class to hold a Band of Correlator Data.
Tagged: Wed Jun 29 11:00:27 PDT 2005.
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. ...
Definition: PthreadMutex.h:41