casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ComponentImager.h
Go to the documentation of this file.
1 //# ComponentImager.h: this defines ComponentImager, which ...
2 //# Copyright (C) 1999,2000,2003
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 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id: ComponentImager.h 20299 2008-04-03 05:56:44Z gervandiepen $
28 //#! ========================================================================
29 //#! Attention! Programmers read this!
30 //#!
31 //#! This file is a template to guide you in creating a header file
32 //#! for your new class. By following this template, you will create
33 //#! a permanent reference document for your class, suitable for both
34 //#! the novice client programmer, the seasoned veteran, and anyone in
35 //#! between. It is essential that you write the documentation portions
36 //#! of this file with as much care as you do the source code.
37 //#!
38 //#! If you are unfamilar with the AIPS++ header style please refer to
39 //#! template-class-h.
40 //#!
41 //#! Replacement Tokens
42 //#! ------------------
43 //#!
44 //#! These are character strings enclosed in angle brackets, on a commented
45 //#! line. Two are found on the first line of this file:
46 //#!
47 //#! <ClassFileName.h> <ClassName>
48 //#!
49 //#! You should remove the angle brackets, and replace the characters within
50 //#! the brackets with names specific to your class. Mimic the capitalization
51 //#! and punctuation of the original. For example, you would change
52 //#!
53 //#! <ClassFileName.h> to LatticeIter.h
54 //#! <ClassName> to LatticeIterator
55 //#!
56 //#! Another replacement token will be found in the "include guard" just
57 //#! a few lines below.
58 //#!
59 //#! #define <AIPS_CLASSFILENAME_H> to #define AIPS_LATTICEITER_H
60 //#!
61 
62 #ifndef IMAGES_COMPONENTIMAGER_H
63 #define IMAGES_COMPONENTIMAGER_H
64 
65 #include <casa/aips.h>
66 
69 
70 #include <memory>
71 
72 namespace casacore{
73 
74 template <class T> class ImageInterface;
75 class Unit;
76 class LogIO;
77 template <class T> class MeasRef;
78 class MDirection;
79 class MVAngle;
80 template <class T> class Vector;
81 class MVFrequency;
82 class MFrequency;
83 }
84 
85 namespace casa {
86 
87 
88 // <summary>
89 // </summary>
90 
91 // <use visibility=local>
92 
93 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
94 // </reviewed>
95 
96 // <prerequisite>
97 // <li> ImageInterface
98 // <li> ComponentList
99 // </prerequisite>
100 //
101 // <etymology>
102 // </etymology>
103 //
104 // <synopsis>
105 // Project the componentlist onto the image. If any of the coordinate
106 // transformations for a particular pixel fail (e.g. coordinate system
107 // is not defined for that pixel) if the image has a writable mask, then those
108 // pixels will be masked, otherwise they are just zeroed. Any pixels
109 // that are already masked mask=F) will not have their values changed
110 // (perhaps this behaviour should be changed).
111 // </synopsis>
112 //
113 // <example>
114 // </example>
115 //
116 // <motivation>
117 // </motivation>
118 
119 class ComponentImager: public ImageTask<casacore::Float> {
120 public:
121 
122  ComponentImager() = delete;
123 
125  const SPIIF image, const casacore::Record *const &regionPtr,
126  const casacore::String& maskInp
127  );
128 
130 
131  void setComponentList(const ComponentList& list) {
132  _list = list;
133  }
134 
136 
137  casacore::String getClass() const { return "ComponentImager"; }
138 
139  void modify(casacore::Bool verbose);
140 
141  // Project the componentlist onto the image. If any of the coordinate
142  // transformations for a particular pixel fail (e.g. coordinate system
143  // is not defined for that pixel) if the image has a writable mask, then those
144  // pixels will be masked, otherwise they are just zeroed. Any pixels
145  // that are already masked mask=F) will not have their values changed
146  // (perhaps this behaviour should be changed).
147  static void project(
149  const ComponentList& list
150  );
151 
152 private:
153  // we cannot use pointer stored in base class because that's const
155 
157 
159 
162  }
163 
164  std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
165  return std::vector<casacore::Coordinate::Type>(1, casacore::Coordinate::DIRECTION);
166  }
167 
168  static std::unique_ptr<ComponentList> _doPoints(
170  int longAxis, int latAxis, const casacore::Unit& fluxUnits,
171  const casacore::MeasRef<casacore::MDirection>& dirRef, const casacore::MVAngle& pixelLatSize,
172  const casacore::MVAngle& pixelLongSize, const casacore::Vector<casacore::MVFrequency>& freqValues,
173  const casacore::MeasRef<casacore::MFrequency>& freqRef, casacore::Int freqAxis, casacore::Int polAxis, casacore::uInt nStokes
174  );
175 
176 };
177 
178 }
179 
180 #endif
181 
182 
A Measure: astronomical direction.
Definition: MDirection.h:174
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
Internal value for MFrequency.
Definition: MVFrequency.h:97
casacore::String getClass() const
casacore::Bool _subtract
static void project(casacore::ImageInterface< casacore::Float > &image, const ComponentList &list)
Project the componentlist onto the image.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
Reference frame for physical measures.
Definition: MeasRef.h:42
defines physical units
Definition: Unit.h:189
A Measure: wave characteristics.
Definition: MFrequency.h:161
A base class for astronomical images.
SPIIF _image
we cannot use pointer stored in base class because that&#39;s const
CasacRegionManager::StokesControl _getStokesControl() const
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
void modify(casacore::Bool verbose)
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
std::shared_ptr< casacore::ImageInterface< casacore::Float > > SPIIF
Definition: ImageTypedefs.h:51
void setComponentList(const ComponentList &list)
A class for manipulating groups of components.
static std::unique_ptr< ComponentList > _doPoints(casacore::ImageInterface< casacore::Float > &image, const ComponentList &list, int longAxis, int latAxis, const casacore::Unit &fluxUnits, const casacore::MeasRef< casacore::MDirection > &dirRef, const casacore::MVAngle &pixelLatSize, const casacore::MVAngle &pixelLongSize, const casacore::Vector< casacore::MVFrequency > &freqValues, const casacore::MeasRef< casacore::MFrequency > &freqRef, casacore::Int freqAxis, casacore::Int polAxis, casacore::uInt nStokes)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Class to handle angle type conversions and I/O.
Definition: MVAngle.h:245
void setSubtract(casacore::Bool b)
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