//# BJonesPoly.h: A bandpass visibility Jones matrix of polynomial form //# Copyright (C) 1996,1997,1998,1999,2000,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: BJonesPoly.h,v 19.9 2004/11/30 17:50:47 ddebonis Exp $ #ifndef SYNTHESIS_BPOLY_H #define SYNTHESIS_BPOLY_H #include #include namespace casa { //# NAMESPACE CASA - BEGIN // A bandpass visibility Jones matrix of polynomial form // // // // //
  • BJones module // // // // BJonesPoly describes a bandpass visibility Jones matrix of // polynomial form. // // // // // See VisEquation for definition of the // Visibility Measurement Equation. // // The elements of BJonesPoly are only non-zero on the diagonal. // // // // // Support polynomial bandpass calibration. // // // // i) Support solution intervals // class VisEquation; class VisBuffGroupAcc; class BJonesPoly : public BJones { public: // Construct from a visibility data set BJonesPoly (VisSet& vs); // Construct from a MSMetaInfoForCal BJonesPoly (const MSMetaInfoForCal& msmc); // Destructor virtual ~BJonesPoly() {}; // Return the type enum virtual Type type() { return VisCal::B; }; // Return type name as string virtual casacore::String typeName() { return "BPOLY"; }; virtual casacore::String longTypeName() { return "B Jones Poly (bandpass)"; }; // BPOLY gathers generically... virtual casacore::Bool useGenericGatherForSolve() { return true; }; // ...then solves for itself per solution: virtual casacore::Bool useGenericSolveOne() { return false; }; // Type of Jones matrix according to nPar() virtual Jones::JonesType jonesType() { return Jones::Diagonal; }; // Set the solver parameters using BJones::setSolve; virtual void setSolve(const casacore::Record& solvepar); // Set the interpolation parameters using BJones::setApply; virtual void setApply(const casacore::Record& applypar); // Solve // (old self-directed gather and solve) // virtual void selfGatherAndSolve(VisSet& vs, VisEquation& ve); // (new per-solution self-solving inside generic gather) virtual void selfSolveOne(VisBuffGroupAcc& vbga); protected: // BPOLY has two trivial casacore::Complex parameter (formed at fill) virtual casacore::Int nPar() { return 2; }; // Calculate current parameters virtual void calcPar(); virtual void loadMemCalTable (casacore::String applyTable,casacore::String field); private: // The underlying VisSet VisSet* vs_p; // Private variables containing the solver parameters casacore::Int degamp_p, degphase_p; casacore::Bool visnorm_p; casacore::Int maskcenter_p; casacore::Float maskedge_p; // Derived solver parameters // Center mask half width (in channels) casacore::Int maskcenterHalf_p; // Fractional edge mask casacore::Float maskedgeFrac_p; // Some meta info casacore::Double solTimeStamp; casacore::Int solSpwId; casacore::Int solFldId; // CalDescId per spw casacore::Vector calDescId_p; // Determine if a given channel is masked casacore::Bool maskedChannel (const casacore::Int& chan, const casacore::Int& nChan); // Update the output calibration table to include the // current solution parameters void updateCalTable (const casacore::String& freqGrpName, const casacore::Vector& antennaId, const casacore::Vector& polyType, const casacore::Vector& scaleFactor, const casacore::Matrix& validDomain, const casacore::Matrix& polyCoeffAmp, const casacore::Matrix& polyCoeffPhase, const casacore::Vector& phaseUnits, const casacore::Vector& sideBandRef, const casacore::Vector& refFreq, const casacore::Vector& refAnt); // Compute a casacore::Chebyshev polynomial using the CLIC library casacore::Double getChebVal (const casacore::Vector& coeff, const casacore::Double& xinit, const casacore::Double& xfinal, const casacore::Double& x); // Load bandpass parameters from a calibration table and // pre-compute the corrections (and their inverse) // void load (const casacore::String& applyTable); // Utility function to return the bandwidth-weighted average // frequency for a set of spectral window id.'s casacore::Double meanFrequency (const casacore::Vector& spwids); // Utility function to return the frequency group name for a given spw. id. casacore::String freqGrpName (const casacore::Int& spwId); // Utility function to return the spw id.'s in a given freq. group casacore::Vector spwIdsInGroup (const casacore::String& freqGrpName); // Utility function to return the frequency axis for a given spw. id. casacore::Vector freqAxis (const casacore::Int& spwId); void plotsolve2(const casacore::Vector& x, const casacore::Matrix& ampdata, const casacore::Matrix& phadata, const casacore::Matrix& wtdata, const casacore::Vector& ant1idx, const casacore::Vector& ant2idx, const casacore::Vector& amperr, casacore::Matrix& ampcoeff, const casacore::Vector& phaerr, casacore::Matrix& phacoeff) ; }; } //# NAMESPACE CASA - END #endif