casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StokesImageUtil.h
Go to the documentation of this file.
1 //# StokesImageUtil.h: Definitions for casacore::Stokes Image utilities
2 //# Copyright (C) 1996,1997,1998,1999
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_STOKESIMAGEUTIL_H
30 #define SYNTHESIS_STOKESIMAGEUTIL_H
31 
32 #include <casa/aips.h>
33 #include <casa/BasicSL/Complex.h>
35 #include <casa/Quanta/Quantum.h>
37 
38 namespace casa { //# NAMESPACE CASA - BEGIN
39 
40 // <summary>
41 // </summary>
42 
43 // <reviewed reviewer="" date="" tests="" demos="">
44 
45 // <prerequisite>
46 // </prerequisite>
47 //
48 // <etymology>
49 // </etymology>
50 //
51 // <synopsis>
52 // </synopsis>
53 //
54 // <example>
55 // <srcblock>
56 // </srcblock>
57 // </example>
58 //
59 // <motivation>
60 // </motivation>
61 //
62 // <todo asof="">
63 // </todo>
64 
65 
67 
68 public:
69 
70  enum PolRep {
73  };
74  // Make a Gaussian PSF
75  //<group>
77  casacore::Bool norm=false);
80  casacore::Bool norm=false);
81  //</group>
82 
83  // Fit a Gaussian PSF
84  //<group>
88  //</group>
89  // Locat peak of PSF return pos, peak and first plane that satisfies
90  // peak >0.9
91 
98 
99  // Convolve a casacore::Stokes Image in place
100  //<group>
104  casacore::Float bmin, casacore::Float bpa, casacore::Bool normalizeVolume=false);
107  casacore::Bool normalizeVolume=false);
109  casacore::ImageBeamSet& beams,
110  casacore::Bool normalizeVolume=false);
111  //</group>
112 
113 
114  // Zero selected planes of a casacore::Stokes image
116 
117  // Mask mask iif(image > threshhold), where threshhold is in image's units.
120  const casacore::Double threshhold);
121 
122  // This version uses threshold.get("Jy").getValue().
125  const casacore::Quantity& threshold);
126 
127 
128  // Zero pixels where casacore::Stokes I < some value
129  static void MaskOnStokesI(casacore::ImageInterface<casacore::Float>& image, const casacore::Quantity& threshold);
130 
131  // Make a box mask
133  const casacore::IPosition& trc, const casacore::Float value);
134 
135  // Constrain a casacore::Stokes Image
137 
138  // Convert from casacore::Stokes Image to "correlation" image.
141 
142  // Convert to casacore::Stokes Image from "correlation" image.
144 
145  // Direct copy from casacore::Float to casacore::Complex with
148 
149  // Direct copy To Float...
151 
152 
153  // Convert to casacore::Stokes PSF
155 
157 
158  // Find the mapping from pixel on the casacore::Stokes Axis to I,Q,U,V
160 
161  // Find the mapping from pixel on the casacore::Stokes Axis to either XX,XY,YX,YY
162  // of LL, LR, RL, RR. Return type as well: Linear:1, Circular 0
164  const casacore::CoordinateSystem& coord);
165 
166  // Find all mappings from coordinate to axis number
168 
169  //Create a casacore::CoordinateSystem from a casacore::MeasurementSet and other info
173 
174  // Create a casacore::CoordinateSystem from a casacore::MeasurementSet and other info
178  casacore::Vector<casacore::Int>& whichStokes,
179  casacore::Bool doCStokes=false,
180  casacore::Int fieldID=0, casacore::Int SPWID=0,
181  casacore::Int feedID=0);
182 
183  // Create a casacore::CoordinateSystem
184  static casacore::CoordinateSystem CStokesCoord(//const casacore::IPosition& shape,
185  const casacore::CoordinateSystem& coord,
186  casacore::Vector<casacore::Int>& whichStokes,
188  /*
189  static CoordinateSystem
190  CStokesCoordFromImage(const casacore::ImageInterface<casacore::Complex>& image,
191  casacore::Vector<casacore::Int>& whichStokes,
192  SkyModel::PolRep polRep);
193  */
194  // Change the stokes representation (but not the data!)
196  StokesImageUtil::PolRep polRep);
197 
200  casacore::Vector<casacore::Int>&whichStokes);
201 
202  // check to see if Image coordinates have the standard order:
203  // Direction, casacore::Stokes, Spectral. Returns false if this is not
204  // the order, or if any are missing
205  // <group>
209  // </group>
210 
211 };
212 
213 } //# NAMESPACE CASA - END
214 
215 #endif
216 
217 
static void changeLabelsStokesToCorrStokes(casacore::StokesCoordinate &stokesCoord, StokesImageUtil::PolRep polRep, casacore::Vector< casacore::Int > &whichStokes)
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
static void From(casacore::ImageInterface< casacore::Complex > &out, const casacore::ImageInterface< casacore::Float > &in)
Convert from casacore::Stokes Image to &quot;correlation&quot; image.
int Int
Definition: aipstype.h:50
static void Zero(casacore::ImageInterface< casacore::Float > &image, casacore::Vector< casacore::Bool > &mask)
Zero selected planes of a casacore::Stokes image.
static void Constrain(casacore::ImageInterface< casacore::Float > &image)
Constrain a casacore::Stokes Image.
static void locatePeakPSF(casacore::ImageInterface< casacore::Float > &psf, casacore::Int &xpos, casacore::Int &ypos, casacore::Float &amp, casacore::Matrix< casacore::Float > &psfplane)
Locat peak of PSF return pos, peak and first plane that satisfies peak &gt;0.9.
static void directCFromR(casacore::ImageInterface< casacore::Complex > &out, const casacore::ImageInterface< casacore::Float > &in)
Direct copy from casacore::Float to casacore::Complex with.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
static void MaskFrom(casacore::ImageInterface< casacore::Float > &mask, casacore::ImageInterface< casacore::Float > &image, const casacore::Double threshhold)
Mask mask iif(image &gt; threshhold), where threshhold is in image&#39;s units.
static void changeCStokesRep(casacore::ImageInterface< casacore::Complex > &image, StokesImageUtil::PolRep polRep)
Change the stokes representation (but not the data!)
static void BoxMask(casacore::ImageInterface< casacore::Float > &mask, const casacore::IPosition &blc, const casacore::IPosition &trc, const casacore::Float value)
Make a box mask.
T norm(const casacore::Vector< T > &x)
The magnitude/norm of a vector.
Represents a Gaussian restoring beam associated with an image.
Definition: GaussianBeam.h:68
static void ToStokesPSF(casacore::ImageInterface< casacore::Float > &out, casacore::ImageInterface< casacore::Complex > &in)
Convert to casacore::Stokes PSF.
static casacore::Bool FitGaussianPSF(casacore::ImageInterface< casacore::Float > &psf, casacore::Vector< casacore::Float > &beam)
Fit a Gaussian PSF.
Represents a set of restoring beams associated with an image.
Definition: ImageBeamSet.h:88
double Double
Definition: aipstype.h:55
LatticeExprNode amp(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds sqrt(left^2+right^2).
static casacore::Int CStokesPolMap(casacore::Vector< casacore::Int > &map, StokesImageUtil::PolRep &polframe, const casacore::CoordinateSystem &coord)
Find the mapping from pixel on the casacore::Stokes Axis to either XX,XY,YX,YY of LL...
static void directCToR(casacore::ImageInterface< casacore::Float > &out, casacore::ImageInterface< casacore::Complex > &in)
Direct copy To Float...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static casacore::CoordinateSystem CStokesCoord(const casacore::CoordinateSystem &coord, casacore::Vector< casacore::Int > &whichStokes, StokesImageUtil::PolRep polRep=StokesImageUtil::CIRCULAR)
Create a casacore::CoordinateSystem.
static void MaskOnStokesI(casacore::ImageInterface< casacore::Float > &image, const casacore::Quantity &threshold)
Zero pixels where casacore::Stokes I &lt; some value.
static casacore::Int StokesPolMap(casacore::Vector< casacore::Int > &map, const casacore::CoordinateSystem &coord)
Find the mapping from pixel on the casacore::Stokes Axis to I,Q,U,V.
float Float
Definition: aipstype.h:54
make the psf of each plane have static peak(i.e peak in the inner 1/8 of each plane)*/static casacore void Convolve(casacore::ImageInterface< casacore::Float > &image, casacore::ImageInterface< casacore::Float > &psf)
you are on your own if the peak outside that zone :( It returns the maximum of the peak value found ...
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
A Table intended to hold astronomical data (a set of Measurements).
static void ToStokesSumWt(casacore::Matrix< casacore::Float > sumwtStokes, casacore::Matrix< casacore::Float > sumwtCorr)
static casacore::CoordinateSystem StokesCoordFromMS(const casacore::IPosition &shape, casacore::Vector< casacore::Double > &deltas, casacore::MeasurementSet &ms)
Create a casacore::CoordinateSystem from a casacore::MeasurementSet and other info.
Interconvert between pixel and Stokes value.
static void MakeGaussianPSF(casacore::ImageInterface< casacore::Float > &psf, casacore::Vector< casacore::Float > &beam, casacore::Bool norm=false)
Make a Gaussian PSF.
static casacore::Bool standardImageCoordinates(const casacore::CoordinateSystem &coords)
check to see if Image coordinates have the standard order: Direction, casacore::Stokes, Spectral.
static void To(casacore::ImageInterface< casacore::Float > &out, casacore::ImageInterface< casacore::Complex > &in)
Convert to casacore::Stokes Image from &quot;correlation&quot; image.
Interconvert pixel and world coordinates.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
static casacore::Bool StokesMap(casacore::Vector< casacore::Int > &map, const casacore::CoordinateSystem &coord)
Find all mappings from coordinate to axis number.