1 #ifndef CORRELATORBASELINE_H
2 #define CORRELATORBASELINE_H
8 #include "carma/correlator/lib/CorrelatorPolarization.h"
16 namespace correlator {
19 class CorrelatorBaseline;
21 typedef ::std::vector< CorrelatorBaseline > BaselineVector;
53 void mySerialize(
char * byteArray,
int * offset )
const;
62 void deserializeVer1(
const char * byteArray,
73 void deserializeSwapVer1(
const char * byteArray,
93 void setAnt1Number(
int a1num);
99 int getAnt1Number()
const;
106 void setAnt2Number(
int a2num);
113 int getAnt2Number()
const;
170 const std::vector<carma::correlator::lib::CorrelatorSideband> &
173 std::vector<carma::correlator::lib::CorrelatorSideband> &
180 void flagData(
unsigned int reason );
190 getBlankFlagStatusDEPRECATED()
const;
220 void setAntPol1(
int antNum, carma::correlator::lib::Polarization polarization );
222 void setAntPol2(
int antNum, carma::correlator::lib::Polarization polarization );
229 Polarization getPolarization2()
const;
231 std::string getPolarization1String()
const;
233 std::string getPolarization2String()
const;
235 std::string getPolarization()
const;
237 AntNoPolPair getAntPol1()
const;
238 AntNoPolPair getAntPol2()
const;
240 std::string getSummary()
const;
243 bool containsSideband( CorrelatorSideband::Flavor flavor )
const;
247 getSideband( CorrelatorSideband::Flavor flavor );
249 void packSidebands(
char * byteArray,
int * offset )
const;
252 void setPolarization1(
const carma::correlator::lib::Polarization polarization );
254 void setPolarization2(
const carma::correlator::lib::Polarization polarization );
262 carma::correlator::lib::Polarization polarization1_;
263 carma::correlator::lib::Polarization polarization2_;
266 ::std::vector< CorrelatorSideband > sidebands_;
282 polarization1_(RIGHT_POL),
283 polarization2_(RIGHT_POL),
284 bfStatusObsolete_( monitor::MonitorPoint::OK ),
293 ::std::swap( ant1Number_, rhs.ant1Number_ );
294 ::std::swap( ant2Number_, rhs.ant2Number_ );
295 ::std::swap( input1Number_, rhs.input1Number_ );
296 ::std::swap( input2Number_, rhs.input2Number_ );
297 ::std::swap( boardId_, rhs.boardId_ );
298 ::std::swap( boardSN_, rhs.boardSN_ );
299 ::std::swap( bfStatusObsolete_, rhs.bfStatusObsolete_ );
300 sidebands_.swap( rhs.sidebands_ );
301 ::std::swap( polarization1_, rhs.polarization1_ );
302 ::std::swap( polarization2_, rhs.polarization2_ );
309 return input1Number_;
313 carma::correlator::lib::CorrelatorBaseline::getAnt1Number( )
const
321 return input2Number_;
325 carma::correlator::lib::CorrelatorBaseline::getAnt2Number( )
const
347 return sidebands_.size();
351 carma::correlator::lib::CorrelatorBaseline::getBlankFlagStatusDEPRECATED( )
const
353 return bfStatusObsolete_;
356 inline const ::std::vector< carma::correlator::lib::CorrelatorSideband > &
363 inline ::std::vector< carma::correlator::lib::CorrelatorSideband > &
373 input1Number_ = i1num;
377 carma::correlator::lib::CorrelatorBaseline::setAnt1Number(
const int a1num )
385 input2Number_ = i2num;
389 carma::correlator::lib::CorrelatorBaseline::setAnt2Number(
const int a2num )
409 for(
unsigned int i = 0; i < sidebands_.size(); i++ ) {
410 sidebands_.at(i).flagData( reason );
417 for(
unsigned int i = 0; i < sidebands_.size(); i++ ) {
418 sidebands_.at(i).blankData( reason );
423 carma::correlator::lib::CorrelatorBaseline::setPolarization1(
424 const carma::correlator::lib::Polarization polarization)
426 polarization1_ = polarization;
430 carma::correlator::lib::CorrelatorBaseline::setPolarization2(
431 const carma::correlator::lib::Polarization polarization)
433 polarization2_ = polarization;
438 const int antNum,
const carma::correlator::lib::Polarization polarization ){
439 setAnt1Number(antNum);
440 setPolarization1(polarization);
444 carma::correlator::lib::CorrelatorBaseline::setAntPol2(
445 const int antNum,
const carma::correlator::lib::Polarization polarization ){
446 setAnt2Number(antNum);
447 setPolarization2(polarization);
450 inline carma::correlator::lib::Polarization
453 return polarization1_;
457 inline carma::correlator::lib::Polarization
458 carma::correlator::lib::CorrelatorBaseline::getPolarization2( )
const
460 return polarization2_;
463 inline carma::correlator::lib::AntNoPolPair
464 carma::correlator::lib::CorrelatorBaseline::getAntPol1( )
const
466 return AntNoPolPair( ant1Number_, polarization1_ );
469 inline carma::correlator::lib::AntNoPolPair
470 carma::correlator::lib::CorrelatorBaseline::getAntPol2( )
const
472 return AntNoPolPair( ant2Number_, polarization2_ );
476 carma::correlator::lib::CorrelatorBaseline::getPolarization1String( )
const
478 if(polarization1_ == LEFT_POL){
481 else if(polarization1_ == RIGHT_POL){
484 else if(polarization1_ == HORIZONTAL_POL){
487 else if(polarization1_ == VERTICAL_POL){
494 carma::correlator::lib::CorrelatorBaseline::getPolarization2String( )
const
496 if(polarization2_ == LEFT_POL){
499 else if(polarization2_ == RIGHT_POL){
502 else if(polarization2_ == HORIZONTAL_POL){
505 else if(polarization2_ == VERTICAL_POL){
512 carma::correlator::lib::CorrelatorBaseline::getPolarization( )
const
514 std::string output =
"";
515 if(polarization1_ == LEFT_POL){
518 else if(polarization1_ == RIGHT_POL){
521 else if(polarization1_ == HORIZONTAL_POL){
524 else if(polarization1_ == VERTICAL_POL){
530 if(polarization2_ == LEFT_POL){
533 else if(polarization2_ == RIGHT_POL){
536 else if(polarization2_ == HORIZONTAL_POL){
539 else if(polarization2_ == VERTICAL_POL){
int getBoardId() const
Get the board ID from which this data came from.
void addSideband(const carma::correlator::lib::CorrelatorSideband &sb)
Add a sideband object to this baseline.
Abstract Class used to allow object to serialize themselves into a byte array.
const carma::correlator::lib::CorrelatorSideband & getUpperSideband() const
Get an UpperSideband object.
Abstract base class for all monitor points.
void addIn(const CorrelatorBaseline &rhs)
Add a CorrelatorBaseline into this one.
friend bool operator==(const CorrelatorBaseline &lhs, const CorrelatorBaseline &rhs)
== operator.
Polarization getPolarization1() const
Get polarization.
int getBoardSN() const
Get the Board serial number from which this data came from.
void setAntPol1(int antNum, carma::correlator::lib::Polarization polarization)
Set polarization & antenna number.
BLANKING_FLAGGING
Blanking/flagging status of the data.
void setInput2Number(int i2num)
Set the second input number for this baseline.
const std::vector< carma::correlator::lib::CorrelatorSideband > & getSidebands() const
Get all sidebands stored for this baseline.
CorrelatorBaseline & operator=(const CorrelatorBaseline &rhs)
= operator.
int getInput1Number() const
Get the first input number for this baseline.
void swap(CorrelatorBaseline &rhs)
Swap this instance with another CorrelatorBaseline instance.
void setInput1Number(int i1num)
Set the first input number for this baseline.
bool isValid() const
Returns true if any sideband is valid, false otherwise.
CorrelatorBaseline()
Constructor.
int getSizeInBytes() const
Return size in bytes.
void flagData(unsigned int reason)
Flag data with specified reason.
const carma::correlator::lib::CorrelatorSideband & getLowerSideband() const
Get a LowerSideband object.
Class to hold Correlator Baseline data.
void mySerialize(char *byteArray, int *offset) const
Called by serialize method.
void blankData(unsigned int reason)
Blank data with specified reason (removes all data).
void setBoardId(int boardId)
Set the board ID from which this data came from.
int getNumberOfSidebands() const
Get the number of Sidebands for this baseline.
const carma::correlator::lib::CorrelatorSideband & getAutoSideband() const
Get an AutoSideband object.
void normalize()
Normalize baseline data.
virtual ~CorrelatorBaseline()
Destructor.
void deserializeSwapVer0(const char *byteArray, int *offset, int byteArraySize)
call to reconstruct the object.
void setBoardSN(int boardSN)
Set the Board serial number from which this data came from.
int getInput2Number() const
Get the second input number for this baseline.
void deserializeVer0(const char *byteArray, int *offset, int byteArraySize)
call to reconstruct the object.
Base class for Correlator Sideband data.