casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BPoly.h
Go to the documentation of this file.
1 //# BJonesPoly.h: A bandpass visibility Jones matrix of polynomial form
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be adressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id: BJonesPoly.h,v 19.9 2004/11/30 17:50:47 ddebonis Exp $
28 
29 #ifndef SYNTHESIS_BPOLY_H
30 #define SYNTHESIS_BPOLY_H
31 
34 
35 namespace casa { //# NAMESPACE CASA - BEGIN
36 
37 // <summary> A bandpass visibility Jones matrix of polynomial form
38 // </summary>
39 
40 // <use visibility=export>
41 
42 // <reviewed reviewer="" date="" tests="" demos="">
43 
44 // <prerequisite>
45 // <li> <linkto module="BJones">BJones</linkto> module
46 // </prerequisite>
47 //
48 // <etymology>
49 // BJonesPoly describes a bandpass visibility Jones matrix of
50 // polynomial form.
51 // </etymology>
52 //
53 // <synopsis>
54 //
55 // See <linkto class="VisEquation">VisEquation</linkto> for definition of the
56 // Visibility Measurement Equation.
57 //
58 // The elements of BJonesPoly are only non-zero on the diagonal.
59 //
60 // </synopsis>
61 //
62 // <motivation>
63 // Support polynomial bandpass calibration.
64 // </motivation>
65 //
66 // <todo asof="02/02/01">
67 // i) Support solution intervals
68 // </todo>
69 
70 class VisEquation;
71 class VisBuffGroupAcc;
72 
73 class BJonesPoly : public BJones {
74 public:
75 
76  // Construct from a visibility data set
77  BJonesPoly (VisSet& vs);
78 
79  // Construct from a MSMetaInfoForCal
81 
82  // Destructor
83  virtual ~BJonesPoly() {};
84 
85  // Return the type enum
86  virtual Type type() { return VisCal::B; };
87 
88  // Return type name as string
89  virtual casacore::String typeName() { return "BPOLY"; };
90  virtual casacore::String longTypeName() { return "B Jones Poly (bandpass)"; };
91 
92  // BPOLY gathers generically...
93  virtual casacore::Bool useGenericGatherForSolve() { return true; };
94  // ...then solves for itself per solution:
95  virtual casacore::Bool useGenericSolveOne() { return false; };
96 
97  // Type of Jones matrix according to nPar()
99 
100  // Set the solver parameters
101  using BJones::setSolve;
102  virtual void setSolve(const casacore::Record& solvepar);
103 
104  // Set the interpolation parameters
105  using BJones::setApply;
106  virtual void setApply(const casacore::Record& applypar);
107 
108  // Solve
109  // (old self-directed gather and solve)
110  // virtual void selfGatherAndSolve(VisSet& vs, VisEquation& ve);
111  // (new per-solution self-solving inside generic gather)
112  virtual void selfSolveOne(VisBuffGroupAcc& vbga);
113 
114 
115 protected:
116 
117  // BPOLY has two trivial casacore::Complex parameter (formed at fill)
118  virtual casacore::Int nPar() { return 2; };
119 
120  // Calculate current parameters
121  virtual void calcPar();
122 
123  virtual void loadMemCalTable (casacore::String applyTable,casacore::String field);
124 
125 private:
126 
127  // The underlying VisSet
129 
130  // Private variables containing the solver parameters
135 
136  // Derived solver parameters
137  // Center mask half width (in channels)
139  // Fractional edge mask
141 
142  // Some meta info
146 
147  // CalDescId per spw
149 
150  // Determine if a given channel is masked
151  casacore::Bool maskedChannel (const casacore::Int& chan, const casacore::Int& nChan);
152 
153  // Update the output calibration table to include the
154  // current solution parameters
156  const casacore::Vector<casacore::Int>& antennaId,
157  const casacore::Vector<casacore::String>& polyType,
158  const casacore::Vector<casacore::Complex>& scaleFactor,
159  const casacore::Matrix<casacore::Double>& validDomain,
160  const casacore::Matrix<casacore::Double>& polyCoeffAmp,
161  const casacore::Matrix<casacore::Double>& polyCoeffPhase,
162  const casacore::Vector<casacore::String>& phaseUnits,
163  const casacore::Vector<casacore::Complex>& sideBandRef,
165  const casacore::Vector<casacore::Int>& refAnt);
166 
167  // Compute a casacore::Chebyshev polynomial using the CLIC library
169  const casacore::Double& xfinal, const casacore::Double& x);
170 
171  // Load bandpass parameters from a calibration table and
172  // pre-compute the corrections (and their inverse)
173  // void load (const casacore::String& applyTable);
174 
175  // Utility function to return the bandwidth-weighted average
176  // frequency for a set of spectral window id.'s
178 
179  // Utility function to return the frequency group name for a given spw. id.
181 
182  // Utility function to return the spw id.'s in a given freq. group
184 
185  // Utility function to return the frequency axis for a given spw. id.
187 
189  const casacore::Matrix<casacore::Double>& ampdata,
190  const casacore::Matrix<casacore::Double>& phadata,
191  const casacore::Matrix<casacore::Double>& wtdata,
195 
196 };
197 
198 
199 } //# NAMESPACE CASA - END
200 
201 #endif
int Int
Definition: aipstype.h:50
casacore::Bool visnorm_p
Definition: BPoly.h:132
virtual casacore::Int nPar()
BPOLY has two trivial casacore::Complex parameter (formed at fill)
Definition: BPoly.h:118
casacore::Double meanFrequency(const casacore::Vector< casacore::Int > &spwids)
Load bandpass parameters from a calibration table and pre-compute the corrections (and their inverse)...
casacore::Bool maskedChannel(const casacore::Int &chan, const casacore::Int &nChan)
Determine if a given channel is masked.
virtual casacore::String longTypeName()
Definition: BPoly.h:90
virtual casacore::Bool useGenericGatherForSolve()
BPOLY gathers generically...
Definition: BPoly.h:93
casacore::Vector< casacore::Int > spwIdsInGroup(const casacore::String &freqGrpName)
Utility function to return the spw id.
virtual casacore::String typeName()
Return type name as string.
Definition: BPoly.h:89
virtual Type type()
Return the type enum.
Definition: BPoly.h:86
void updateCalTable(const casacore::String &freqGrpName, const casacore::Vector< casacore::Int > &antennaId, const casacore::Vector< casacore::String > &polyType, const casacore::Vector< casacore::Complex > &scaleFactor, const casacore::Matrix< casacore::Double > &validDomain, const casacore::Matrix< casacore::Double > &polyCoeffAmp, const casacore::Matrix< casacore::Double > &polyCoeffPhase, const casacore::Vector< casacore::String > &phaseUnits, const casacore::Vector< casacore::Complex > &sideBandRef, const casacore::Vector< casacore::MFrequency > &refFreq, const casacore::Vector< casacore::Int > &refAnt)
Update the output calibration table to include the current solution parameters.
casacore::Int maskcenterHalf_p
Derived solver parameters Center mask half width (in channels)
Definition: BPoly.h:138
virtual void setApply()
Set the application parameters.
casacore::Double & refFreq()
Definition: VisCal.h:259
casacore::Double getChebVal(const casacore::Vector< casacore::Double > &coeff, const casacore::Double &xinit, const casacore::Double &xfinal, const casacore::Double &x)
Compute a casacore::Chebyshev polynomial using the CLIC library.
virtual void loadMemCalTable(casacore::String applyTable, casacore::String field)
void plotsolve2(const casacore::Vector< casacore::Double > &x, const casacore::Matrix< casacore::Double > &ampdata, const casacore::Matrix< casacore::Double > &phadata, const casacore::Matrix< casacore::Double > &wtdata, const casacore::Vector< casacore::Int > &ant1idx, const casacore::Vector< casacore::Int > &ant2idx, const casacore::Vector< casacore::Double > &amperr, casacore::Matrix< casacore::Double > &ampcoeff, const casacore::Vector< casacore::Double > &phaerr, casacore::Matrix< casacore::Double > &phacoeff)
virtual ~BJonesPoly()
Destructor.
Definition: BPoly.h:83
Type
Allowed types of VisCal matrices - &#39;correct&#39; order enum Type{UVMOD,Mf,M,K,B,G,D,C,E,P,T,EP,F}; enum Type{Test=0,ANoise,M,KAntPos,K,B,G,J,D,X,C,P,E,T,F,A,ALL};.
Definition: VisCal.h:62
double Double
Definition: aipstype.h:55
virtual casacore::Bool useGenericSolveOne()
...then solves for itself per solution:
Definition: BPoly.h:95
virtual void calcPar()
Calculate current parameters.
VisSet * vs_p
The underlying VisSet.
Definition: BPoly.h:128
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Double solTimeStamp
Some meta info.
Definition: BPoly.h:143
float Float
Definition: aipstype.h:54
A class to group separately averaged VisBuffers.
casacore::Int solSpwId
Definition: BPoly.h:144
BJonesPoly(VisSet &vs)
Construct from a visibility data set.
casacore::Vector< casacore::Double > freqAxis(const casacore::Int &spwId)
Utility function to return the frequency axis for a given spw.
const MSMetaInfoForCal & msmc() const
Access to the MSMetaInfoForCal (throws if none)
Definition: VisCal.h:338
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::String freqGrpName(const casacore::Int &spwId)
Utility function to return the frequency group name for a given spw.
casacore::Float maskedgeFrac_p
Fractional edge mask.
Definition: BPoly.h:140
virtual void setSolve()
Set the solving parameters.
virtual Jones::JonesType jonesType()
Type of Jones matrix according to nPar()
Definition: BPoly.h:98
BJones (freq-dep GJones)
casacore::Vector< casacore::Int > calDescId_p
CalDescId per spw.
Definition: BPoly.h:148
virtual void selfSolveOne(VisBuffGroupAcc &vbga)
Solve (old self-directed gather and solve) virtual void selfGatherAndSolve(VisSet&amp; vs...
casacore::Int degamp_p
Private variables containing the solver parameters.
Definition: BPoly.h:131
casacore::Float maskedge_p
Definition: BPoly.h:134
casacore::Int degphase_p
Definition: BPoly.h:131
casacore::Int maskcenter_p
Definition: BPoly.h:133
casacore::Int solFldId
Definition: BPoly.h:145