Source
template<class T> UVContSubtractionDenoisingKernel<T>::UVContSubtractionDenoisingKernel(denoising::GslPolynomialModel<Double>* model,
//# UVContSubTVI.h: This file contains the implementation of the UVContSubTVI 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
//////////////////////////////////////////////////////////////////////////
// UVContSubTVI class
//////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------
//
// -----------------------------------------------------------------------
UVContSubTVI::UVContSubTVI( ViImplementation2 * inputVii,
const Record &configuration):
FreqAxisTVI (inputVii)
{
fitOrder_p = 0;
want_cont_p = False;
fitspw_p = String("");
withDenoisingLib_p = True;
nThreads_p = 1;
niter_p = 1;
inputFrequencyMap_p.clear();
// 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 UVContSubTVI configuration");
}
initialize();
return;
}
UVContSubTVI::~UVContSubTVI()
{
for (auto iter = inputFrequencyMap_p.begin();iter != inputFrequencyMap_p.end(); iter++)
{
delete iter->second;
}
inputFrequencyMap_p.clear();
}
// -----------------------------------------------------------------------
//
// -----------------------------------------------------------------------
Bool UVContSubTVI::parseConfiguration(const Record &configuration)
{
int exists = -1;
Bool ret = True;
exists = -1;
exists = configuration.fieldNumber ("fitorder");
if (exists >= 0)
{
configuration.get (exists, fitOrder_p);
if (fitOrder_p > 0)
{
logger_p << LogIO::NORMAL << LogOrigin("UVContSubTVI", __FUNCTION__)
<< "Fit order is " << fitOrder_p << LogIO::POST;
}