casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MultiTermFT.h
Go to the documentation of this file.
1 //# MultiTermFT.h: Definition for MultiTermFT
2 //# Copyright (C) 1996,1997,1998,1999,2000,2002
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$
28 
29 #ifndef SYNTHESIS_MULTITERMFT_H
30 #define SYNTHESIS_MULTITERMFT_H
31 
33 #include <casa/Arrays/Matrix.h>
35 #include <msvis/MSVis/VisBuffer.h>
38 #include <casa/Containers/Block.h>
39 #include <casa/Arrays/Array.h>
40 #include <casa/Arrays/Vector.h>
41 #include <casa/Arrays/Matrix.h>
45 //#include <synthesis/MeasurementComponents/SynthesisPeek.h>
46 #include <casa/OS/Timer.h>
47 
48 namespace casacore{
49 
50 class UVWMachine;
51 }
52 
53 namespace casa { //# NAMESPACE CASA - BEGIN
54 
55 
56 class MultiTermFT : public FTMachine {
57 public:
58 
59  // Construct using an existing FT-Machine
60  MultiTermFT(FTMachine *subftm, casacore::String subFTMname, casacore::Int nterms=1, casacore::Double reffreq=0.0);
61 
62  // Construct from a casacore::Record containing the MultiTermFT state
63  MultiTermFT(const casacore::RecordInterface& stateRec);
64 
65  // Copy constructor.
66  // This first calls the default "=" operator, and then instantiates objects for member pointers.
67  MultiTermFT(const MultiTermFT &other);
68 
69  // Assignment operator --- leave it as the default
70  MultiTermFT &operator=(const MultiTermFT &other);
71 
72  // Destructor
73  ~MultiTermFT();
74 
75  // Called at the start of de-gridding : subftm->initializeToVis()
76  // Note : Pre-de-gridding model-image divisions by PBs will go here.
78 
79  // Called at the end of de-gridding : subftm->finalizeToVis()
80  void finalizeToVis();
81 
82  // Called at the start of gridding : subftm->initializeToSky()
84 
85  // Called at the end of gridding : subftm->finalizeToSky()
86  void finalizeToSky();
87 
88  // Do the degridding via subftm->get() and modify model-visibilities by Taylor-weights
89  void get(VisBuffer& vb, casacore::Int row=-1);
90 
91  // Modify imaging weights with Taylor-weights and do gridding via subftm->put()
92  void put(VisBuffer& vb, casacore::Int row=-1, casacore::Bool dopsf=false,
94 
95  // Have a const version for compatibility with other FTMs.. Throw an exception if called.
96  void put(const VisBuffer& /*vb*/, casacore::Int /*row=-1*/, casacore::Bool /*dopsf=false*/,
97  FTMachine::Type /*type=FTMachine::OBSERVED*/)
98  {throw(casacore::AipsError("MultiTermFT::put called with a const vb. This FTM needs to modify the vb."));};
99 
100  // Calculate residual visibilities if possible.
101  // The purpose is to allow rGridFT to make this multi-threaded
102  virtual void ComputeResiduals(VisBuffer&vb, casacore::Bool useCorrected);
103 
104  // Make an image : subftm->makeImage()
106  VisSet& vs,
109 
110  // Get the final image: do the Fourier transform grid-correct, then
111  // optionally normalize by the summed weights
112  // Note : Post-gridding residual-image divisions by PBs will go here.
113  // For now, it just calls subftm->getImage()
115 
116  // Place-holder for possible use with AWProject and AWProjectWB FTMs
118  const casacore::Matrix<casacore::Double>& /*sumOfWts*/,
119  casacore::Lattice<casacore::Float>& /*sensitivityImage*/,
120  casacore::Bool /*fftNorm*/)
121  {throw(casacore::AipsError("MultiTermFT::normalizeImage() is not implemented"));}
122 
123  // Get the final weights image - this will hold PB2
125 
126  // Save and restore the MultiTermFT to and from a record
127  virtual casacore::Bool toRecord(casacore::String& error, casacore::RecordInterface& outRec, casacore::Bool withImage=false, const casacore::String diskimage="");
129 
130  // Various small inline functions
131  virtual casacore::Bool isFourier() {return true;}
132  virtual void setNoPadding(casacore::Bool nopad){subftm_p->setNoPadding(nopad);};
133  virtual casacore::String name() const {return machineName_p;};
134  virtual void setMiscInfo(const casacore::Int qualifier){thisterm_p=qualifier;};
135 
136 protected:
137 
138  // Multiply Imaging weights by Taylor-function weights - during "put"
140  // Multiply model visibilities by Taylor-function weights - during "get"
142  // Restore vb.imagingweights to the original
144  // have to call the initmaps of subftm
145  virtual void initMaps(const VisBuffer& vb);
152 
156 
160 };
161 
162 } //# NAMESPACE CASA - END
163 
164 #endif
virtual void ComputeResiduals(VisBuffer &vb, casacore::Bool useCorrected)
Calculate residual visibilities if possible.
int Int
Definition: aipstype.h:50
casacore::ImageInterface< casacore::Complex > & getImage(casacore::Matrix< casacore::Float > &, casacore::Bool normalize=true)
Get the final image: do the Fourier transform grid-correct, then optionally normalize by the summed w...
casacore::Bool dotime_p
Definition: MultiTermFT.h:157
void finalizeToSky()
Called at the end of gridding : subftm-&gt;finalizeToSky()
casacore::Bool restoreImagingWeights(VisBuffer &vb)
Restore vb.imagingweights to the original.
virtual Type type()
Return the type enum.
casacore::Bool modifyModelVis(VisBuffer &vb)
Multiply model visibilities by Taylor-function weights - during &quot;get&quot;.
~MultiTermFT()
Destructor.
MultiTermFT(FTMachine *subftm, casacore::String subFTMname, casacore::Int nterms=1, casacore::Double reffreq=0.0)
Construct using an existing FT-Machine.
virtual casacore::String name() const
Return the name of the machine.
Definition: MultiTermFT.h:133
casacore::ImageInterface< casacore::Complex > * image
Definition: FTMachine.h:409
casacore::Double sumwt_p
Definition: MultiTermFT.h:154
casacore::Double time_res
Definition: MultiTermFT.h:159
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
casacore::Double reffreq_p
Definition: MultiTermFT.h:151
void put(VisBuffer &vb, casacore::Int row=-1, casacore::Bool dopsf=false, FTMachine::Type type=FTMachine::OBSERVED)
Modify imaging weights with Taylor-weights and do gridding via subftm-&gt;put()
double Double
Definition: aipstype.h:55
casacore::Double time_get
Definition: MultiTermFT.h:159
virtual void setNoPadding(casacore::Bool nopad)
To make sure no padding is used in certain gridders.
Definition: MultiTermFT.h:132
casacore::String subFTMname_p
Definition: MultiTermFT.h:148
casacore::Bool modifyVisWeights(VisBuffer &vb)
Multiply Imaging weights by Taylor-function weights - during &quot;put&quot;.
Type
Types of known Images that may be made using the makeImage method.
Definition: FTMachine.h:125
void finalizeToVis()
Called at the end of de-gridding : subftm-&gt;finalizeToVis()
Converts UVW coordinates between coordinate systems.
Definition: UVWMachine.h:160
casacore::String machineName_p
Definition: MultiTermFT.h:155
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Matrix< casacore::Float > imweights_p
Definition: MultiTermFT.h:153
virtual void normalizeImage(casacore::Lattice< casacore::Complex > &, const casacore::Matrix< casacore::Double > &, casacore::Lattice< casacore::Float > &, casacore::Bool)
Place-holder for possible use with AWProject and AWProjectWB FTMs.
Definition: MultiTermFT.h:117
measure the time it takes to execute parts of a program
Definition: Timer.h:127
void initializeToSky(casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight, const VisBuffer &vb)
Called at the start of gridding : subftm-&gt;initializeToSky()
virtual void setMiscInfo(const casacore::Int qualifier)
set the order of the Taylor term for MFS this is to tell A-casacore::Projection to qualify the accumu...
Definition: MultiTermFT.h:134
casacore::Double time_put
Definition: MultiTermFT.h:159
casacore::Int thisterm_p
Definition: MultiTermFT.h:150
casacore::Bool dbg_p
Definition: MultiTermFT.h:157
casacore::Timer tmr_p
Definition: MultiTermFT.h:158
void makeImage(FTMachine::Type type, VisSet &vs, casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight)
Make an image : subftm-&gt;makeImage()
void put(const VisBuffer &, casacore::Int, casacore::Bool, FTMachine::Type)
Have a const version for compatibility with other FTMs.
Definition: MultiTermFT.h:96
casacore::Int nterms_p
Definition: MultiTermFT.h:149
Base class for all Casacore library errors.
Definition: Error.h:134
virtual casacore::Bool fromRecord(casacore::String &error, const casacore::RecordInterface &inRec)
virtual void initMaps(const VisBuffer &vb)
have to call the initmaps of subftm
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
New MTFT specific internal parameters and functions *casacore::CountedPtr< FTMachine > subftm_p
Definition: MultiTermFT.h:147
MultiTermFT & operator=(const MultiTermFT &other)
Assignment operator — leave it as the default.
Abstract base class for Record classes.
void initializeToVis(casacore::ImageInterface< casacore::Complex > &image, const VisBuffer &vb)
Called at the start of de-gridding : subftm-&gt;initializeToVis() Note : Pre-de-gridding model-image div...
virtual casacore::Bool isFourier()
Various small inline functions.
Definition: MultiTermFT.h:131
virtual casacore::Bool toRecord(casacore::String &error, casacore::RecordInterface &outRec, casacore::Bool withImage=false, const casacore::String diskimage="")
Save and restore the MultiTermFT to and from a record.
defines interface for the Fourier Transform Machine
Definition: FTMachine.h:120
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
void getWeightImage(casacore::ImageInterface< casacore::Float > &, casacore::Matrix< casacore::Float > &)
Get the final weights image - this will hold PB2.