DP3
Public Member Functions | List of all members
dp3::base::DPInfo Class Reference

General info about DP3 data processing attributes like averaging. More...

#include <DPInfo.h>

Public Member Functions

 DPInfo (unsigned int n_correlations=0, unsigned int n_original_channels=0, std::string antenna_set=std::string())
 
const std::vector< double > & antennaDiam () const
 
const std::vector< int > & antennaMap () const
 
const std::vector< std::string > & antennaNames () const
 
const std::vector< casacore::MPosition > & antennaPos () const
 
const std::string & antennaSet () const
 
const std::vector< int > & antennaUsed () const
 
const casacore::MPosition & arrayPos () const
 
const casacore::MPosition arrayPosCopy () const
 
const std::vector< std::vector< double > > & BdaChanFreqs () const
 
const std::vector< std::vector< double > > & BdaChanWidths () const
 
const casacore::MDirection & beamCorrectionDir () const
 
int beamCorrectionMode () const
 
const std::vector< double > & chanFreqs (std::size_t baseline=0) const
 
bool channelsAreRegular () const
 Determine if the channels have a regular layout. More...
 
const std::vector< double > & chanWidths (std::size_t baseline=0) const
 
void clearMetaChanged ()
 
const std::string & dataColumnName () const
 
const casacore::MDirection & delayCenter () const
 
const casacore::MDirection delayCenterCopy () const
 
const std::vector< double > & effectiveBW (std::size_t baseline=0) const
 
double firstTime () const
 
const std::string & flagColumnName () const
 
const std::vector< int > & getAnt1 () const
 
const std::vector< int > & getAnt2 () const
 
const std::vector< int > & getAutoCorrIndex () const
 
const std::vector< double > & getBaselineLengths () const
 Get the lengths of the baselines (in meters). More...
 
std::map< std::string, Direction > & GetDirections ()
 
const std::map< std::string, Direction > & GetDirections () const
 
const std::vector< std::string > GetUsedAntennaNames () const
 
bool hasBDAChannels () const
 
bool isBDAIntervalFactorInteger () const
 
double lastTime () const
 
bool metaChanged () const
 Has the meta data been changed in a step (precluding an update)? More...
 
const std::string & msName () const
 
unsigned int nantenna () const
 
unsigned int nbaselines () const
 
unsigned int nchan () const
 
unsigned int nchanAvg () const
 
unsigned int ncorr () const
 
unsigned int ntime () const
 
unsigned int ntimeAvg (unsigned int baseline=0) const
 
const std::vector< unsigned int > & ntimeAvgs () const
 
const casacore::MDirection & originalPhaseCenter () const
 
unsigned int origNChan () const
 
const casacore::MDirection & phaseCenter () const
 
const casacore::MDirection phaseCenterCopy () const
 
Direction phaseCenterDirection () const
 
const std::set< aocommon::PolarizationEnum > & polarizations () const
 
double refFreq () const
 
void RemoveUnusedAntennas ()
 Remove unused stations from the antenna lists. More...
 
const std::vector< double > & resolutions (std::size_t baseline=0) const
 
void SelectBaselines (const std::vector< unsigned int > &baselines)
 
void SelectChannels (unsigned int start_channel, unsigned int n_channels)
 
void setAntennas (const std::vector< std::string > &antNames, const std::vector< double > &antDiam, const std::vector< casacore::MPosition > &antPos, const std::vector< int > &ant1, const std::vector< int > &ant2)
 Set the info for the given antennae and baselines. More...
 
void setArrayInformation (const casacore::MPosition &arrayPos, const casacore::MDirection &phaseCenter, const casacore::MDirection &delayCenter, const casacore::MDirection &tileBeamDir)
 
void setBeamCorrectionDir (const casacore::MDirection &dir)
 
void setBeamCorrectionMode (int mode)
 
void setChannels (std::vector< double > &&chanFreqs, std::vector< double > &&chanWidths, std::vector< double > &&resolutions=std::vector< double >(), std::vector< double > &&effectiveBW=std::vector< double >(), double refFreq=0, int spectralWindow=0)
 
void setChannels (std::vector< std::vector< double >> &&chanFreqs, std::vector< std::vector< double >> &&chanWidths, std::vector< std::vector< double >> &&resolutions=std::vector< std::vector< double >>(), std::vector< std::vector< double >> &&effectiveBW=std::vector< std::vector< double >>(), double refFreq=0, int spectralWindow=0)
 
void setIsBDAIntervalFactorInteger (bool isIntervalInteger)
 
void setMetaChanged ()
 Set change of meta data. More...
 
void setMsName (const std::string &ms_name)
 
void setMsNames (const std::string &ms_name, const std::string &data_column_name, const std::string &flag_column_name, const std::string &weight_column_name)
 
void setPhaseCenter (const casacore::MDirection &phase_center)
 
void setPolarizations (const std::set< aocommon::PolarizationEnum > &polarizations)
 
void setTimeIntervalAndSteps (double timeInterval, unsigned int ntime)
 Set the time interval and the number of time steps. More...
 
void setTimes (double first_time, double last_time, double time_interval)
 
int spectralWindow () const
 
unsigned int startchan () const
 
double startTime () const
 
const casacore::MDirection & tileBeamDir () const
 
const casacore::MDirection tileBeamDirCopy () const
 
double timeInterval () const
 
double totalBW () const
 
void update (std::vector< unsigned int > &&timeAvg)
 Update the info for the given average factors. More...
 
unsigned int update (unsigned int chanAvg, unsigned int timeAvg)
 
const std::string & weightColumnName () const
 

Detailed Description

General info about DP3 data processing attributes like averaging.

This class contains the information about the number of correlations, channels, baselines, and times. It is initialized by the first step and updated by steps like Averager that change the number of channels or times. Steps can take information from it to know about shapes.

Constructor & Destructor Documentation

◆ DPInfo()

dp3::base::DPInfo::DPInfo ( unsigned int  n_correlations = 0,
unsigned int  n_original_channels = 0,
std::string  antenna_set = std::string() 
)
explicit

Member Function Documentation

◆ antennaDiam()

const std::vector<double>& dp3::base::DPInfo::antennaDiam ( ) const
inline

◆ antennaMap()

const std::vector<int>& dp3::base::DPInfo::antennaMap ( ) const
inline

Get the indices of all antennae in the used antenna vector above. -1 means that the antenna is not used. E.g. [0,-1,1,-1,-1,2,3] for the example above.

◆ antennaNames()

const std::vector<std::string>& dp3::base::DPInfo::antennaNames ( ) const
inline

◆ antennaPos()

const std::vector<casacore::MPosition>& dp3::base::DPInfo::antennaPos ( ) const
inline

◆ antennaSet()

const std::string& dp3::base::DPInfo::antennaSet ( ) const
inline

◆ antennaUsed()

const std::vector<int>& dp3::base::DPInfo::antennaUsed ( ) const
inline

Get the antenna numbers actually used in the (selected) baselines. E.g. [0,2,5,6]

◆ arrayPos()

const casacore::MPosition& dp3::base::DPInfo::arrayPos ( ) const
inline

◆ arrayPosCopy()

const casacore::MPosition dp3::base::DPInfo::arrayPosCopy ( ) const
inline

◆ BdaChanFreqs()

const std::vector<std::vector<double> >& dp3::base::DPInfo::BdaChanFreqs ( ) const
inline

◆ BdaChanWidths()

const std::vector<std::vector<double> >& dp3::base::DPInfo::BdaChanWidths ( ) const
inline

◆ beamCorrectionDir()

const casacore::MDirection& dp3::base::DPInfo::beamCorrectionDir ( ) const
inline

◆ beamCorrectionMode()

int dp3::base::DPInfo::beamCorrectionMode ( ) const
inline

Get the beam correction mode.

Returns
An integer representation of an everybeam::BeamMode value.

◆ chanFreqs()

const std::vector<double>& dp3::base::DPInfo::chanFreqs ( std::size_t  baseline = 0) const
inline

◆ channelsAreRegular()

bool dp3::base::DPInfo::channelsAreRegular ( ) const

Determine if the channels have a regular layout.

◆ chanWidths()

const std::vector<double>& dp3::base::DPInfo::chanWidths ( std::size_t  baseline = 0) const
inline

◆ clearMetaChanged()

void dp3::base::DPInfo::clearMetaChanged ( )
inline

◆ dataColumnName()

const std::string& dp3::base::DPInfo::dataColumnName ( ) const
inline

◆ delayCenter()

const casacore::MDirection& dp3::base::DPInfo::delayCenter ( ) const
inline

◆ delayCenterCopy()

const casacore::MDirection dp3::base::DPInfo::delayCenterCopy ( ) const
inline

◆ effectiveBW()

const std::vector<double>& dp3::base::DPInfo::effectiveBW ( std::size_t  baseline = 0) const
inline

◆ firstTime()

double dp3::base::DPInfo::firstTime ( ) const
inline

◆ flagColumnName()

const std::string& dp3::base::DPInfo::flagColumnName ( ) const
inline

◆ getAnt1()

const std::vector<int>& dp3::base::DPInfo::getAnt1 ( ) const
inline

◆ getAnt2()

const std::vector<int>& dp3::base::DPInfo::getAnt2 ( ) const
inline

◆ getAutoCorrIndex()

const std::vector<int>& dp3::base::DPInfo::getAutoCorrIndex ( ) const

Get the baseline table index of the autocorrelations. A negative value means there are no autocorrelations for that antenna.

◆ getBaselineLengths()

const std::vector<double>& dp3::base::DPInfo::getBaselineLengths ( ) const

Get the lengths of the baselines (in meters).

◆ GetDirections() [1/2]

std::map<std::string, Direction>& dp3::base::DPInfo::GetDirections ( )
inline

◆ GetDirections() [2/2]

const std::map<std::string, Direction>& dp3::base::DPInfo::GetDirections ( ) const
inline

◆ GetUsedAntennaNames()

const std::vector<std::string> dp3::base::DPInfo::GetUsedAntennaNames ( ) const

◆ hasBDAChannels()

bool dp3::base::DPInfo::hasBDAChannels ( ) const
inline

◆ isBDAIntervalFactorInteger()

bool dp3::base::DPInfo::isBDAIntervalFactorInteger ( ) const
inline

◆ lastTime()

double dp3::base::DPInfo::lastTime ( ) const
inline

◆ metaChanged()

bool dp3::base::DPInfo::metaChanged ( ) const
inline

Has the meta data been changed in a step (precluding an update)?

◆ msName()

const std::string& dp3::base::DPInfo::msName ( ) const
inline

◆ nantenna()

unsigned int dp3::base::DPInfo::nantenna ( ) const
inline

◆ nbaselines()

unsigned int dp3::base::DPInfo::nbaselines ( ) const
inline

◆ nchan()

unsigned int dp3::base::DPInfo::nchan ( ) const
inline

Number of channels after channel selection and averaging. This is the number of channels that a step can expect the data to have as input.

◆ nchanAvg()

unsigned int dp3::base::DPInfo::nchanAvg ( ) const
inline

◆ ncorr()

unsigned int dp3::base::DPInfo::ncorr ( ) const
inline

◆ ntime()

unsigned int dp3::base::DPInfo::ntime ( ) const
inline

◆ ntimeAvg()

unsigned int dp3::base::DPInfo::ntimeAvg ( unsigned int  baseline = 0) const
inline

◆ ntimeAvgs()

const std::vector<unsigned int>& dp3::base::DPInfo::ntimeAvgs ( ) const
inline

◆ originalPhaseCenter()

const casacore::MDirection& dp3::base::DPInfo::originalPhaseCenter ( ) const
inline

◆ origNChan()

unsigned int dp3::base::DPInfo::origNChan ( ) const
inline

The number of channels that the input measurement set has. This is from before any channel selection or averaging is done.

◆ phaseCenter()

const casacore::MDirection& dp3::base::DPInfo::phaseCenter ( ) const
inline

◆ phaseCenterCopy()

const casacore::MDirection dp3::base::DPInfo::phaseCenterCopy ( ) const
inline

◆ phaseCenterDirection()

Direction dp3::base::DPInfo::phaseCenterDirection ( ) const
Returns
The ra/dec direction corresponding to the phase center.

◆ polarizations()

const std::set<aocommon::PolarizationEnum>& dp3::base::DPInfo::polarizations ( ) const
inline

◆ refFreq()

double dp3::base::DPInfo::refFreq ( ) const
inline

◆ RemoveUnusedAntennas()

void dp3::base::DPInfo::RemoveUnusedAntennas ( )

Remove unused stations from the antenna lists.

◆ resolutions()

const std::vector<double>& dp3::base::DPInfo::resolutions ( std::size_t  baseline = 0) const
inline

◆ SelectBaselines()

void dp3::base::DPInfo::SelectBaselines ( const std::vector< unsigned int > &  baselines)

Select a subset of the baselines.

Parameters
baselinesA list with the indices of the baselines that must remain. All other baselines are removed.

◆ SelectChannels()

void dp3::base::DPInfo::SelectChannels ( unsigned int  start_channel,
unsigned int  n_channels 
)

Select a subset of the channels.

Parameters
start_channelStart channel, relative to the current first channel.
n_channelsNumber of channels to select.

◆ setAntennas()

void dp3::base::DPInfo::setAntennas ( const std::vector< std::string > &  antNames,
const std::vector< double > &  antDiam,
const std::vector< casacore::MPosition > &  antPos,
const std::vector< int > &  ant1,
const std::vector< int > &  ant2 
)

Set the info for the given antennae and baselines.

◆ setArrayInformation()

void dp3::base::DPInfo::setArrayInformation ( const casacore::MPosition &  arrayPos,
const casacore::MDirection &  phaseCenter,
const casacore::MDirection &  delayCenter,
const casacore::MDirection &  tileBeamDir 
)

◆ setBeamCorrectionDir()

void dp3::base::DPInfo::setBeamCorrectionDir ( const casacore::MDirection &  dir)
inline

◆ setBeamCorrectionMode()

void dp3::base::DPInfo::setBeamCorrectionMode ( int  mode)
inline

Set the beam correction mode.

Parameters
modeAn integer representation of an everybeam::BeamMode value.

◆ setChannels() [1/2]

void dp3::base::DPInfo::setChannels ( std::vector< double > &&  chanFreqs,
std::vector< double > &&  chanWidths,
std::vector< double > &&  resolutions = std::vector< double >(),
std::vector< double > &&  effectiveBW = std::vector< double >(),
double  refFreq = 0,
int  spectralWindow = 0 
)

Set the frequency info. An empty resolutions or effectiveBW is default to chanWidths. total_bandwidth_ is set to the sum of effectiveBW. If refFreq is 0, it is set to the middle of chanFreqs (mean if even).

Exceptions
std::invalid_argumentWhen vector sizes do not match.

◆ setChannels() [2/2]

void dp3::base::DPInfo::setChannels ( std::vector< std::vector< double >> &&  chanFreqs,
std::vector< std::vector< double >> &&  chanWidths,
std::vector< std::vector< double >> &&  resolutions = std::vector< std::vector< double >>(),
std::vector< std::vector< double >> &&  effectiveBW = std::vector< std::vector< double >>(),
double  refFreq = 0,
int  spectralWindow = 0 
)

Set the frequency info, using different info per baseline. total_bandwidth_ is set to the sum of effectiveBW, which should be equal for all baselines. If refFreq is 0, it is set to the middle of chanFreqs (mean if even). of the baseline with the most channels.

Parameters
chanFreqsChannel frequencies for each baseline in Hz.
chanWidthsChannel widths for each baseline in Hz.
resolutionsChannel resolution for each baseline in Hz. If omitted/empty, channel widths are used.
effectiveBWEffective bandwidth for the channels in each baseline
Exceptions
std::invalidargument When a vector has an incorrect size. The size of the vector arguments should be the number of baselines. For each baseline, the number of elements in the vectors for that baseline should be equal.

◆ setIsBDAIntervalFactorInteger()

void dp3::base::DPInfo::setIsBDAIntervalFactorInteger ( bool  isIntervalInteger)
inline

◆ setMetaChanged()

void dp3::base::DPInfo::setMetaChanged ( )
inline

Set change of meta data.

◆ setMsName()

void dp3::base::DPInfo::setMsName ( const std::string &  ms_name)
inline

◆ setMsNames()

void dp3::base::DPInfo::setMsNames ( const std::string &  ms_name,
const std::string &  data_column_name,
const std::string &  flag_column_name,
const std::string &  weight_column_name 
)

◆ setPhaseCenter()

void dp3::base::DPInfo::setPhaseCenter ( const casacore::MDirection &  phase_center)
inline

◆ setPolarizations()

void dp3::base::DPInfo::setPolarizations ( const std::set< aocommon::PolarizationEnum > &  polarizations)
inline

◆ setTimeIntervalAndSteps()

void dp3::base::DPInfo::setTimeIntervalAndSteps ( double  timeInterval,
unsigned int  ntime 
)
inline

Set the time interval and the number of time steps.

◆ setTimes()

void dp3::base::DPInfo::setTimes ( double  first_time,
double  last_time,
double  time_interval 
)

Set time information and derive the number of time slots.

Parameters
first_timeCentroid time of the first time slot, in mjd seconds.
last_timeCentroid time of the last time slot, in mjd seconds.
time_intervalTime interval between two time slots, in mjd seconds.

◆ spectralWindow()

int dp3::base::DPInfo::spectralWindow ( ) const
inline

◆ startchan()

unsigned int dp3::base::DPInfo::startchan ( ) const
inline

Index of first selected channel in the input measurement set. Averaging does not affect this number.

◆ startTime()

double dp3::base::DPInfo::startTime ( ) const
inline

◆ tileBeamDir()

const casacore::MDirection& dp3::base::DPInfo::tileBeamDir ( ) const
inline

◆ tileBeamDirCopy()

const casacore::MDirection dp3::base::DPInfo::tileBeamDirCopy ( ) const
inline

◆ timeInterval()

double dp3::base::DPInfo::timeInterval ( ) const
inline

Difference in time between two consecutive timesteps. In case the measurement set is baseline-dependently (BD) averaged, this is the unit time interval value, which is basically the interval before BD averaging.

◆ totalBW()

double dp3::base::DPInfo::totalBW ( ) const
inline

◆ update() [1/2]

void dp3::base::DPInfo::update ( std::vector< unsigned int > &&  timeAvg)

Update the info for the given average factors.

◆ update() [2/2]

unsigned int dp3::base::DPInfo::update ( unsigned int  chanAvg,
unsigned int  timeAvg 
)

Update the info for the given average factors. If chanAvg is higher than the actual nr of channels, it is reset. The same is true for timeAvg. It returns the possibly reset nr of channels to average.

◆ weightColumnName()

const std::string& dp3::base::DPInfo::weightColumnName ( ) const
inline

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