Source
getVii()->getVisBuffer()->phaseCenterShift(averagingParameters_p.getXpcOffset(),averagingParameters_p.getYpcOffset());
using std::set;
using namespace casacore;
namespace casa {
namespace vi {
namespace avg {
using casa::ms::MsRow;
///////////////////////////////////////////////////////////
//
// VbAvg: Averaging VisBuffer
//
/*
Definition: A baseline sample (baseline for short) is a table row
with a particular (antenna1, antenna2) pair at a particular time.
Averaging does not cross chunk boundaries of the input VI so the
input VI determines what values are averaged together. For example,
if the input VI is allows data from multiple scans into the same chunk
then some averaging across scans can occur; in this case the scan number
of the result will be the scan number of the first baseline instance
seen.
Row-level value treatment
=========================
The average is approximately computed on a per baseline basis:
averaged_baseline (antenna1, antenna2) =
sumOverAveragingInterval (baseline (antenna1, antenna2)) /
nBaselinesFoundInInterval
How row-level values are computed
---------------------------------
Time - Set to time of first baseline making up the average plus
half of the averaging interval.
Antenna1 - Copied from instance of baseline
Antenna2 - Copied from instance of baseline
Feed1 - Copied from instance of baseline
Feed2 - Copied from instance of baseline
Flag_Row - The flag row is the logical "and" of the flag rows
averaged together.
Data_Desc_Id - Copied from instance of baseline
Processor_Id - Copied from instance of baseline
Field_Id - Copied from instance of baseline
Interval - Set to averaging interval
Exposure - Minimum of the interval and the sum of the exposures
from unflagged rows
Time_Centroid - sum (timeCentroid[i] * exposure[i]) / sum (exposure[i])
Scan_Number - Copied from instance of baseline
Sigma - ???
Array_Id - Copied from instance of baseline
Observation_Id - Copied from instance of baseline
State_Id - Copied from instance of baseline
Uvw - Weighted average of the UVW values for the baseline
Weight - ???
Cube-level value treatment
--------------------------
For each baseline (i.e., antenna1, antenna2 pair) the average is
computed for each correlation (co) and channel (ch) of the data cube.
Data - sum (f(weightSpectrum (co, ch)) * data (co, ch)) /
sum (f(weightSpectrum (co, ch)))
f :== optional function applied to the weights; default is unity function.
Corrected_Data - Same was for Data however, VI setup can disable producing
averaged Corrected_Data
Model_Data - Same was for Data however, VI setup can disable producing