//# TJonesMBuf.h: TJones calibration main table buffer //# Copyright (C) 1996,1997,1998,2001,2002,2003 //# 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 adressed 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$ #ifndef CALIBRATION_TJONESMBUF_H #define CALIBRATION_TJONESMBUF_H #include #include #include #include namespace casa { //# NAMESPACE CASA - BEGIN // // TJonesPolyMBuf: TJonesPoly calibration main table buffer // // // // //
  • CalMainBuffer module //
  • SolvableVisJonesMBuf module //
  • TJonesMBuf module // // // // From "TJonesPoly matrix", "cal main table" and "buffer" // // // // The TJonesPolyMBuf class holds a buffer, optionally connected to a // TJonesPoly calibration main table iterator (of base type CalIterBase). // The TJonesPoly matrix contains atmospheric gains expressed as // polynomials over time. // // // // // // // // // Encapsulate TJonesPoly calibration main table data buffers. // // // // (i) Deal with non-standard columns. // class TJonesPolyMBuf : public TJonesMBuf { public: // Default constructor. No connection to an underlying // calibration table iterator in this case. TJonesPolyMBuf(); // Construct from a set of calibration buffer indices and // their specified values. Non-index columns will be set // to default values, and there is no connection to an // underlying calibration table iterator in this case. TJonesPolyMBuf (const casacore::Vector& calIndices, const casacore::Block >& indexValues); // Construct from a calibration table iterator. The calibration // buffer will remain synchronized with the iterator. TJonesPolyMBuf (CalIterBase& calIter); // Invalidate the current calibration buffer. This signals // that a re-read is required as the iterator has advanced virtual void invalidate(); // Write the current buffer at the end of a specified cal table virtual casacore::Int append (CalTable& calTable); // Maximum number of rows in the calibration buffer virtual casacore::Int nRow(); // Update the parametrized solution in each of a set of buffer rows virtual casacore::Bool fillMatchingRows (const casacore::Vector& matchingRows, const casacore::String& sFreqGrpName, const casacore::String& sPolyType, const casacore::String& sPolyMode, const casacore::Complex& sScaleFactor, const casacore::Int& sNPolyAmp, const casacore::Int& sNPolyPhase, const casacore::Vector& sPolyCoeffAmp, const casacore::Vector& sPolyCoeffPhase, const casacore::String& sPhaseUnits, const casacore::MFrequency& sRefFreq, const casacore::Int& sRefAnt); // casacore::Data field accessors virtual casacore::Vector& polyType(); virtual casacore::Vector& polyMode(); virtual casacore::Vector& scaleFactor(); virtual casacore::Vector& nPolyAmp(); virtual casacore::Vector& nPolyPhase(); virtual casacore::Array& polyCoeffAmp(); virtual casacore::Array& polyCoeffPhase(); virtual casacore::Vector& phaseUnits(); protected: // Factory method to create a columns accessor object of the // appropriate type virtual TJonesPolyMCol* newCalMainCol (CalTable& calTable) { return new TJonesPolyMCol(dynamic_cast(calTable));}; // Access to the columns accessor object virtual TJonesPolyMCol* calMainCol() {return dynamic_cast(CalMainBuffer::calMainCol());}; // // Fill the TJonesPoly cal buffer attribute columns in an empty // cal buffer, to extend the inherited method fillAttributes. The // cal indices, specified as enums from class MSCalEnums, are excluded // as non-attribute columns. // // Use a visibility buffer to define the attribute values (NYI) virtual void fillAttributes(const casacore::Vector& /*calIndices*/, const VisBuffer& /*vb*/) {}; // // Set default attribute values virtual void fillAttributes(const casacore::Vector& calIndices); // private: // Buffer fields casacore::Vector polyType_p; casacore::Vector polyMode_p; casacore::Vector scaleFactor_p; casacore::Vector nPolyAmp_p; casacore::Vector nPolyPhase_p; casacore::Array polyCoeffAmp_p; casacore::Array polyCoeffPhase_p; casacore::Vector phaseUnits_p; // Buffer field status flags casacore::Bool polyTypeOK_p; casacore::Bool polyModeOK_p; casacore::Bool scaleFactorOK_p; casacore::Bool nPolyAmpOK_p; casacore::Bool nPolyPhaseOK_p; casacore::Bool polyCoeffAmpOK_p; casacore::Bool polyCoeffPhaseOK_p; casacore::Bool phaseUnitsOK_p; }; // // TJonesSplineMBuf: TJonesSpline calibration main table buffer // // // // //
  • CalMainBuffer module //
  • SolvableVisJonesMBuf module //
  • TJonesMBuf module //
  • TJonesPolyMBuf module // // // // From "TJonesSpline matrix", "cal main table" and "buffer" // // // // The TJonesSplineMBuf class holds a buffer, optionally connected to a // TJonesSpline calibration main table iterator (of base type CalIterBase). // The TJonesSpline matrix contains atmospheric gain terms expressed as // as spline polynomials over time. // // // // // // // // // Encapsulate TJonesSpline calibration main table data buffers. // // // // (i) Deal with non-standard columns. // class TJonesSplineMBuf : public TJonesPolyMBuf { public: // Default constructor. No connection to an underlying // calibration table iterator in this case. TJonesSplineMBuf(); // Construct from a set of calibration buffer indices and // their specified values. Non-index columns will be set // to default values, and there is no connection to an // underlying calibration table iterator in this case. TJonesSplineMBuf (const casacore::Vector& calIndices, const casacore::Block >& indexValues); // Construct from a calibration table iterator. The calibration // buffer will remain synchronized with the iterator. TJonesSplineMBuf (CalIterBase& calIter); // Invalidate the current calibration buffer. This signals // that a re-read is required as the iterator has advanced virtual void invalidate(); // Write the current buffer at the end of a specified cal table virtual casacore::Int append (CalTable& calTable); // Maximum number of rows in the calibration buffer virtual casacore::Int nRow(); // Update the parametrized solution in each of a set of buffer rows virtual casacore::Bool fillMatchingRows (const casacore::Vector& matchingRows, const casacore::String& sFreqGrpName, const casacore::String& sPolyType, const casacore::String& sPolyMode, const casacore::Complex& sScaleFactor, const casacore::Int& sNPolyAmp, const casacore::Int& sNPolyPhase, const casacore::Vector& sPolyCoeffAmp, const casacore::Vector& sPolyCoeffPhase, const casacore::String& sPhaseUnits, const casacore::Int& sNKnotsAmp, const casacore::Int& sNKnotsPhase, const casacore::Vector& sSplineKnotsAmp, const casacore::Vector& sSplineKnotsPhase, const casacore::MFrequency& sRefFreq, const casacore::Int& sRefAnt); // casacore::Data field accessors virtual casacore::Vector& nKnotsAmp(); virtual casacore::Vector& nKnotsPhase(); virtual casacore::Array& splineKnotsAmp(); virtual casacore::Array& splineKnotsPhase(); protected: // Factory method to create a columns accessor object of the // appropriate type virtual TJonesSplineMCol* newCalMainCol (CalTable& calTable) { return new TJonesSplineMCol(dynamic_cast(calTable));}; // Access to the columns accessor object virtual TJonesSplineMCol* calMainCol() {return dynamic_cast(CalMainBuffer::calMainCol());}; // // Fill the TJonesSpline cal buffer attribute columns in an empty // cal buffer, to extend the inherited method fillAttributes. The // cal indices, specified as enums from class MSCalEnums, are excluded // as non-attribute columns. // // Use a visibility buffer to define the attribute values (NYI) virtual void fillAttributes(const casacore::Vector& /*calIndices*/, const VisBuffer& /*vb*/) {}; // // Set default attribute values virtual void fillAttributes(const casacore::Vector& calIndices); // private: // Buffer fields casacore::Vector nKnotsAmp_p; casacore::Vector nKnotsPhase_p; casacore::Array splineKnotsAmp_p; casacore::Array splineKnotsPhase_p; // Buffer field status flags casacore::Bool nKnotsAmpOK_p; casacore::Bool nKnotsPhaseOK_p; casacore::Bool splineKnotsAmpOK_p; casacore::Bool splineKnotsPhaseOK_p; }; } //# NAMESPACE CASA - END #endif