DP3
Classes | Public Member Functions | List of all members
dp3::ddecal::BdaSolverBuffer Class Reference

#include <BdaSolverBuffer.h>

Classes

struct  IntervalRow
 

Public Member Functions

 BdaSolverBuffer (double start, double interval, size_t n_baselines)
 
void AdvanceInterval ()
 
void AppendAndWeight (std::unique_ptr< base::BdaBuffer > buffer, const std::vector< std::string > &direction_names, bool keep_unweighted_model_data)
 
void ApplySolutions (const std::vector< std::vector< std::complex< double >>> &solutions, const std::vector< double > &channel_block_start_frequencies, size_t n_polarizations, const std::vector< int > &antenna1, const std::vector< int > &antenna2, const std::vector< std::vector< double >> &channel_frequencies)
 
size_t BufferCount () const
 
void Clear ()
 
double CurrentIntervalStart () const
 
int GetCurrentInterval () const
 
std::vector< std::unique_ptr< base::BdaBuffer > > GetDone ()
 
const std::vector< IntervalRow > & GetIntervalRows () const
 
double IntervalDuration () const
 
bool IntervalIsComplete () const
 

Constructor & Destructor Documentation

◆ BdaSolverBuffer()

dp3::ddecal::BdaSolverBuffer::BdaSolverBuffer ( double  start,
double  interval,
size_t  n_baselines 
)
inline

Constructor.

Parameters
startStart time of the first solution interval.
intervalLength of a solution interval. Should be > 0.0.
n_baselinesThe number of baselines.

Member Function Documentation

◆ AdvanceInterval()

void dp3::ddecal::BdaSolverBuffer::AdvanceInterval ( )

Advances the current solution interval to the next interval. Releases all internal buffers that only hold data for previous solution intervals.

◆ AppendAndWeight()

void dp3::ddecal::BdaSolverBuffer::AppendAndWeight ( std::unique_ptr< base::BdaBuffer buffer,
const std::vector< std::string > &  direction_names,
bool  keep_unweighted_model_data 
)

This function takes a buffer with unweighted data and the corresponding weights. It weights these data buffers and stores the result internally.

Parameters
bufferA buffer with unweighted data, unweighted model data for each direction, weights and flags.
direction_namesThe names of the model data buffers in 'buffer'.
keep_unweighted_model_dataTrue: Keep the original unweighted model data. GetDone() will return the original buffers, including that model data. False: Delete the unweighted model data. GetDone() will return buffers without any model data for the given directions.

◆ ApplySolutions()

void dp3::ddecal::BdaSolverBuffer::ApplySolutions ( const std::vector< std::vector< std::complex< double >>> &  solutions,
const std::vector< double > &  channel_block_start_frequencies,
size_t  n_polarizations,
const std::vector< int > &  antenna1,
const std::vector< int > &  antenna2,
const std::vector< std::vector< double >> &  channel_frequencies 
)

Apply solutions to the unweighted predicted model visibilities.

Parameters
solutionsSolutions generated by a BdaSolver.
channel_block_start_frequenciesStart frequencies for each channel block. This vector has (n_channel_blocks + 1) items: The start frequency of a block is the end frequency of the previous block.
n_polarizationsNumber of polarizations in the solution. Should be 1, 2 or 4.
antenna1For each baseline, the index of the first antenna.
antenna2For each baseline, the index of the second antenna.
channel_frequenciesFor each baseline, the center frequencies of all BDA rows.

◆ BufferCount()

size_t dp3::ddecal::BdaSolverBuffer::BufferCount ( ) const
inline

Get the number of active buffers, which is the number of AppendAndWeight() calls minus the number of buffers that AdvanceInterval() released.

Returns
The number of active buffers.

◆ Clear()

void dp3::ddecal::BdaSolverBuffer::Clear ( )

Clears all internal buffers. Does not affect the solution interval and the number of directions.

◆ CurrentIntervalStart()

double dp3::ddecal::BdaSolverBuffer::CurrentIntervalStart ( ) const
inline

Start time of the current interval. This interval will not have any visibilities for which the time centroid is smaller than this value.

◆ GetCurrentInterval()

int dp3::ddecal::BdaSolverBuffer::GetCurrentInterval ( ) const
inline
Returns
The absolute index of the current solution interval.

◆ GetDone()

std::vector<std::unique_ptr<base::BdaBuffer> > dp3::ddecal::BdaSolverBuffer::GetDone ( )
inline

Retrieve all unweighted input buffers which only hold data for previous solution intervals. The BdaSolverBuffer is done processing those buffers. The BdaSolverBuffer returns the buffers in the same order as they were added using AppendAndWeight().

Returns
A possibly empty list of processed unweighted input buffers.

◆ GetIntervalRows()

const std::vector<IntervalRow>& dp3::ddecal::BdaSolverBuffer::GetIntervalRows ( ) const
inline

Get the content for the current solution interval. It consists of meta data and pointers to visibilities (weighted, unweighted, and model visibilities) for each BDA row.

◆ IntervalDuration()

double dp3::ddecal::BdaSolverBuffer::IntervalDuration ( ) const
inline

Duration of this interval. Given that visibilities are placed in an interval based on their centroid, this is the maximum difference between the centroid times of visibilities in the same interval, and is always larger than zero.

◆ IntervalIsComplete()

bool dp3::ddecal::BdaSolverBuffer::IntervalIsComplete ( ) const
inline
Returns
True if the current solution interval is complete. An interval is complete if the solver buffer contains a BDA row with a start time greater or equal to the end time of the current solution interval.

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