casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Go to the documentation of this file.
1 //# EPJones.h: Declaration of EPJones (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:
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
31 #include <casa/aips.h>
32 #include <casa/Containers/Record.h>
33 #include <casa/BasicSL/Complex.h>
42 #include <msvis/MSVis/VisSet.h>
44 #include <casa/OS/Timer.h>
45 namespace casa { //# NAMESPACE CASA - BEGIN
47 // Forward declaration
48  class VisEquation;
49  class nPBWProjectFT;
50  class PBMosaicFT;
52 // **********************************************************
53 // EPJones (pointing errors)
54 //
56 class EPJones : public SolvableVisJones {
57 public:
59  // Constructor
60  EPJones(VisSet& vs);
61  // {throw(casacore::AipsError("Use the constructor EPJones(VisSet&, MeasurementSet&) instead"));};
63  // EPJones(const casacore::Int& nAnt); // NYI
65  virtual ~EPJones();
67  // Return the type enum
68  virtual Type type() { return VisCal::E; };
70  // Return type name as string
71  virtual casacore::String typeName() { return "EP Jones"; };
72  virtual casacore::String longTypeName() { return "EP Jones (pointing errors)"; };
74  // Type of Jones matrix according to nPar()
79  // Specialized access to pointing parameters (no chan axis)
82  virtual void setModel(const casacore::String& modelImage);
83  // Set the solving parameters
84  virtual void setSolve();
85  virtual void setSolve(const casacore::Record& solve);
86  virtual void setNiter(const casacore::Int& niter) {niter_p=niter;}
87  virtual void setTolerance(const casacore::Float& tol) {tolerance_p = tol;}
88  virtual void setGain(const casacore::Float& gain) {gain_p = gain;}
90  // Arrange to apply (corrupt only)
92  virtual void setApply(const casacore::Record& applypar);
94  // Apply calibration to a VisBuffer
95  virtual void applyCal(VisBuffer& vb,
98  // Differentiate a VisBuffer w.r.t. pointng parameters
99  //
100  // These effectively compute residuals and derivatives for
101  // a time-averaged VisBuffer
102  //
103  virtual void differentiate(VisBuffer& vb,
107  // Differentiate a VisBuffer w.r.t. pointng parameters
108  virtual void differentiate(VisBuffer& vb,
109  VisBuffer& dvb0,
110  VisBuffer& dvb1,
112  //
113  // This one averages the residuals and the derivatives in time.
114  //
115  virtual void diffResiduals(VisIter& vi, VisEquation& ve,
116  VisBuffer& residuals,
117  VisBuffer& dVr1,
118  VisBuffer& dVr2,
120  // Guess (throws error because we don't yet solve for this)
121  virtual void guessPar(VisBuffer& vb);
122  virtual void guessPar() {pointPar_=0;}
126  virtual void setRPar(casacore::Double val) {pointPar_=val;}
128  // virtual void keep(const casacore::Int& slot);
130  virtual casacore::Bool normalizable() { return false; };
132  // virtual BaseCalSet& cs() {return *rcs_;};
133  virtual void keep(const casacore::Int& slot);
135  inline virtual CalSet<casacore::Float>& rcs() {return *rcs_;};
137  virtual void inflate(const casacore::Vector<casacore::Int>& nChan,
139  const casacore::Vector<casacore::Int>& nSlot);
140  void initSolve(VisSet& vs);
141  void initSolvePar();
142  void store();
143  void store(const casacore::String& table,const casacore::Bool& append);
145  virtual void postSolveMassage(const VisBuffer&);
146  virtual void selfGatherAndSolve(VisSet& vs,VisEquation& ve);
147  virtual casacore::Bool useGenericGatherForSolve() { return false; };
148  virtual casacore::Float printFraction(const casacore::Int& ) {return 0.1;};
152  void printRPar();
154 protected:
156  // EP has a pair of real parameters per feed
157  virtual casacore::Int nPar() { return 4; };
159  // Jones matrix elements are NOT trivial
160  virtual casacore::Bool trivialJonesElem() { return false; };
162  // Fill-in a complex grid with the image values in prepration for
163  // computing it's FT
166  VisBuffer& vb);
167  void printActivity(const casacore::Int slotNo, const casacore::Int fieldId, const casacore::Int spw, const casacore::Int nSolutions);
168  // inline virtual CalSet<casacore::Float> rcs() {return *cs_;}
170 private:
172  // Local casacore::Matrix for referencing pointing pars in a convenient way
175  // PBMosaicFT *pbwp_p;
176  //casacore::MeasurementSet *ms_p;
178  // casacore::Array<casacore::Float> azOff, elOff;
186 };
194 #endif
VisSet * vs_p
PBMosaicFT *pbwp_p; casacore::MeasurementSet *ms_p;
Definition: EPJones.h:177
casacore::Vector< casacore::Int > polMap_p
Definition: EPJones.h:183
CalSet< casacore::Float > * rcs_
Definition: EPJones.h:180
casacore::Bool verifyForSolve(VisBuffer &vb)
int Int
Definition: aipstype.h:50
casacore::Cube< casacore::Float > pointPar_
inline virtual CalSet&lt;casacore::Float&gt; rcs() {return *cs_;}
Definition: EPJones.h:173
virtual void setTolerance(const casacore::Float &tol)
Definition: EPJones.h:87
casacore::Array< casacore::Double > getTime(const casacore::Int &spw)
Definition: EPJones.h:150
virtual Type type()
Return the type enum.
Definition: EPJones.h:68
casacore::Double minTimePerSolution
Definition: EPJones.h:181
virtual void setRPar(casacore::Double val)
Definition: EPJones.h:126
void initSolve(VisSet &vs)
EPJones (pointing errors)
Definition: EPJones.h:56
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
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
casacore::Double avgTimePerSolution
Definition: EPJones.h:181
casacore::Double maxTimePerSolution
Definition: EPJones.h:181
virtual casacore::String longTypeName()
Definition: EPJones.h:72
Jones::JonesType jonesType()
Type of Jones matrix according to nPar()
Definition: EPJones.h:75
virtual void setApply()
Set the application parameters.
virtual void guessPar()
Definition: EPJones.h:122
casacore::Int & startChan()
Definition: VisCal.h:264
casacore::Timer timer
Definition: EPJones.h:182
virtual casacore::Float printFraction(const casacore::Int &)
Definition: EPJones.h:148
virtual casacore::Int nPar()
EP has a pair of real parameters per feed.
Definition: EPJones.h:157
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 VisCalEnum::VCParType setParType(VisCalEnum::VCParType type)
casacore::TempImage< casacore::Complex > targetVisModel_
casacore::Array&lt;casacore::Float&gt; azOff, elOff;
Definition: EPJones.h:179
virtual void postSolveMassage(const VisBuffer &)
virtual void setGain(const casacore::Float &gain)
Definition: EPJones.h:88
casacore::Bool & append()
virtual void setSolve()
Set the solving parameters.
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
virtual casacore::Bool trivialJonesElem()
Jones matrix elements are NOT trivial.
Definition: EPJones.h:160
nPBWProjectFT * pbwp_p
Definition: EPJones.h:174
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::Array< casacore::Float > getOffsets(const casacore::Int &spw)
Definition: EPJones.h:149
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 printRPar()
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
virtual void applyCal(VisBuffer &vb, casacore::Cube< casacore::Complex > &Mout)
Apply calibration to a VisBuffer.
measure the time it takes to execute parts of a program
Definition: Timer.h:127
float Float
Definition: aipstype.h:54
virtual casacore::Cube< casacore::Float > & solveRPar()
Definition: EPJones.h:124
virtual void keep(const casacore::Int &slot)
virtual BaseCalSet&amp; cs() {return *rcs_;};
virtual ~EPJones()
EPJones(const casacore::Int&amp; nAnt); // NYI.
virtual VisCalEnum::VCParType parType()
Return the parameter type (nominally complex)
Definition: EPJones.h:77
virtual casacore::String typeName()
Return type name as string.
Definition: EPJones.h:71
A Table intended to hold astronomical data (a set of Measurements).
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.
casacore::Cube< casacore::Float > & loadPar()
Specialized access to pointing parameters (no chan axis)
virtual void selfGatherAndSolve(VisSet &vs, VisEquation &ve)
Self- gather and/or solve prototypes (triggered by useGenericGatherForSolve=F or useGenericSolveOne=F...
virtual void setModel(const casacore::String &modelImage)
virtual casacore::Bool normalizable()
virtual void keep(const casacore::Int&amp; slot);
Definition: EPJones.h:130
void printActivity(const casacore::Int slotNo, const casacore::Int fieldId, const casacore::Int spw, const casacore::Int nSolutions)
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
virtual casacore::Bool useGenericGatherForSolve()
Report if calibration available for specified spw (if no CalInterp available, assume true) ...
Definition: EPJones.h:147
virtual void setRPar(casacore::Cube< casacore::Float > &val)
Definition: EPJones.h:125
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
virtual CalSet< casacore::Float > & rcs()
Definition: EPJones.h:135
VisibilityIterator iterates through one or more writable MeasurementSets.
void initSolvePar()
Initialize solve parameter shape Jones version: (nPar(),1,nAnt()) (one chan, all antennas) ...
casacore::Vector< casacore::Double > & time(const casacore::Int &spw)
Definition: CalSet.h:121
casacore::Float tolerance_p
Definition: EPJones.h:184
casacore::Int niter_p
Definition: EPJones.h:185
virtual void setNiter(const casacore::Int &niter)
Definition: EPJones.h:86
void nearest(const casacore::Double time, casacore::Array< casacore::Float > &vals)
EPJones(VisSet &vs)
casacore::Float gain_p
Definition: EPJones.h:184
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.