Source
xxxxxxxxxx
static DDMapper * getMapper ( casacore::String &desc,const casacore::Vector<casacore::String> &expr,casacore::Bool throw_excp=false );
//# DDMapper.h: this defines DDMapper
//# Copyright (C) 2000,2001
//# 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
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
namespace casa { //# NAMESPACE CASA - BEGIN
// <summary>
// Abstract Derived casacore::Data Mapper class
// </summary>
// <use visibility=local>
// <reviewed reviewer="" date="" tests="" demos="">
// </reviewed>
// <synopsis>
// The DDMapper class defines an interface for mapping complex visibilities
// into casacore::Float derived values. DDMappers are used by several flagging
// agents.
// </synopsis>
//
// <motivation>
// A lot of algorithms are expressed in terms of some real value
// derived from a set of visibilities (i.e., |XX|, |XX|-|YY|, etc.). The
// DDMapper hierarchy provides a uniform interface for deriving such values.
// </motivation>
//
// <todo asof="2001/04/16">
// <li> add this feature
// </todo>
class DDMapper
{
protected:
casacore::Bool valid;
casacore::uShort corrmask; // mask of affected correlations
public:
DDMapper () { valid=false; }
virtual ~DDMapper () {};
// Given a vector of correlation types, recomputes internal indices.
// returns true if all indices were found successfully.
virtual casacore::Bool reset ( const casacore::Vector<casacore::Int> &corr ) =0;
// Maps a slice of visibilities at (*,ich,irow) from the given
// viscube into a the derived value.
virtual casacore::Float map ( const casacore::Cube<casacore::Complex> &vis,casacore::uInt ich,casacore::uInt irow ) const =0;
// Returns the "mask" of correlations which are used by this mapper.
// by this mapper. Bit "i" is set if corr. "i" is used.
casacore::uShort corrMask () const { return corrmask; }
// Returns true if given correlations is masked
casacore::Bool masked (casacore::uInt icorr) const { return (corrmask&(1<<icorr)) != 0; }
// Tells if mapper is valid
casacore::Bool isValid () { return valid; }
};