casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SynthesisImager.h
Go to the documentation of this file.
1 //# SynthesisImager.h: Imager functionality sits here;
2 //# Copyright (C) 2012-2013
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 addressed 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 //#
25 //# $Id$
26 
27 #ifndef SYNTHESIS_VB2_SYNTHESISIMAGER_H
28 #define SYNTHESIS_VB2_SYNTHESISIMAGER_H
29 
30 #include <casa/aips.h>
31 #include <casa/OS/Timer.h>
32 #include <casa/Containers/Record.h>
34 #include <casa/Arrays/IPosition.h>
35 #include <casa/Quanta/Quantum.h>
38 
41 
45 
46 namespace casacore{
47 
48 class MeasurementSet;
49 template<class T> class ImageInterface;
50 }
51 
52 namespace casa { //# NAMESPACE CASA - BEGIN
53 // Forward declarations
54  class SIIterBot;
55  class VisImagingWeight;
56 
57 // <summary> Class that contains functions needed for imager </summary>
58  namespace refim { //# NAMESPACE refim - BEGIN
59 
61 {
62  public:
63  // Default constructor
64 
66  virtual ~SynthesisImager();
67 
68  // Copy constructor and assignment operator
69  //Imager(const Imager&);
70  //Imager& operator=(const Imager&);
71 
72  virtual casacore::Bool selectData(const SynthesisParamsSelect& selpars);
73 
74  // make all pure-inputs const
75  virtual casacore::Bool selectData(const casacore::String& msname,
76  const casacore::String& spw="*",
77  const casacore::String& freqBeg="",
78  const casacore::String& freqEnd="",
80  const casacore::String& field="*",
81  const casacore::String& antenna="",
82  const casacore::String& timestr="",
83  const casacore::String& scan="",
84  const casacore::String& obs="",
85  const casacore::String& state="",
86  const casacore::String& uvdist="",
87  const casacore::String& taql="",
88  const casacore::Bool usescratch=false,
89  const casacore::Bool readonly=false,
90  const casacore::Bool incrementModel=false);
91 
92  virtual casacore::Bool defineImage(SynthesisParamsImage& impars, const SynthesisParamsGrid& gridpars);
93 
94  //When having a facetted image ...call with (facets > 1) first and once only ..
95  //Easier to keep track of the imstores that way
97  virtual casacore::Bool defineImage(const casacore::String& imagename, const casacore::Int nx, const casacore::Int ny,
98  const casacore::Quantity& cellx, const casacore::Quantity& celly,
99  const casacore::String& stokes,
100  const casacore::MDirection& phaseCenter,
101  const casacore::Int nchan,
102  const casacore::Quantity& freqStart,
103  const casacore::Quantity& freqStep,
104  const casacore::Vector<casacore::Quantity>& restFreq,
105  const casacore::Int facets=1,
106  const casacore::String ftmachine="GridFT",
107  const casacore::Int nTaylorTerms=1,
108  const casacore::Quantity& refFreq = casacore::Quantity(0,"Hz"),
110  const casacore::Quantity& distance=casacore::Quantity(0,"m"),
112  const casacore::Bool trackSource=false,
113  const casacore::MDirection& trackDir=casacore::MDirection(casacore::Quantity(0.0, "deg"), casacore::Quantity(90.0, "deg")),
114  const casacore::Bool overwrite=false,
115  const casacore::Float padding=1.0,
116  const casacore::Bool useAutocorr=false,
117  const bool useDoublePrec=true,
118  const casacore::Int wprojplanes=1,
119  const casacore::String convFunc="SF",
120  const casacore::String startmodel="",
121  // The extra params for WB-AWP
122  const casacore::Bool aTermOn = true,
123  const casacore::Bool psTermOn = true,
124  const casacore::Bool mTermOn = false,
125  const casacore::Bool wbAWP = true,
126  const casacore::String cfCache = "",
127  const casacore::Bool doPointing = false,
128  const casacore::Bool doPBCorr = true,
129  const casacore::Bool conjBeams = true,
130  const casacore::Float computePAStep=360.0,
131  const casacore::Float rotatePAStep=5.0
132  );
133  //Define image via a predefine SIImageStore object
135  const casacore::String& ftmachine);
136  //Defining componentlist to use while degriding
137  //This should be called once...if multiple lists are used..they can be merged in one
138  //if sdgrid=true then image plane degridding is done
139  virtual void setComponentList(const ComponentList& cl,
140  casacore::Bool sdgrid=false);
141  casacore::Bool weight(const casacore::String& type="natural",
142  const casacore::String& rmode="norm",
143  const casacore::Quantity& noise=casacore::Quantity(0.0, "Jy"),
144  const casacore::Double robust=0.0,
145  const casacore::Quantity& fieldofview=casacore::Quantity(0.0, "arcsec"),
146  const casacore::Int npixels=0,
147  const casacore::Bool multiField=false,
148  const casacore::String& filtertype=casacore::String("Gaussian"),
149  const casacore::Quantity& filterbmaj=casacore::Quantity(0.0,"deg"),
150  const casacore::Quantity& filterbmin=casacore::Quantity(0.0,"deg"),
151  const casacore::Quantity& filterbpa=casacore::Quantity(0.0,"deg") );
152 
153  //the following get rid of the mappers in this object
154  void resetMappers();
155 
157 
158  //casacore::Record getMajorCycleControls();
159  void executeMajorCycle(casacore::Record& controls);
160 
161  // make the psf images i.e grid weight rather than data
162  void makePSF();
163 
164  void predictModel();
165  /* Access method to the Loop Controller held in this class */
166  //SIIterBot& getLoopControls();
167 
168 
169 
170 protected:
171 
173 
174  // Choose between different types of FTMs
177  const casacore::String& ftname,
178  const casacore::uInt nTaylorTerms=1,
179  const casacore::String mType="default",
180  const casacore::Int facets=1,
181  //------------------------------
182  const casacore::Int wprojplane=1,
183  const casacore::Float padding=1.0,
184  const casacore::Bool useAutocorr=false,
185  const casacore::Bool useDoublePrec=true,
186  const casacore::String gridFunction=casacore::String("SF"),
187  //------------------------------
188  const casacore::Bool aTermOn = true,
189  const casacore::Bool psTermOn = true,
190  const casacore::Bool mTermOn = false,
191  const casacore::Bool wbAWP = true,
192  const casacore::String cfCache = "",
193  const casacore::Bool doPointing = false,
194  const casacore::Bool doPBCorr = true,
195  const casacore::Bool conjBeams = true,
196  const casacore::Float computePAStep = 360.0,
197  const casacore::Float rotatePAStep = 5.0,
198  const casacore::String interpolation = casacore::String("linear"),
199  const casacore::Bool freqFrameValid = true,
200  const casacore::Int cache=1000000000,
201  const casacore::Int tile=16);
202 
203  // Choose between different types of ImageStore types (single term, multiterm, faceted)
206  casacore::IPosition imShape,
207  const casacore::Bool overwrite,
208  casacore::String mappertype="default",
209  casacore::uInt ntaylorterms=1,
210  casacore::Quantity distance=casacore::Quantity(0.0, "m"),
211  casacore::uInt facets=1,
212  casacore::Bool useweightimage=false);
213 
214  // Choose between different types of Mappers (single term, multiterm, imagemosaic, faceted)
219  casacore::uInt ntaylorterms=1);
220 
223  casacore::Int facets);
224  void setPsfFromOneFacet();
225 
227 
228  void createVisSet(const casacore::Bool writeaccess=false);
229 
231  const casacore::String& ftmName,
232  const casacore::Int facets,
233  //----------------------------
234  const casacore::Int wprojPlane,
235  const casacore::Float padding,
236  const casacore::Bool useAutocorr,
237  const casacore::Bool useDoublePrec,
238  const casacore::String gridFunction,
239  //---------------------------
240  const casacore::Bool aTermOn,
241  const casacore::Bool psTermOn,
242  const casacore::Bool mTermOn,
243  const casacore::Bool wbAWP,
244  const casacore::String cfCache,
245  const casacore::Bool doPointing,
246  const casacore::Bool doPBCorr,
247  const casacore::Bool conjBeams,
248  const casacore::Float computePAStep,
249  const casacore::Float rotatePAStep,
250  const casacore::Int cache,
251  const casacore::Int tile);
253 
254  void runMajorCycle(const casacore::Bool dopsf=false, const casacore::Bool savemodel=false);
255 
260  // void appendToMapperList(casacore::String imagename, casacore::CoordinateSystem& csys, casacore::String ftmachine,
261  // casacore::Quantity distance=casacore::Quantity(0.0, "m"), casacore::Int facets=1, const casacore::Bool overwrite=false);
262 
263  void appendToMapperList(casacore::String imagename,
265  casacore::IPosition imshape,
268  casacore::Quantity distance=casacore::Quantity(0.0, "m"),
269  casacore::Int facets=1,
270  const casacore::Bool overwrite=false,
271  casacore::String mappertype=casacore::String("default"),
272  casacore::uInt ntaylorterms=1);
274 
278 
279 
282 
283 
285 
286  // casacore::Data Selection
287  // Image Definition
288  // Imaging/Gridding
289 
290  // Other Options
294 
303  //
304  // casacore::Bool freqFrameValid_p;
305 
307 
308 };
309 
310  }//# NAMESPACE refim - END
311 } //# NAMESPACE CASA - END
312 
313 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
casacore::CoordinateSystem itsMaxCoordSys
A Measure: astronomical direction.
Definition: MDirection.h:174
casacore::IPosition itsMaxShape
A 1-D Specialization of the Array class.
A Measure: position on Earth.
Definition: MPosition.h:79
int Int
Definition: aipstype.h:50
casacore::CountedPtr< SIImageStore > unFacettedImStore_p
if facetting this storage will keep the unsliced version
Object to hold type of imaging weight scheme to be used on the fly and to provide facilities to do th...
Geometric parameters needed for a sky projection to a plane.
Definition: Projection.h:95
virtual Type type()
Return the type enum.
void makePSF()
make the psf images i.e grid weight rather than data
casacore::Data Selection Image Definition Imaging Gridding Other Options *casacore::Block< const casacore::MeasurementSet * > mss_p
casacore::MPosition mLocation_p
casacore::CountedPtr< SIImageStore > createIMStore(casacore::String imageName, casacore::CoordinateSystem &cSys, casacore::IPosition imShape, const casacore::Bool overwrite, casacore::String mappertype="default", casacore::uInt ntaylorterms=1, casacore::Quantity distance=casacore::Quantity(0.0,"m"), casacore::uInt facets=1, casacore::Bool useweightimage=false)
Choose between different types of ImageStore types (single term, multiterm, faceted) ...
casacore::CountedPtr< SIMapper > createSIMapper(casacore::String mappertype, casacore::CountedPtr< SIImageStore > imagestore, casacore::CountedPtr< refim::FTMachine > ftmachine, casacore::CountedPtr< refim::FTMachine > iftmachine, casacore::uInt ntaylorterms=1)
Choose between different types of Mappers (single term, multiterm, imagemosaic, faceted) ...
casacore::Bool weight(const casacore::String &type="natural", const casacore::String &rmode="norm", const casacore::Quantity &noise=casacore::Quantity(0.0,"Jy"), const casacore::Double robust=0.0, const casacore::Quantity &fieldofview=casacore::Quantity(0.0,"arcsec"), const casacore::Int npixels=0, const casacore::Bool multiField=false, const casacore::String &filtertype=casacore::String("Gaussian"), const casacore::Quantity &filterbmaj=casacore::Quantity(0.0,"deg"), const casacore::Quantity &filterbmin=casacore::Quantity(0.0,"deg"), const casacore::Quantity &filterbpa=casacore::Quantity(0.0,"deg"))
void createAWPFTMachine(casacore::CountedPtr< FTMachine > &theFT, casacore::CountedPtr< FTMachine > &theIFT, const casacore::String &ftmName, const casacore::Int facets, const casacore::Int wprojPlane, const casacore::Float padding, const casacore::Bool useAutocorr, const casacore::Bool useDoublePrec, const casacore::String gridFunction, const casacore::Bool aTermOn, const casacore::Bool psTermOn, const casacore::Bool mTermOn, const casacore::Bool wbAWP, const casacore::String cfCache, const casacore::Bool doPointing, const casacore::Bool doPBCorr, const casacore::Bool conjBeams, const casacore::Float computePAStep, const casacore::Float rotatePAStep, const casacore::Int cache, const casacore::Int tile)
void createVisSet(const casacore::Bool writeaccess=false)
casacore::Bool toUseWeightImage(casacore::CountedPtr< refim::FTMachine > &ftm, casacore::String mappertype)
Orthographics/synthesis.
Definition: Projection.h:107
*SIMapperCollection itsMappers
void resetMappers()
the following get rid of the mappers in this object
virtual void setComponentList(const ComponentList &cl, casacore::Bool sdgrid=false)
Defining componentlist to use while degriding This should be called once...if multiple lists are used...
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
A base class for astronomical images.
double Double
Definition: aipstype.h:55
casacore::MDirection phaseCenter_p
Type
Types of known Images that may be made using the makeImage method.
Definition: FTMachine.h:127
casacore::CountedPtr< SIImageStore > imageStore(const casacore::Int id=0)
void executeMajorCycle(casacore::Record &controls)
casacore::Record getMajorCycleControls();
Choose between different types of FTMs *void createFTMachine(casacore::CountedPtr< refim::FTMachine > &theFT, casacore::CountedPtr< refim::FTMachine > &theIFT, const casacore::String &ftname, const casacore::uInt nTaylorTerms=1, const casacore::String mType="default", const casacore::Int facets=1, const casacore::Int wprojplane=1, const casacore::Float padding=1.0, const casacore::Bool useAutocorr=false, const casacore::Bool useDoublePrec=true, const casacore::String gridFunction=casacore::String("SF"), const casacore::Bool aTermOn=true, const casacore::Bool psTermOn=true, const casacore::Bool mTermOn=false, const casacore::Bool wbAWP=true, const casacore::String cfCache="", const casacore::Bool doPointing=false, const casacore::Bool doPBCorr=true, const casacore::Bool conjBeams=true, const casacore::Float computePAStep=360.0, const casacore::Float rotatePAStep=5.0, const casacore::String interpolation=casacore::String("linear"), const casacore::Bool freqFrameValid=true, const casacore::Int cache=1000000000, const casacore::Int tile=16)
SIIterBot&amp; getLoopControls();.
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
void runMajorCycle(const casacore::Bool dopsf=false, const casacore::Bool savemodel=false)
float Float
Definition: aipstype.h:54
refim::FTMachine::Type datacol_p
casacore::Bool freqFrameValid_p;
virtual casacore::Bool defineImage(SynthesisParamsImage &impars, const SynthesisParamsGrid &gridpars)
A Table intended to hold astronomical data (a set of Measurements).
simple 1-D array
The base class to represent the Aperture-Term of the Measurement Equation.
Definition: ATerm.h:65
refim::ATerm * createTelescopeATerm(const casacore::MeasurementSet &ms, const casacore::Bool &isATermOn)
A class for manipulating groups of components.
virtual casacore::Bool selectData(const SynthesisParamsSelect &selpars)
Copy constructor and assignment operator Imager(const Imager&amp;); Imager&amp; operator=(const Imager&amp;); ...
String: the storage and methods of handling collections of characters.
Definition: String.h:223
SynthesisImager()
Default constructor.
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
casacore::Block< casacore::CountedPtr< SIImageStore > > createFacetImageStoreList(casacore::CountedPtr< SIImageStore > imagestore, casacore::Int facets)
vi::FrequencySelections fselections_p
casacore::CountedPtr< vi::VisibilityIterator2 > vi_p
Interconvert pixel and world coordinates.
unsigned int uInt
Definition: aipstype.h:51
void appendToMapperList(casacore::String imagename, casacore::CoordinateSystem &csys, casacore::String ftmachine, casacore::Quantity distance=casacore::Quantity(0.0,"m"), casacore::Int facets=1, const casacore::Bool overwrite=false)
It associated the ftmachine with a given field.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42