casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
casa::sdfiller::DataChunk Class Reference

#include <DataAccumulator.h>

Public Member Functions

 DataChunk (casacore::String const &poltype)
 
virtual ~DataChunk ()
 
casacore::String getPolType () const
 
void resetPolType (casacore::String const &poltype)
 
casacore::uInt getNumPol () const
 
void initialize (size_t num_chan)
 
void clear ()
 
bool readyToWrite ()
 
bool accumulate (DataRecord const &record)
 
bool get (MSDataRecord &record)
 

Public Attributes

friend DataAccumulator
 

Private Member Functions

bool isFullPol () const
 Functions to return if accumulated corr types are conformant set, e.g., liner polarization should have XX and YY for dual pol. More...
 
bool isDualPol () const
 
bool isSinglePol0 () const
 
bool isSinglePol1 () const
 
bool isValidRecord (DataRecord const &record)
 
void setPolType (casacore::String const &poltype)
 
void setTsys2 (MSDataRecord &record, std::vector< size_t > order={})
 Tsys and Tcal assignment for 2 & 4 pols. More...
 
void setTcal2 (MSDataRecord &record, std::vector< size_t > order={})
 
void setTsys1 (MSDataRecord &record, ssize_t start_src)
 
void setTcal1 (MSDataRecord &record, ssize_t start_src)
 
bool getLinear (MSDataRecord &record)
 
bool getCircular (MSDataRecord &record)
 
bool getStokes (MSDataRecord &record)
 
bool getLinpol (MSDataRecord &record)
 
casacore::uInt getNumPolLinear () const
 
casacore::uInt getNumPolCircular () const
 
casacore::uInt getNumPolStokes () const
 
casacore::uInt getNumPolLinpol () const
 

Private Attributes

size_t const num_pol_max_
 
size_t num_chan_
 
casacore::Matrix< casacore::Floatdata_
 
casacore::Matrix< casacore::Boolflag_
 
casacore::Vector< casacore::Boolflag_row_
 
casacore::Matrix< casacore::Floattsys_
 
casacore::Matrix< casacore::Floattcal_
 
casacore::Vector< casacore::Floatweight_
 
casacore::Vector< casacore::Floatsigma_
 
casacore::String poltype_
 
casacore::Vector< casacore::Intvalid_pcorr_
 
std::vector
< casacore::Stokes::StokesTypes
pcorr_type_
 
bool(DataChunk::* get_chunk_ )(MSDataRecord &record)
 
casacore::uInt(DataChunk::* get_num_pol_ )() const
 

Detailed Description

Definition at line 247 of file DataAccumulator.h.

Constructor & Destructor Documentation

casa::sdfiller::DataChunk::DataChunk ( casacore::String const &  poltype)
inline

Definition at line 251 of file DataAccumulator.h.

References POST_END, and POST_START.

virtual casa::sdfiller::DataChunk::~DataChunk ( )
inlinevirtual

Definition at line 263 of file DataAccumulator.h.

Member Function Documentation

bool casa::sdfiller::DataChunk::accumulate ( DataRecord const &  record)
inline

Polarization

check for consistency between pol_type and stokes

check if pcorr is the new corr type to be added

new polarization type

Matrices in DataRecord is stacked in the order of accumulation

std::cout << "tsys is not empty: " << record.tsys[0] << std::endl;

std::cout << "tcal is not empty: " << record.tcal << std::endl;

Filling Matrices[chan, pol] in DataRecord. The Matrices are column (channel) major

data_.column(colid) = data;

flag_.column(colid) = flag;

tsys_.column(polid) = tsys;

tcal_.column(polid) = tcal;

Definition at line 300 of file DataAccumulator.h.

References casacore::Vector< T >::assign(), casa::data, casa::sdfiller::DataRecord::data, casacore::ArrayBase::empty(), casa::sdfiller::DataRecord::flag, casa::sdfiller::DataRecord::flag_row, casa::isValidRecord(), casacore::Stokes::name(), casacore::ArrayBase::nelements(), casa::sdfiller::DataRecord::pol, POST_START, casacore::Vector< T >::shape(), casacore::ArrayBase::size(), casa::sdfiller::DataRecord::tcal, and casa::sdfiller::DataRecord::tsys.

void casa::sdfiller::DataChunk::clear ( )
inline

Definition at line 291 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::get ( MSDataRecord record)
inline

Definition at line 385 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::getCircular ( MSDataRecord record)
inlineprivate

Definition at line 666 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::getLinear ( MSDataRecord record)
inlineprivate

POL 0, 1, 2, and 3 std::cout << "set data/flag" << std::endl;

std::cout << "weight = " << record.weight << std::endl;

std::cout << "set tsys" << std::endl;

std::cout << "set tcal " << tcal_ << std::endl;

POL 0 and 1 std::cout << "set data/flag" << std::endl;

std::cout << "weight = " << record.weight << std::endl;

std::cout << "set tsys" << std::endl;

std::cout << "set tcal " << tcal_ << std::endl;

only POL 0 std::cout << "set data/flag (pol 0)" << std::endl;

std::cout << "set tcal " << tcal_ << std::endl;

only POL 1 std::cout << "set data/flag (pol 1)" << std::endl;

std::cout << "set tcal " << tcal_ << std::endl;

std::cout << "DataChunk is not ready for get" << std::endl;

Definition at line 571 of file DataAccumulator.h.

References casacore::anyEQ(), casa::sdfiller::MSDataRecord::complex_data, casa::sdfiller::MSDataRecord::corr_type, casa::sdfiller::MSDataRecord::flag, casa::sdfiller::MSDataRecord::flag_row, casa::sdfiller::MSDataRecord::float_data, casa::sdfiller::MSDataRecord::num_pol, POST_END, POST_START, casa::sdfiller::MSDataRecord::setComplex(), casa::sdfiller::MSDataRecord::setDataSize(), and casa::sdfiller::MSDataRecord::setFloat().

bool casa::sdfiller::DataChunk::getLinpol ( MSDataRecord record)
inlineprivate
casacore::uInt casa::sdfiller::DataChunk::getNumPol ( ) const
inline

Definition at line 275 of file DataAccumulator.h.

casacore::uInt casa::sdfiller::DataChunk::getNumPolCircular ( ) const
inlineprivate

Definition at line 760 of file DataAccumulator.h.

casacore::uInt casa::sdfiller::DataChunk::getNumPolLinear ( ) const
inlineprivate

Definition at line 748 of file DataAccumulator.h.

casacore::uInt casa::sdfiller::DataChunk::getNumPolLinpol ( ) const
inlineprivate

Definition at line 774 of file DataAccumulator.h.

casacore::uInt casa::sdfiller::DataChunk::getNumPolStokes ( ) const
inlineprivate

Definition at line 764 of file DataAccumulator.h.

casacore::String casa::sdfiller::DataChunk::getPolType ( ) const
inline

Definition at line 266 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::getStokes ( MSDataRecord record)
inlineprivate
void casa::sdfiller::DataChunk::initialize ( size_t  num_chan)
inline

Definition at line 279 of file DataAccumulator.h.

References casacore::shape().

bool casa::sdfiller::DataChunk::isDualPol ( ) const
inlineprivate

Definition at line 398 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::isFullPol ( ) const
inlineprivate

Functions to return if accumulated corr types are conformant set, e.g., liner polarization should have XX and YY for dual pol.

assumption: pcorr_type_ has StokesTypes consistent with poltype_ and not redundant (assured by accumulate())

Definition at line 395 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::isSinglePol0 ( ) const
inlineprivate

Definition at line 406 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::isSinglePol1 ( ) const
inlineprivate

Definition at line 410 of file DataAccumulator.h.

bool casa::sdfiller::DataChunk::isValidRecord ( DataRecord const &  record)
inlineprivate
bool casa::sdfiller::DataChunk::readyToWrite ( )
inline

Definition at line 296 of file DataAccumulator.h.

void casa::sdfiller::DataChunk::resetPolType ( casacore::String const &  poltype)
inline

Definition at line 270 of file DataAccumulator.h.

void casa::sdfiller::DataChunk::setPolType ( casacore::String const &  poltype)
inlineprivate
void casa::sdfiller::DataChunk::setTcal1 ( MSDataRecord record,
ssize_t  start_src 
)
inlineprivate

should be spectral Tsys

record.tsys = -1;

record.tsys.row(0) = tsys_.column(0);

scalar Tsys

Definition at line 553 of file DataAccumulator.h.

References casa::sdfiller::MSDataRecord::setTcalSize(), and casa::sdfiller::MSDataRecord::tcal.

void casa::sdfiller::DataChunk::setTcal2 ( MSDataRecord record,
std::vector< size_t >  order = { } 
)
inlineprivate

clear Tcal

Definition at line 505 of file DataAccumulator.h.

void casa::sdfiller::DataChunk::setTsys1 ( MSDataRecord record,
ssize_t  start_src 
)
inlineprivate

should be spectral Tsys

record.tsys = -1;

record.tsys.row(0) = tsys_.column(0);

scalar Tsys

Definition at line 535 of file DataAccumulator.h.

References casa::sdfiller::MSDataRecord::setTsysSize(), and casa::sdfiller::MSDataRecord::tsys.

void casa::sdfiller::DataChunk::setTsys2 ( MSDataRecord record,
std::vector< size_t >  order = { } 
)
inlineprivate

Tsys and Tcal assignment for 2 & 4 pols.

Auto-correlation components of pol should be used.

clear Tsys

Definition at line 475 of file DataAccumulator.h.

Member Data Documentation

casacore::Matrix<casacore::Float> casa::sdfiller::DataChunk::data_
private

Definition at line 460 of file DataAccumulator.h.

friend casa::sdfiller::DataChunk::DataAccumulator

Definition at line 249 of file DataAccumulator.h.

casacore::Matrix<casacore::Bool> casa::sdfiller::DataChunk::flag_
private

Definition at line 461 of file DataAccumulator.h.

casacore::Vector<casacore::Bool> casa::sdfiller::DataChunk::flag_row_
private

Definition at line 462 of file DataAccumulator.h.

bool(DataChunk::* casa::sdfiller::DataChunk::get_chunk_)(MSDataRecord &record)
private

Definition at line 471 of file DataAccumulator.h.

casacore::uInt(DataChunk::* casa::sdfiller::DataChunk::get_num_pol_)() const
private

Definition at line 472 of file DataAccumulator.h.

size_t casa::sdfiller::DataChunk::num_chan_
private

Definition at line 459 of file DataAccumulator.h.

size_t const casa::sdfiller::DataChunk::num_pol_max_
private

Definition at line 458 of file DataAccumulator.h.

std::vector<casacore::Stokes::StokesTypes> casa::sdfiller::DataChunk::pcorr_type_
private

Definition at line 470 of file DataAccumulator.h.

casacore::String casa::sdfiller::DataChunk::poltype_
private

Definition at line 468 of file DataAccumulator.h.

casacore::Vector<casacore::Float> casa::sdfiller::DataChunk::sigma_
private

Definition at line 466 of file DataAccumulator.h.

casacore::Matrix<casacore::Float> casa::sdfiller::DataChunk::tcal_
private

Definition at line 464 of file DataAccumulator.h.

casacore::Matrix<casacore::Float> casa::sdfiller::DataChunk::tsys_
private

Definition at line 463 of file DataAccumulator.h.

casacore::Vector<casacore::Int> casa::sdfiller::DataChunk::valid_pcorr_
private

Definition at line 469 of file DataAccumulator.h.

casacore::Vector<casacore::Float> casa::sdfiller::DataChunk::weight_
private

Definition at line 465 of file DataAccumulator.h.


The documentation for this class was generated from the following file: