Source
Vector<Double> frequency = getVii()->getFrequencies (frequencyTime, getObservatoryFrequencyType ());
/*
* PhaseShiftTvi.cc
*
* Created on: Mar 12, 2015
* Author: jjacobs
*/
using namespace casacore;
namespace casa {
namespace vi {
PhaseShiftTvi::PhaseShiftTvi (ViImplementation2 * inputVi, double dXArcseconds,
double dYArcseconds)
: TransformingVi2 (inputVi),
dXArcseconds_p (dXArcseconds),
dYArcseconds_p (dYArcseconds)
{}
void
PhaseShiftTvi::phaseCenterShift (Cube<Complex> & cube) const
{
// Notes:
//
// 1) This is an operation that is likely performed elsewhere in CASA so that we ought to
// factor out any commonality.
//
// 2) This operation will put the uvw and phaseCenter values out alignment with the shifted
// data. If the data is going to be consumed by a more exacting application than plotMS
// these values ought to be adjusted as well by this TVI.
// Get cube shape as scalars
IPosition shape = cube.shape();
Int nCorrelations = shape (0);
Int nChannels = shape (1);
rownr_t nRows = shape (2);
const Int uIndex = 0; // uvw matrix is [3,nRows]
const Int vIndex = 1;
// Convert the offsets from arcseconds to radians
double radiansPerArcsecond = C::pi / (180 * 3600);
double dXRadians = dXArcseconds_p * radiansPerArcsecond;
double dYRadians = dYArcseconds_p * radiansPerArcsecond;
// Capture the uvw and the time for the VB window.
Matrix<Double> theUvw;
getVii()->uvw (theUvw);
Vector<Double> timeForRows;
getVii()->time (timeForRows);
// Allow for the case where the iterator window has many timestamps by making the
// frequencies a function of row number but not doing it when not needed.
double frequencyTime = timeForRows (0);