casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LJJones.h
Go to the documentation of this file.
1 //# LJJones.h: Declaration of LJJones (Solvable)VisCal type
2 //# Copyright (C) 1996,1997,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 
28 #ifndef SYNTHESIS_LJJONES_H
29 #define SYNTHESIS_LJJONES_H
30 
31 #include <casa/aips.h>
32 #include <casa/Containers/Record.h>
33 #include <casa/BasicSL/Complex.h>
35 //#include <synthesis/MeasurementComponents/nPBWProjectFT.h>
42 #include <msvis/MSVis/VisSet.h>
44 #include <casa/OS/Timer.h>
46 namespace casa { //# NAMESPACE CASA - BEGIN
47 
48 // Forward declaration
49 class VisEquation;
50 class nPBWProjectFT;
51 
52 // **********************************************************
53 // LJJones (pointing errors)
54 //
55 
56 class LJJones : public SolvableVisJones {
57 public:
58 
59  // Constructor
60  LJJones(VisSet& vs);
61  // {throw(casacore::AipsError("Use the constructor LJJones(VisSet&, MeasurementSet&) instead"));};
63  // LJJones(const casacore::Int& nAnt); // NYI
64 
65  virtual ~LJJones();
66 
67  // Return the type enum
68  virtual Type type() { return VisCal::E; };
69 
70  // Return type name as string
71  virtual casacore::String typeName() { return "LJ Jones"; };
72  virtual casacore::String longTypeName() { return "LeakyJ Jones"; };
73  // Frequency-dependent Parameters? Nominally not.
74  virtual casacore::Bool freqDepPar() { return false; };
75 
76  // Type of Jones matrix according to nPar()
78 
80 
81  // Specialized access to pointing parameters (no chan axis)
83 
84  virtual void setModel(const casacore::String& modelImage);
85  // Set the solving parameters
86  virtual void setSolve();
87  virtual void setSolve(const casacore::Record& solve);
88  virtual void setNiter(const casacore::Int& niter) {niter_p=niter;}
89  virtual void setTolerance(const casacore::Float& tol) {tolerance_p = tol;}
90  virtual void setGain(const casacore::Float& gain) {gain_p = gain;}
91 
92  // Arrange to apply (corrupt only)
94  virtual void setApply(const casacore::Record& applypar);
95 
96  // Apply calibration to a VisBuffer
97  virtual void applyCal(VisBuffer& vb,
99 
100  // Differentiate a VisBuffer w.r.t. pointng parameters
101  //
102  // These effectively compute residuals and derivatives for
103  // a time-averaged VisBuffer
104  //
105  virtual void differentiate(VisBuffer& vb,
109  // Differentiate a VisBuffer w.r.t. pointng parameters
110  virtual void differentiate(VisBuffer& vb,
111  VisBuffer& dvb0,
112  VisBuffer& dvb1,
114  //
115  // This one averages the residuals and the derivatives in time.
116  //
117  virtual void diffResiduals(VisIter& vi, VisEquation& ve,
118  VisBuffer& residuals,
119  VisBuffer& dVr1,
120  VisBuffer& dVr2,
122  // Guess (throws error because we don't yet solve for this)
123  virtual void guessPar(VisBuffer& vb);
124  virtual void guessPar() {pointPar_=0;}
125 
128  virtual void setRPar(casacore::Double val) {pointPar_=val;}
129 
130  // virtual void keep(const casacore::Int& slot);
131 
132  virtual casacore::Bool normalizable() { return false; };
133 
134  // virtual BaseCalSet& cs() {return *cs_;};
135  virtual void keep(const casacore::Int& slot);
136 
137  inline virtual CalSet<casacore::Complex>& cs() {return *cs_;};
138 
139  virtual void inflate(const casacore::Vector<casacore::Int>& nChan,
141  const casacore::Vector<casacore::Int>& nSlot);
142  void initSolve(VisSet& vs);
143  void initSolvePar();
144  void store();
145  void store(const casacore::String& table,const casacore::Bool& append);
147  virtual void postSolveMassage(const VisBuffer&);
148  virtual void selfGatherAndSolve(VisSet& vs,VisEquation& ve);
149  virtual casacore::Bool useGenericGatherForSolve() { return false; };
150  virtual casacore::Float printFraction(const casacore::Int& /*nSlots*/) {return 0.1;};
154  void printRPar();
155 
157  void getAvgVB(VisIter& vi, VisEquation& ve, VisBuffer& vb);
158 protected:
159 
160  // EP has a pair of real parameters per feed
161  virtual casacore::Int nPar() { return 4; };
162 
163  // Jones matrix elements are NOT trivial
164  virtual casacore::Bool trivialJonesElem() { return false; };
165 
166  // Fill-in a complex grid with the image values in prepration for
167  // computing it's FT
170  VisBuffer& vb);
171  void printActivity(const casacore::Int slotNo, const casacore::Int fieldId, const casacore::Int spw, const casacore::Int nSolutions);
172  // inline virtual CalSet<casacore::Float> cs() {return *cs_;}
173 
174  void reformVisibilities(const VisBuffer& vb, const casacore::Int whichChan, const casacore::Int whichPol,
176 
178 private:
179 
180  // Local casacore::Matrix for referencing pointing pars in a convenient way
183 // casacore::MeasurementSet *ms_p;
185  // casacore::Array<casacore::Float> azOff, elOff;
194 };
195 
196 
197 
198 
199 
200 } //# NAMESPACE CASA - END
201 
202 #endif
203 
virtual void setRPar(casacore::Double val)
Definition: LJJones.h:128
int Int
Definition: aipstype.h:50
virtual void setSolve()
Set the solving parameters.
virtual void setModel(const casacore::String &modelImage)
Jones::JonesType jonesType()
Type of Jones matrix according to nPar()
Definition: LJJones.h:77
casacore::Float tolerance_p
Definition: LJJones.h:191
virtual ~LJJones()
LJJones(const casacore::Int&amp; nAnt); // NYI.
virtual void postSolveMassage(const VisBuffer &)
casacore::TempImage< casacore::Complex > targetVisModel_
casacore::Array&lt;casacore::Float&gt; azOff, elOff;
Definition: LJJones.h:186
virtual casacore::Cube< casacore::Complex > & solvePar()
Definition: LJJones.h:126
virtual Type type()
Return the type enum.
Definition: LJJones.h:68
const IPosition & shape() const
The length of each axis of the cube.
Definition: Cube.h:292
casacore::Array< T > & par(const casacore::Int &spw)
Definition: CalSet.h:125
casacore::Double maxTimePerSolution
Definition: LJJones.h:188
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
Definition: PlotTool.h:43
virtual void setTolerance(const casacore::Float &tol)
Definition: LJJones.h:89
virtual casacore::Bool trivialJonesElem()
Jones matrix elements are NOT trivial.
Definition: LJJones.h:164
virtual void diffResiduals(VisIter &vi, VisEquation &ve, VisBuffer &residuals, VisBuffer &dVr1, VisBuffer &dVr2, casacore::Matrix< casacore::Bool > &flags)
This one averages the residuals and the derivatives in time.
casacore::Cube< casacore::Complex > pointPar_
Local casacore::Matrix for referencing pointing pars in a convenient way.
Definition: LJJones.h:181
virtual void inflate(const casacore::Vector< casacore::Int > &nChan, const casacore::Vector< casacore::Int > &startChan, const casacore::Vector< casacore::Int > &nSlot)
Inflate the pristine CalSet (generically)
void nearest(const casacore::Double time, casacore::Array< casacore::Complex > &vals)
virtual void setNiter(const casacore::Int &niter)
Definition: LJJones.h:88
virtual void setApply()
Set the application parameters.
virtual casacore::Bool freqDepPar()
Frequency-dependent Parameters? Nominally not.
Definition: LJJones.h:74
casacore::Double avgTimePerSolution
Definition: LJJones.h:188
virtual void makeComplexGrid(casacore::TempImage< casacore::Complex > &Grid, casacore::PagedImage< casacore::Float > &ModelImage, VisBuffer &vb)
Fill-in a complex grid with the image values in prepration for computing it&#39;s FT. ...
virtual casacore::Int nPar()
EP has a pair of real parameters per feed.
Definition: LJJones.h:161
casacore::Array< casacore::Double > getTime(const casacore::Int &spw)
Definition: LJJones.h:152
casacore::Double minTimePerSolution
Definition: LJJones.h:188
casacore::Int & startChan()
Definition: VisCal.h:264
casacore::Int niter_p
Definition: LJJones.h:192
void printActivity(const casacore::Int slotNo, const casacore::Int fieldId, const casacore::Int spw, const casacore::Int nSolutions)
GridFT * pbwp_p
Definition: LJJones.h:182
void initSolve(VisSet &vs)
virtual void guessPar()
Definition: LJJones.h:124
virtual VisCalEnum::VCParType setParType(VisCalEnum::VCParType type)
CalSet< casacore::Complex > * cs_
Definition: LJJones.h:187
void initSolvePar()
Initialize solve parameter shape Jones version: (nPar(),1,nAnt()) (one chan, all antennas) ...
casacore::Bool & append()
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
void resize(size_t nx, size_t ny, size_t nz, Bool copyValues=False)
Definition: Cube.h:138
casacore::Float gain_p
Definition: LJJones.h:191
virtual CalSet< casacore::Complex > & cs()
Definition: LJJones.h:137
LJJones (pointing errors)
Definition: LJJones.h:56
casacore::Vector< casacore::Int > polMap_p
Definition: LJJones.h:190
casacore::Timer timer
Definition: LJJones.h:189
void setByPassMode(casacore::Int &b)
Definition: LJJones.h:156
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::Int getRefAnt(const casacore::Array< casacore::Float > &visWts)
void printRPar()
measure the time it takes to execute parts of a program
Definition: Timer.h:127
casacore::Array< casacore::Complex > getOffsets(const casacore::Int &spw)
Definition: LJJones.h:151
float Float
Definition: aipstype.h:54
virtual void differentiate(VisBuffer &vb, casacore::Cube< casacore::Complex > &Mout, casacore::Array< casacore::Complex > &dMout, casacore::Matrix< casacore::Bool > &Mflg)
Differentiate a VisBuffer w.r.t.
An FTMachine for Gridded Fourier transforms.
Definition: GridFT.h:127
casacore::Cube< casacore::Complex > & loadPar()
Specialized access to pointing parameters (no chan axis)
casacore::Int byPass_p
Definition: LJJones.h:192
A Table intended to hold astronomical data (a set of Measurements).
virtual void setGain(const casacore::Float &gain)
Definition: LJJones.h:90
void reformVisibilities(const VisBuffer &vb, const casacore::Int whichChan, const casacore::Int whichPol, casacore::Array< casacore::Complex > &visArray, casacore::Array< casacore::Float > &visWts)
inline virtual CalSet&lt;casacore::Float&gt; cs() {return *cs_;}
virtual casacore::Bool useGenericGatherForSolve()
Report if calibration available for specified spw (if no CalInterp available, assume true) ...
Definition: LJJones.h:149
casacore::String modelImageName_p
Definition: LJJones.h:193
LJJones(VisSet &vs)
Constructor.
virtual casacore::String typeName()
Return type name as string.
Definition: LJJones.h:71
virtual void setRPar(casacore::Cube< casacore::Complex > &val)
Definition: LJJones.h:127
SolvableVisJones
casacore::Bool verifyForSolve(VisBuffer &vb)
casacore::Vector< T > solve(const casacore::Matrix< T > &A, const casacore::Vector< T > &y, double &ferr, double &berr)
Given a matrix &quot;A&quot;, and given some vector &quot;y&quot; which is the right hand side of the equation &quot;Ax=y&quot;...
String: the storage and methods of handling collections of characters.
Definition: String.h:223
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
virtual casacore::String longTypeName()
Definition: LJJones.h:72
VisibilityIterator iterates through one or more writable MeasurementSets.
virtual void selfGatherAndSolve(VisSet &vs, VisEquation &ve)
Self- gather and/or solve prototypes (triggered by useGenericGatherForSolve=F or useGenericSolveOne=F...
virtual VisCalEnum::VCParType parType()
Return the parameter type (nominally complex)
Definition: LJJones.h:79
VisSet * vs_p
casacore::MeasurementSet *ms_p;
Definition: LJJones.h:184
virtual void keep(const casacore::Int &slot)
virtual BaseCalSet&amp; cs() {return *cs_;};
void getAvgVB(VisIter &vi, VisEquation &ve, VisBuffer &vb)
casacore::Vector< casacore::Double > & time(const casacore::Int &spw)
Definition: CalSet.h:121
virtual casacore::Float printFraction(const casacore::Int &)
Definition: LJJones.h:150
virtual casacore::Bool normalizable()
virtual void keep(const casacore::Int&amp; slot);
Definition: LJJones.h:132
virtual void applyCal(VisBuffer &vb, casacore::Cube< casacore::Complex > &Mout)
Apply calibration to a VisBuffer.