Source
radialVelocity_p = inputMSFieldCols_p->radVelMeas(fieldIdForPhaseCenter, referenceTime_p.get("s").getValue());
//# RegriddingTVI.h: This file contains the implementation of the RegriddingTVI class.
//#
//# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
//# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
//# Copyright (C) European Southern Observatory, 2011, All rights reserved.
//#
//# This library is free software; you can redistribute it and/or
//# modify it under the terms of the GNU Lesser General Public
//# License as published by the Free software Foundation; either
//# version 2.1 of the License, or (at your option) any later version.
//#
//# This library is distributed in the hope that it will be useful,
//# but WITHOUT ANY WARRANTY, without even the implied warranty of
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//# Lesser General Public License for more details.
//#
//# You should have received a copy of the GNU Lesser General Public
//# License along with this library; if not, write to the Free Software
//# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
//# MA 02111-1307 USA
//# $Id: $
using namespace casacore;
namespace casa { //# NAMESPACE CASA - BEGIN
namespace vi { //# NAMESPACE VI - BEGIN
//////////////////////////////////////////////////////////////////////////
// RegriddingTVI class
//////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------
//
// -----------------------------------------------------------------------
RegriddingTVI::RegriddingTVI( ViImplementation2 * inputVii,
const Record &configuration):
FreqAxisTVI (inputVii)
{
// Frequency specification parameters
nChan_p = -1;
mode_p = String("channel"); // Options are: channel, frequency, velocity
start_p = String("0");
width_p = String("1"); // -1 means use all the input channels
velocityType_p = String("radio"); // When mode is velocity options are: optical, radio
restFrequency_p = String("");
interpolationMethodPar_p = String("linear"); // Options are: nearest, linear, cubic, spline, fftshift
outputReferenceFramePar_p = String(""); // Options are: LSRK, LSRD, BARY, GALACTO, LGROUP, CMB, GEO, or TOPO
phaseCenterPar_p = new casac::variant("");
regriddingMethod_p = linear;
// Sub-cases
refFrameTransformation_p = false;
radialVelocityCorrection_p = false;
fftShift_p = 0;
// SPW-indexed maps
weightFactorMap_p.clear();
sigmaFactorMap_p.clear();
inputOutputSpwMap_p.clear();
freqTransEngineRowId_p = UINT_MAX;
// Parse and check configuration parameters
// Note: if a constructor finishes by throwing an exception, the memory
// associated with the object itself is cleaned up — there is no memory leak.
if (not parseConfiguration(configuration))
{
throw AipsError("Error parsing RegriddingTVI configuration");
}
initialize();
return;
}
// -----------------------------------------------------------------------
//
// -----------------------------------------------------------------------
Bool RegriddingTVI::parseConfiguration(const Record &configuration)
{
int exists = -1;
Bool ret = true;
exists = configuration.fieldNumber ("phasecenter");
if (exists >= 0)
{
//If phase center is a simple numeric value then it is taken
// as a FIELD_ID otherwise it is converted to a MDirection
if( configuration.type(exists) == TpInt )
{
int fieldIdForPhaseCenter = -1;