casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VisImagingWeight.h
Go to the documentation of this file.
1 //# VisImagingWeight.h: Calculate Imaging Weights for a buffer from weight
2 //# Copyright (C) 2009-2018
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 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 General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU 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 VISIMAGINGWEIGHT_H
30 #define VISIMAGINGWEIGHT_H
31 #include <casa/aips.h>
32 #include <casa/BasicSL/Complex.h>
33 #include <casa/Quanta/Quantum.h>
35 
36 namespace casacore{
37 
38 template<class T> class Matrix;
39 template<class T> class Vector;
40 template<class T> class ImageInterface;
41 template<class T> class TempLattice;
42 
43 }
44 
45 namespace casa { //# NAMESPACE CASA - BEGIN
46 //#forward
47 class ROVisibilityIterator;
48 
49 // <summary>
50 // Object to hold type of imaging weight scheme to be used on the fly and to provide
51 // facilities to do that.
52 // </summary>
53 
54 // <reviewed reviewer="" date="" tests="" demos="">
55 
56 // <prerequisite>
57 // </prerequisite>
58 //
59 // <etymology>
60 // </etymology>
61 //
62 // <synopsis>
63 // </synopsis>
64 //
65 // <example>
66 // <srcblock>
67 // </srcblock>
68 // </example>
69 //
70 // <motivation>
71 // </motivation>
72 //
73 // <todo asof="">
74 // </todo>
75 
77  public:
78  //empty constructor
80  //Constructor to calculate natural and radial weights
82  //Constructor to calculate uniform weight schemes; include Brigg's and super/uniform
83  //If multiField=true, the weight density calcution is done on a per field basis,
84  //else it is all fields combined
86  const casacore::Double robust, const casacore::Int nx, const casacore::Int ny,
87  const casacore::Quantity& cellx, const casacore::Quantity& celly,
88  const casacore::Int uBox, const casacore::Int vBox, const casacore::Bool multiField=false);
89  //Constructor for uniform style weighting when the weight density is calculated
90  //elsewhere
92  const casacore::Double robust, const casacore::Quantity& cellx, const casacore::Quantity& celly,
93  const casacore::Bool multiField=false) ;
94  //VisibilityIterator2 version of the above....
95  // Note the VisibilityIterator can be readonly...thus recommended if you can
96  // as that will prevent unnecessary locks
98  const casacore::Double robust, const casacore::Int nx, const casacore::Int ny,
99  const casacore::Quantity& cellx, const casacore::Quantity& celly,
100  const casacore::Int uBox, const casacore::Int vBox, const casacore::Bool multiField=false);
103  virtual ~VisImagingWeight();
104 
105 
106  // reference semantically = operator
108 
109  //you have to make sure the imageinterface passed has the shape of gwt
110  //on the first 2 axex and last axis
112  // casacore::Function to calculate the uniform style weights, include Brigg's for example
113  // imagingWeight should be sized by (nchan, row) already
114  // The fieldid and msid parameters must correspond to what VisBuffer or VisIter fieldId() and msId() returns
116  const casacore::Vector<casacore::Double>& frequency, const casacore::Matrix<casacore::Float>& weight, const casacore::Int msid, const casacore::Int fieldid ) const;
117 
118  //Natural weighting scheme
119  //imagingWeight should be sized by (nchan, row) already
121  const casacore::Matrix<casacore::Float>& weight) const;
122 
123  /* unused version?
124  //weight as casacore::Matrix version
125  virtual void weightNatural(casacore::Matrix<casacore::Float>& imagingWeight, const casacore::Matrix<casacore::Bool>& flag,
126  const casacore::Matrix<casacore::Float>& weight) const;
127 
128  */
129  //Radial weighting
130  //imagingWeight should be sized by (nchan, row) already
133  const casacore::Matrix<casacore::Float>& weight) const;
134 
135  //Get the type of weighting this object is on..will return one of "natural", "uniform", "radial"
136  virtual casacore::String getType() const;
137 
138  //setting uv filtering
139  virtual void setFilter(const casacore::String& type, const casacore::Quantity& bmaj,
140  const casacore::Quantity& bmin, const casacore::Quantity& bpa);
141 
142  //returns if uv filtering is set
143  virtual casacore::Bool doFilter() const;
144 
145  //do uvfiltering...to be called after imaging weight is calculated
148  const casacore::Vector<casacore::Double>& frequency, const casacore::Matrix<casacore::Float>& weight) const;
149 
150  // This is to get/set uniform style weight density...e.g if the caller wants to
151  // add densities from different pieces of data distributed via different
152  // VisibilityIterators
155 
156  // Form corr-indep weight by averaging parallel-hand weights
157  static void unPolChanWeight(casacore::Matrix<casacore::Float>& chanRowWt, const casacore::Cube<casacore::Float>& corrChanRowWt);
158 
160 
161  private:
163 
164  std::map<casacore::String, casacore::Int> multiFieldMap_p;
181 
182 
183  };
184 } //# NAMESPACE CASA - END
185 #endif // VISIMAGINGWEIGHT_H
virtual casacore::Bool getWeightDensity(casacore::Block< casacore::Matrix< casacore::Float > > &density)
This is to get/set uniform style weight density...e.g if the caller wants to add densities from diffe...
casacore::Double sinpa_p
A Lattice that can be used for temporary storage.
int Int
Definition: aipstype.h:50
std::vector< double > Vector
Definition: ds9context.h:24
casacore::Double rbmin_p
Object to hold type of imaging weight scheme to be used on the fly and to provide facilities to do th...
VisibilityIterator2 iterates through one or more readonly MeasurementSets.
casacore::Quantity noise_p
virtual Type type()
Return the type enum.
casacore::Vector< casacore::Float > d2_p
casacore::Vector< casacore::Float > f2_p
casacore::Double cospa_p
VisImagingWeight & operator=(const VisImagingWeight &imwgt)
reference semantically = operator
std::map< casacore::String, casacore::Int > multiFieldMap_p
virtual void setWeightDensity(const casacore::Block< casacore::Matrix< casacore::Float > > &density)
*virtual void weightRadial(casacore::Matrix< casacore::Float > &imagingWeight, const casacore::Matrix< casacore::Bool > &flag, const casacore::Matrix< casacore::Double > &uvw, const casacore::Vector< casacore::Double > &frequency, const casacore::Matrix< casacore::Float > &weight) const
Radial weighting imagingWeight should be sized by (nchan, row) already.
VisImagingWeight()
empty constructor
casacore::Vector< casacore::Int > shapeOfdensityGrid()
virtual void weightUniform(casacore::Matrix< casacore::Float > &imagingWeight, const casacore::Matrix< casacore::Bool > &flag, const casacore::Matrix< casacore::Double > &uvw, const casacore::Vector< casacore::Double > &frequency, const casacore::Matrix< casacore::Float > &weight, const casacore::Int msid, const casacore::Int fieldid) const
casacore::Function to calculate the uniform style weights, include Brigg&#39;s for example imagingWeight ...
casacore::Int activeFieldIndex_p
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
double Double
Definition: aipstype.h:55
casacore::Matrix< casacore::Float > a_gwt_p
casacore::Double robust_p
virtual void weightNatural(casacore::Matrix< casacore::Float > &imagingWeight, const casacore::Matrix< casacore::Bool > &flag, const casacore::Matrix< casacore::Float > &weight) const
Natural weighting scheme imagingWeight should be sized by (nchan, row) already.
casacore::Float uscale_p
virtual void setFilter(const casacore::String &type, const casacore::Quantity &bmaj, const casacore::Quantity &bmin, const casacore::Quantity &bpa)
setting uv filtering
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
casacore::String wgtType_p
simple 1-D array
static void unPolChanWeight(casacore::Matrix< casacore::Float > &chanRowWt, const casacore::Cube< casacore::Float > &corrChanRowWt)
Form corr-indep weight by averaging parallel-hand weights.
void cube2Matrix(const casacore::Cube< casacore::Bool > &fcube, casacore::Matrix< casacore::Bool > &fMat)
virtual casacore::Bool doFilter() const
returns if uv filtering is set
casacore::Block< casacore::CountedPtr< casacore::TempLattice< casacore::Float > > > gwt_p
casacore::String rmode_p
virtual void filter(casacore::Matrix< casacore::Float > &imWeight, const casacore::Matrix< casacore::Bool > &flag, const casacore::Matrix< casacore::Double > &uvw, const casacore::Vector< casacore::Double > &frequency, const casacore::Matrix< casacore::Float > &weight) const
do uvfiltering...to be called after imaging weight is calculated
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Double rbmaj_p
virtual void toImageInterface(casacore::ImageInterface< casacore::Float > &im)
you have to make sure the imageinterface passed has the shape of gwt on the first 2 axex and last axi...
ROVisibilityIterator iterates through one or more readonly MeasurementSets.
virtual casacore::String getType() const
Get the type of weighting this object is on..will return one of &quot;natural&quot;, &quot;uniform&quot;, &quot;radial&quot;.
casacore::Float vscale_p
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42