Source
*logger_p << logLevel_p << " Clipping outside [" << clipmin_p << "," << clipmax_p << "], plus NaNs and zeros" << LogIO::POST;
//# FlagAgentClipping.cc: This file contains the implementation of the FlagAgentClipping 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
FlagAgentClipping::FlagAgentClipping(FlagDataHandler *dh, Record config, Bool writePrivateFlagCube, Bool flag):
FlagAgentBase(dh,config,IN_ROWS,writePrivateFlagCube,flag)
{
setAgentParameters(config);
// Request loading polarization map to FlagDataHandler
flagDataHandler_p->setMapPolarizations(true);
}
FlagAgentClipping::~FlagAgentClipping()
{
// Compiler automagically calls FlagAgentBase::~FlagAgentBase()
}
void
FlagAgentClipping::setAgentParameters(Record config)
{
logger_p->origin(LogOrigin(agentName_p,__FUNCTION__,WHERE));
int exists;
// First check basic configuration to see what modules are plugged in the check
exists = config.fieldNumber ("clipzeros");
if (exists >= 0)
{
if( config.type(exists) != TpBool )
{
throw( AipsError ( "Parameter 'clipzeros' must be of type 'bool'" ) );
}
clipzeros_p = config.asBool("clipzeros");
}
else
{
clipzeros_p = false;
}
*logger_p << logLevel_p << " clipzeros is " << clipzeros_p << LogIO::POST;
exists = config.fieldNumber ("clipoutside");
if (exists >= 0)
{
if( config.type(exists) != TpBool )
{
throw( AipsError ( "Parameter 'clipoutside' must be of type 'bool'" ) );
}
clipoutside_p = config.asBool("clipoutside");
}
else
{
clipoutside_p = true;
}
*logger_p << logLevel_p << " clipoutside is " << clipoutside_p << LogIO::POST;
String datacol = "";
weightcol_p = false;
exists = config.fieldNumber ("datacolumn");
if (exists >= 0)
{
datacol = config.asString("datacolumn");
}