//# RFASelector.cc: this defines RFASelector
//# Copyright (C) 2000,2001,2002
//# Associated Universities, Inc. Washington DC, USA.
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 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 Library General Public
//# License for more details.
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# Charlottesville, VA 22903-2475 USA
#include <casacore/casa/Exceptions/Error.h>
#include <casacore/casa/Arrays/ArrayMath.h>
#include <casacore/casa/Arrays/ArrayLogical.h>
#include <casacore/casa/Arrays/MaskedArray.h>
#include <casacore/casa/Arrays/MaskArrMath.h>
#include <casacore/casa/Quanta/Quantum.h>
#include <casacore/casa/Quanta/MVTime.h>
#include <casacore/casa/Logging/LogIO.h>
#include <msvis/MSVis/VisibilityIterator.h>
#include <msvis/MSVis/VisBuffer.h>
#include <flagging/Flagging/RFASelector.h>
namespace casa { //# NAMESPACE CASA - BEGIN
// -----------------------------------------------------------------------
// Reforms an array of 2N elements into a [2,N] matrix
// -----------------------------------------------------------------------
template<class T> casacore::Bool RFASelector::reformRange( casacore::Matrix<T> &rng,const casacore::Array<T> &arr )
if( arr.ndim()>2 || (arr.nelements()%2) !=0 )
rng = arr.reform(casacore::IPosition(2,2,arr.nelements()/2));
template<class T> casacore::Array<T> fieldToArray( const casacore::RecordInterface &parm,const casacore::String &id );
template<> casacore::Array<casacore::Int> fieldToArray<casacore::Int>( const casacore::RecordInterface &parm,const casacore::String &id )
{ return parm.toArrayInt(id); }
template<> casacore::Array<casacore::Double> fieldToArray<casacore::Double>( const casacore::RecordInterface &parm,const casacore::String &id )
{ return parm.toArrayDouble(id); }
template<> casacore::Array<casacore::String> fieldToArray<casacore::String>( const casacore::RecordInterface &parm,const casacore::String &id )