casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SynthesisImagerVi2.h
Go to the documentation of this file.
1 //# SynthesisImagerVi2.h: Imager functionality sits here;
2 //# Copyright (C) 2016
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 #ifndef SYNTHESIS_SYNTHESISIMAGERVI2_H
27 #define SYNTHESIS_SYNTHESISIMAGERVI2_H
28 
33 #include <msvis/MSVis/VisBuffer2.h>
34 
35 namespace casacore{
36 
37 class MeasurementSet;
38 template<class T> class ImageInterface;
39 }
40 
41 namespace casa { //# NAMESPACE CASA - BEGIN
42 class VisImagingWeight;
44 {
45 
46 public:
47  // Default constructor
48 
50  virtual ~SynthesisImagerVi2();
51  virtual casacore::Bool selectData(const SynthesisParamsSelect& selpars);
52  virtual casacore::Bool defineImage(SynthesisParamsImage& impars, const SynthesisParamsGrid& gridpars);
53  virtual casacore::Bool weight(const casacore::String& type="natural",
54  const casacore::String& rmode="norm",
55  const casacore::Quantity& noise=casacore::Quantity(0.0, "Jy"),
56  const casacore::Double robust=0.0,
57  const casacore::Quantity& fieldofview=casacore::Quantity(0.0, "arcsec"),
58  const casacore::Int npixels=0,
59  const casacore::Bool multiField=false,
60  const casacore::Bool useCubeBriggs=false,
61  const casacore::String& filtertype=casacore::String("Gaussian"),
62  const casacore::Quantity& filterbmaj=casacore::Quantity(0.0,"deg"),
63  const casacore::Quantity& filterbmin=casacore::Quantity(0.0,"deg"),
64  const casacore::Quantity& filterbpa=casacore::Quantity(0.0,"deg") );
65  //set the weight density to the visibility iterator
66  //the default is to set it from the imagestore griwt() image
67  //Otherwise it will use this image passed here; useful for parallelization to
68  //share one grid to all children process
70  void predictModel();
71  virtual void makeSdImage(casacore::Bool dopsf=false);
77  //selected should be those that are pointed up with the antenna which is rastering.
78  virtual void makeImage(casacore::String type, const casacore::String& imagename, const casacore::String& complexImage=casacore::String(""), const Int whichModel=0);
79 
82  const casacore::String& ftmName,
83  const casacore::String& cfcPath,
84  const casacore::Bool& psTermOn,
85  const casacore::Bool& aTermOn,
86  const casacore::Bool& conjBeams);
87  void reloadCFCache();
88 
89  protected:
90  void appendToMapperList(casacore::String imagename,
92  casacore::IPosition imshape,
95  casacore::Quantity distance=casacore::Quantity(0.0, "m"),
96  casacore::Int facets=1,
97  casacore::Int chanchunks=1,
98  const casacore::Bool overwrite=false,
99  casacore::String mappertype=casacore::String("default"),
100  casacore::Float padding=1.0,
101  casacore::uInt ntaylorterms=1,
103  virtual void unlockMSs();
104  virtual void createVisSet(const casacore::Bool writeaccess=false);
107  const casacore::String& ftname,
108  const casacore::uInt nTaylorTerms=1,
109  const casacore::String mType="default",
110  const casacore::Int facets=1,
111  //------------------------------
112  const casacore::Int wprojplane=1,
113  const casacore::Float padding=1.0,
114  const casacore::Bool useAutocorr=false,
115  const casacore::Bool useDoublePrec=true,
116  const casacore::String gridFunction=casacore::String("SF"),
117  //------------------------------
118  const casacore::Bool aTermOn = true,
119  const casacore::Bool psTermOn = true,
120  const casacore::Bool mTermOn = false,
121  const casacore::Bool wbAWP = true,
122  const casacore::String cfCache = "",
123  const casacore::Bool usePointing = false,
124  const casacore::Bool doPBCorr = true,
125  const casacore::Bool conjBeams = true,
126  const casacore::Float computePAStep = 360.0,
127  const casacore::Float rotatePAStep = 5.0,
128  const casacore::String interpolation = casacore::String("linear"),
129  const casacore::Bool freqFrameValid = true,
130  const casacore::Int cache=1000000000,
131  const casacore::Int tile=16,
132  const casacore::String stokes="I",
133  const casacore::String imageNamePrefix="",
134  const casacore::String &pointingDirCol=casacore::String("direction"),
135  const casacore::Float skyPosThreshold=0.0,
136  const casacore::Int convSupport=-1,
137  const casacore::Quantity &truncateSize=casacore::Quantity(-1),
138  const casacore::Quantity &gwidth=casacore::Quantity(-1),
139  const casacore::Quantity &jwidth=casacore::Quantity(-1),
140  const casacore::Float minWeight=0.1,
141  const casacore::Bool clipMinMax=false,
142  const casacore::Bool pseudoI=false);
143 
145  const casacore::String& ftmName,
146  const casacore::Int facets,
147  //----------------------------
148  const casacore::Int wprojPlane,
149  const casacore::Float padding,
150  const casacore::Bool useAutocorr,
151  const casacore::Bool useDoublePrec,
152  const casacore::String gridFunction,
153  //---------------------------
154  const casacore::Bool aTermOn,
155  const casacore::Bool psTermOn,
156  const casacore::Bool mTermOn,
157  const casacore::Bool wbAWP,
158  const casacore::String cfCache,
159  const casacore::Bool usePointing,
160  const casacore::Bool doPBCorr,
161  const casacore::Bool conjBeams,
162  const casacore::Float computePAStep,
163  const casacore::Float rotatePAStep,
164  const casacore::Int cache,
165  const casacore::Int tile,
166  const casacore::String imageNamePrefix="");
167 
170  const casacore::String &pointingDirCol,
171  const casacore::Float skyPosThreshold,
172  const casacore::Bool doPBCorr,
173  const casacore::Float rotatePAStep,
174  const casacore::String& gridFunction,
175  const casacore::Int convSupport,
176  const casacore::Quantity& truncateSize,
177  const casacore::Quantity& gwidth,
178  const casacore::Quantity& jwidth,
179  const casacore::Float minWeight,
180  const casacore::Bool clipMinMax,
181  const casacore::Int cache,
182  const casacore::Int tile,
183  const casacore::String &stokes,
184  const casacore::Bool pseudoI=false);
185 
186 // Do the major cycle
187  virtual void runMajorCycle(const casacore::Bool dopsf=false, const casacore::Bool savemodel=false);
188 
189  // Version of major cycle code with mappers in a loop outside vi/vb.
190  virtual void runMajorCycle2(const casacore::Bool dopsf=false, const casacore::Bool savemodel=false);
191 
194  const casacore::Float padding,
195  const casacore::Bool useAutoCorr,
196  const casacore::Bool useDoublePrec,
197  const casacore::Float rotatePAStep,
198  const casacore::String Stokes="I", const casacore::Bool doConjBeam=false);
203  casacore::uInt ntaylorterms=1);
204 
205  // Calculate apparent sensitivity (for _Visibility_ spectrum)
206  // _Image_ spectral grid TBD
208 
209  bool makePB();
210  bool makePrimaryBeam(PBMath& pbMath);
211  void andFreqSelection(const casacore::Int msId, const casacore::Int spwId, const casacore::Double freqBeg, const casacore::Double freqEnd, const casacore::MFrequency::Types frame);
212  void andChanSelection(const casacore::Int msId, const casacore::Int spwId, const casacore::Int startchan, const casacore::Int endchan);
213  void tuneChunk(const casacore::Int gmap);
214  //Set up tracking direction ; return False if no tracking is set.
215  //return Direction of moving source is in the frame of vb.phaseCenter() at the time of the first row of the vb
217 
218  // Other Options
219  //casacore::Block<const casacore::MeasurementSet *> mss_p;
222  std::vector<std::pair<casacore::Int, casacore::Double> >freqBegs_p;
223  std::vector<std::pair<casacore::Int, casacore::Double> > freqEnds_p;
224  std::vector<std::pair<casacore::Int, casacore::Double> > freqSpws_p;
225  //map <msid, map<spwid, vector(nchan, start)> >
226  std::map<casacore::Int, std::map<casacore::Int, casacore::Vector<casacore::Int> > > channelSelections_p;
227  // ///temporary variable as we carry that for tunechunk
229 };
230 } //# NAMESPACE CASA - END
231 
232 #endif
233 
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A Measure: astronomical direction.
Definition: MDirection.h:174
int Int
Definition: aipstype.h:50
void andFreqSelection(const casacore::Int msId, const casacore::Int spwId, const casacore::Double freqBeg, const casacore::Double freqEnd, const casacore::MFrequency::Types frame)
virtual void makeImage(casacore::String type, const casacore::String &imagename, const casacore::String &complexImage=casacore::String(""), const Int whichModel=0)
This should replace makeSDImage and makePSF etc in the long run But for now you can do the following ...
std::vector< std::pair< casacore::Int, casacore::Double > > freqBegs_p
void createSDFTMachine(casacore::CountedPtr< refim::FTMachine > &theFT, casacore::CountedPtr< refim::FTMachine > &theIFT, const casacore::String &pointingDirCol, const casacore::Float skyPosThreshold, const casacore::Bool doPBCorr, const casacore::Float rotatePAStep, const casacore::String &gridFunction, const casacore::Int convSupport, const casacore::Quantity &truncateSize, const casacore::Quantity &gwidth, const casacore::Quantity &jwidth, const casacore::Float minWeight, const casacore::Bool clipMinMax, const casacore::Int cache, const casacore::Int tile, const casacore::String &stokes, const casacore::Bool pseudoI=false)
SynthesisImagerVi2()
Default constructor.
virtual void unlockMSs()
casacore::Bool setWeightDensity(const casacore::String &imagename=casacore::String(""))
set the weight density to the visibility iterator the default is to set it from the imagestore griwt(...
std::map< casacore::Int, std::map< casacore::Int, casacore::Vector< casacore::Int > > > channelSelections_p
map &lt;msid, map&lt;spwid, vector(nchan, start)&gt; &gt;
virtual casacore::Record apparentSensitivity()
Calculate apparent sensitivity (for Visibility spectrum) Image spectral grid TBD. ...
Stokes parameter definitions for interface to table data.
Definition: Stokes.h:51
void createAWPFTMachine(casacore::CountedPtr< refim::FTMachine > &theFT, casacore::CountedPtr< refim::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 usePointing, const casacore::Bool doPBCorr, const casacore::Bool conjBeams, const casacore::Float computePAStep, const casacore::Float rotatePAStep, const casacore::Int cache, const casacore::Int tile, const casacore::String imageNamePrefix="")
virtual Type type()
Return the type enum.
Primary beam envelope class, derived from PBMathInterface.
Definition: PBMath.h:126
virtual void runMajorCycle(const casacore::Bool dopsf=false, const casacore::Bool savemodel=false)
Do the major cycle.
Class that contains functions needed for imager.
casacore::CountedPtr< vi::FrequencySelections > fselections_p
bool makePrimaryBeam(PBMath &pbMath)
void dryGridding(const casacore::Vector< casacore::String > &cfList)
SIIterBot&amp; getLoopControls();.
casacore::MFrequency::Types selFreqFrame_p
///temporary variable as we carry that for tunechunk
casacore::CountedPtr< vi::VisibilityIterator2 > vi_p
Other Options casacore::Block&lt;const casacore::MeasurementSet *&gt; mss_p;
void andChanSelection(const casacore::Int msId, const casacore::Int spwId, const casacore::Int startchan, const casacore::Int endchan)
void createFTMachine(casacore::CountedPtr< casa::refim::FTMachine > &theFT, casacore::CountedPtr< casa::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 usePointing=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, const casacore::String stokes="I", const casacore::String imageNamePrefix="", const casacore::String &pointingDirCol=casacore::String("direction"), const casacore::Float skyPosThreshold=0.0, const casacore::Int convSupport=-1, const casacore::Quantity &truncateSize=casacore::Quantity(-1), const casacore::Quantity &gwidth=casacore::Quantity(-1), const casacore::Quantity &jwidth=casacore::Quantity(-1), const casacore::Float minWeight=0.1, const casacore::Bool clipMinMax=false, const casacore::Bool pseudoI=false)
virtual casacore::Bool selectData(const SynthesisParamsSelect &selpars)
Copy constructor and assignment operator Imager(const Imager&amp;); Imager&amp; operator=(const Imager&amp;); ...
void createMosFTMachine(casacore::CountedPtr< casa::refim::FTMachine > &theFT, casacore::CountedPtr< casa::refim::FTMachine > &theIFT, const casacore::Float padding, const casacore::Bool useAutoCorr, const casacore::Bool useDoublePrec, const casacore::Float rotatePAStep, const casacore::String Stokes="I", const casacore::Bool doConjBeam=false)
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)
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
A base class for astronomical images.
virtual void makeSdImage(casacore::Bool dopsf=false)
double Double
Definition: aipstype.h:55
void fillCFCache(const casacore::Vector< casacore::String > &cfList, const casacore::String &ftmName, const casacore::String &cfcPath, const casacore::Bool &psTermOn, const casacore::Bool &aTermOn, const casacore::Bool &conjBeams)
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 casacore::Bool defineImage(SynthesisParamsImage &impars, const SynthesisParamsGrid &gridpars)
float Float
Definition: aipstype.h:54
virtual void runMajorCycle2(const casacore::Bool dopsf=false, const casacore::Bool savemodel=false)
Version of major cycle code with mappers in a loop outside vi/vb.
void tuneChunk(const casacore::Int gmap)
A Table intended to hold astronomical data (a set of Measurements).
virtual void createVisSet(const casacore::Bool writeaccess=false)
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
casacore::Bool getMovingDirection(const vi::VisBuffer2 &vb, casacore::MDirection &movingDir)
Set up tracking direction ; return False if no tracking is set.
void appendToMapperList(casacore::String imagename, casacore::CoordinateSystem &csys, casacore::IPosition imshape, casacore::CountedPtr< refim::FTMachine > &ftm, casacore::CountedPtr< refim::FTMachine > &iftm, casacore::Quantity distance=casacore::Quantity(0.0,"m"), casacore::Int facets=1, casacore::Int chanchunks=1, const casacore::Bool overwrite=false, casacore::String mappertype=casacore::String("default"), casacore::Float padding=1.0, casacore::uInt ntaylorterms=1, casacore::Vector< casacore::String > startmodel=casacore::Vector< casacore::String >(0))
virtual 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::Bool useCubeBriggs=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"))
String: the storage and methods of handling collections of characters.
Definition: String.h:223
std::vector< std::pair< casacore::Int, casacore::Double > > freqSpws_p
std::vector< std::pair< casacore::Int, casacore::Double > > freqEnds_p
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
Interconvert pixel and world coordinates.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42