casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Flux.h
Go to the documentation of this file.
1 //# Flux.h:
2 //# Copyright (C) 1998,1999,2000,2001
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: Flux.h 21130 2011-10-18 07:39:05Z gervandiepen $
28 
29 #ifndef COMPONENTS_FLUX_H
30 #define COMPONENTS_FLUX_H
31 
32 #include <casa/aips.h>
33 #include <casa/Arrays/Vector.h>
36 #include <casa/Quanta/Unit.h>
39 
40 namespace casacore{
41 
42 class RecordInterface;
43 template <class Qtype> class Quantum;
44 }
45 
46 namespace casa { //# NAMESPACE CASA - BEGIN
47 
48 
49 // <summary>A class that represents the Flux (copy semantics)</summary>
50 
51 // <use visibility=export>
52 
53 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
54 // </reviewed>
55 
56 // <prerequisite>
57 // <li> <linkto class="casacore::Vector">casacore::Vector</linkto>
58 // <li> <linkto class="casacore::Unit">casacore::Unit</linkto>
59 // </prerequisite>
60 //
61 // <etymology>
62 // This class actually contains the flux values as distinct from the Flux class
63 // which is a pointer to this class. Hence this class name is a shortening of
64 // "Flux Representation". The Flux class is probably of more general user
65 // utility as its reference semantics can cut down on the number of temporary
66 // objects that get constructed.
67 // </etymology>
68 //
69 // <synopsis>
70 // This class encapsulates three quantities that are needed to more completely
71 // represent the polarised flux of a component. These quantities are:
72 // <dl>
73 // <dt> Flux values.
74 // <dd> These are four numbers which are the numerical value of the flux in all
75 // four polarisations. The values can be represented in either single or
76 // double precision depending on the template type.
77 // <dt> Flux units.
78 // <dd> These are the units for the flux values. The units must have dimensions
79 // of W/m^2/Hz and are represented using the
80 // <linkto class="casacore::Unit">casacore::Unit</linkto> class. The most common unit is "Jy".
81 // <dt> Polarisation representation.
82 // <dd> This describes how the polarised flux is represented. It can be one of
83 // the following:
84 // <dl compact><dt>casacore::Stokes<dd>
85 // The flux is representing using the casacore::Stokes I, Q, U, V components
86 // respectively.
87 // <dt>Linear<dd>
88 // The flux is representing using the XX,XY,YX,YY correlation products
89 // resp. X and Y is the signal from linear feeds at zero parallactic
90 // angle.
91 // <dt>Circular<dd>
92 // The flux is representing using the RR,RL,LR,LL correlation products
93 // resp. R and L is the signal from right and left handed circular feeds.
94 // </dl>
95 // </dl>
96 // This class is templated but only two templated types are valid. These are:
97 // <ul>
98 // <li> T = Float
99 // <li> T = Double
100 // </ul>
101 // The template type defines the precision of the Flux Values.
102 //
103 // This class uses functions in the Flux class which convert between the
104 // different polarisation representations. They assume (until a decision has
105 // been made on this) that the total intensity is the average of the linear or
106 // circular correlation products. ie., <src>I = (RR+LL)/2 = (XX+YY)/2</src>.
107 //
108 // In order to represent the Flux using the circular or linear representations
109 // the Flux values need to be complex (eg.,<src>XY = I + iV, YX = I - iV</src>)
110 // This class does not require, or check a number of constraints such as
111 // <src>XY = conj(YX)</src> and hence it is possible to define a flux using a
112 // linear or circular representation that cannot be completely represented
113 // using the casacore::Stokes representation. Because this class stores the flux values
114 // as complex numbers there is no loss of accuracy when converting between
115 // different polarisation representations. But it discards the imaginary
116 // component of the flux when externally representing the flux using with a
117 // casacore::Stokes representation (eg., when calling the <src>value(casacore::Vector<T>&)</src>
118 // function).
119 //
120 // Because this class using casacore::Complex numbers with a precision that depends on
121 // the template type many of the function arguments are of type
122 // <src>casacore::NumericTraits<T></src>. This simply a type that maps to casacore::Complex if T is
123 // casacore::Float and casacore::DComplex if T is a Double. Because of problems with the the gnu
124 // compiler functions which use this type as an argument MUST be
125 // inline. Hopefully this problem will go away sometime.
126 // </synopsis>
127 //
128 // <example>
129 // The following example creates a FluxRep object using a casacore::Stokes representation
130 // and converts it to "WU" (Westerbork Units). After printing out the converted
131 // I flux it converts the Flux to a linear representation and prints out a
132 // casacore::Vector with the [XX,XY,YX,YY] values (still in "WU")
133 // <srcblock>
134 // FluxRep<casacore::Double> flux(1.0, 0.0, 0.0, 0.1); // I = 1.0, V = 0.1
135 // flux.convertUnit("WU");
136 // cout << "The I flux (in WU is)" << flux.value(0) << endl;
137 // flux.convertPol(ComponentType::LINEAR);
138 // cout << "The XX,XY,YX,YY flux (in WU is)" << flux.value() << endl;
139 // </srcblock>
140 // </example>
141 //
142 // <motivation>
143 // This class was needed to contain the flux in the ComponentModels module and
144 // centralizes a lot of code that would otherwise be duplicated in disparate
145 // places.
146 // </motivation>
147 //
148 // <thrown>
149 // <li> casacore::AipsError, When the Vectors are not of length 4 or when indices are
150 // greater than 4
151 // </thrown>
152 //
153 // <todo asof="1998/03/11">
154 // <li> get this class reviewed.
155 // </todo>
156 
157 template<class T> class FluxRep
158 {
159 public:
160 
161  // The default constructor makes an object with <src>I = 1, Q=U=V=0</src>,
162  // a casacore::Stokes representation, and units of "Jy".
163  FluxRep();
164 
165  // This constructor makes an object where I is specified and
166  // <src>Q=U=V=0</src>. It assumes a casacore::Stokes representation, and units of "Jy".
167  FluxRep(T i);
168 
169  // This constructor makes an object where I,Q,U,V are all specified. It
170  // assumes a casacore::Stokes representation, and units of "Jy".
171  FluxRep(T i, T q, T u, T v);
172 
173  // This constructor makes an object where the flux values and polarisation
174  // representation are specified. It assumes the units are "Jy".
180 
181  // This constructor makes an object where I,Q,U,V are all specified by a
182  // casacore::Vector that must have four elements. It assumes a casacore::Stokes representation,
183  // and units of "Jy".
184  FluxRep(const casacore::Vector<T>& flux);
185 
186  // This constructor makes an object where the flux values are all specified
187  // by a casacore::Vector that must have four elements. The polarisation representation
188  // must also be specified. It assumes the units are "Jy".
191 
192  // This constructor makes an object where the flux values are all specified
193  // by a casacore::Quantum<casacore::Vector> that must have four elements. The casacore::Quantum must have
194  // units that are dimensionally equivalent to the "Jy" and these are the
195  // units of the FluxRep object. A casacore::Stokes polarisation representation is
196  // assumed.
198 
199  // This constructor makes an object where the flux values are all specified
200  // by a casacore::Quantum<casacore::Vector> that must have four elements. The casacore::Quantum must have
201  // units that are dimensionally equivalent to the "Jy" and these are the
202  // units of the FluxRep object. The polarisation representation must also be
203  // specified.
204  FluxRep(const
207 
208  // The copy constructor uses copy semantics.
209  FluxRep(const FluxRep<T>& other);
210 
211  // The destructor is trivial
212  ~FluxRep();
213 
214  // The assignment operator uses copy semantics.
215  FluxRep<T>& operator=(const FluxRep<T>& other);
216 
217  // These two functions return the current units
218  // <group>
219  const casacore::Unit& unit() const;
220  void unit(casacore::Unit& unit) const;
221  // </group>
222 
223  // This function sets the current unit. It does NOT convert the flux values
224  // to correspond to the new unit. The new unit must be dimensionally
225  // equivalent to the "Jy".
226  void setUnit(const casacore::Unit& unit);
227 
228  // This function sets the current units to the supplied value and
229  // additionally converts the internal flux values to the correspond to the
230  // new unit.
231  void convertUnit(const casacore::Unit& unit);
232 
233  // These two functions return the current polarisation representation.
234  // <group>
236  void pol(ComponentType::Polarisation& pol) const;
237  // </group>
238 
239  // This function sets the current polarisation representation. It does NOT
240  // convert the flux values.
242 
243  // This function sets the current polarisation representation to the supplied
244  // value and additionally converts the internal flux values to the correspond
245  // to the new polarisation representation.
247 
248  // This function returns the flux values. The polarisation representation and
249  // units are in whatever is current.
251 
252  // This function returns the specified component of the flux values.
253  // The polarisation representation and units are in whatever is current.
255 
256  // This function returns the flux values after converting it to the Stokes
257  // representation. The units of the returned casacore::Vector are the current units.
258  void value(casacore::Vector<T>& value);
259 
260  // This function returns the flux values. The polarisation representation and
261  // units are in whatever is current.
263 
264  // This function returns the flux values after converting it to the Stokes
265  // representation. The units of the returned casacore::Quantum are the current units of
266  // the FluxRep object. The length of the casacore::Vector in the casacore::Quantum will be
267  // resized to 4 elements if it is not already that length.
269 
270  // This function returns the flux values. The units of the returned Quantum
271  // are the current units of the FluxRep object. Similarly the polarisation
272  // representation of the returned casacore::Quantum is the current polarisation
273  // representation. The length of the casacore::Vector in the casacore::Quantum will be resized to
274  // 4 elements if it is not already that length.
277 
278  // Return the flux value in a casacore::Quantum for the specified Stokes. Can convert
279  // to Jy if requested.
281 
282  // This function sets the Flux values assuming the supplied value represents
283  // the casacore::Stokes I flux in the current units. The other casacore::Stokes parameters are
284  // set to zero.
285  void setValue(T value);
286 
287  // This function sets the Flux values assuming the supplied values represent
288  // the flux in the casacore::Stokes representation and is in the current units. The
289  // casacore::Vector must have four elements.
290  void setValue(const casacore::Vector<T>& value);
291 
292  // This function sets the Flux values assuming the supplied values represent
293  // the flux in the current representation and units. The casacore::Vector must have
294  // four elements.
296 
297  // This function sets the flux values and units assuming the supplied values
298  // represent the flux in the casacore::Stokes representation. The units of the Quantum
299  // must be dimensionally equivalent to the "Jy" and the casacore::Vector must have four
300  // elements.
301  void setValue(const casacore::Quantum<casacore::Vector<T> >& value);
302 
303  // This function sets the flux values, units and polarisation assuming the
304  // supplied values represent the flux in the specified representation. The
305  // units of the casacore::Quantum must be dimensionally equivalent to the "Jy" and the
306  // casacore::Vector must have four elements.
307  void setValue(const
310 
311  // Set flux for given casacore::Stokes from Quantum.
312  void setValue (const casacore::Quantum<T>& value, casacore::Stokes::StokesTypes stokes);
313 
314  // Scale the Flux value by the specified amount. These functions multiply the
315  // flux values irrespective of the current polarisation representation. If
316  // only one scale factor is supplied then only the first component of the
317  // flux is scaled.
318  // <group>
319  void scaleValue(const T& factor);
320  void scaleValue(const T& factor0, const T& factor1,
321  const T& factor2, const T& factor3);
322  void scaleValue(const typename casacore::NumericTraits<T>::ConjugateType& factor);
323  void scaleValue(const typename casacore::NumericTraits<T>::ConjugateType& factor0,
324  const typename casacore::NumericTraits<T>::ConjugateType& factor1,
325  const typename casacore::NumericTraits<T>::ConjugateType& factor2,
326  const typename casacore::NumericTraits<T>::ConjugateType& factor3);
327  // </group>
328 
329  // Set/get the errors in the flux
330  // <group>
331  void setErrors(const typename casacore::NumericTraits<T>::ConjugateType& error0,
332  const typename casacore::NumericTraits<T>::ConjugateType& error1,
333  const typename casacore::NumericTraits<T>::ConjugateType& error2,
334  const typename casacore::NumericTraits<T>::ConjugateType& error3);
335 
337 
339  // </group>
340 
341  // This functions convert between a casacore::RecordInterface and a FluxRep object and
342  // define how the FluxRep is represented in glish. They return false if the
343  // casacore::RecordInterface is malformed and append an error message to the supplied
344  // string giving the reason.
345  // <group>
348  // </group>
349 
350  // casacore::Function which checks the internal data of this class for correct
351  // dimensionality and consistent values. Returns true if everything is fine
352  // otherwise returns false.
353  casacore::Bool ok() const;
354 
355 private:
360  static const std::vector<casacore::Unit> _allowedUnits;
361 
362  // returns the conversion unit to which <src>unit</src> conforms.
363  // If <src>unit</src> does not conform to a supported unit, an
364  // exception is thrown.
366 
367 };
368 
369 // <summary>A class that represents the Flux (reference semantics)</summary>
370 
371 // <use visibility=export>
372 
373 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
374 // </reviewed>
375 
376 // <prerequisite>
377 // <li> <linkto class="casacore::Vector">casacore::Vector</linkto>
378 // <li> <linkto class="casacore::Unit">casacore::Unit</linkto>
379 // <li> <linkto class="FluxRep">FluxRep</linkto>
380 // </prerequisite>
381 //
382 // <etymology>
383 // The Flux class is used to represent the flux of a component on the sky
384 // </etymology>
385 //
386 // <synopsis>
387 
388 // This class is nearly identical to the <linkto
389 // class="FluxRep">FluxRep</linkto> class and the reader is referred to the
390 // documentation of this class for a general explanation of this class. Most
391 // of the functions in this class just call the functions in the FluxRep class.
392 
393 // There are two important differences between the Flux class and the FluxRep
394 // class.
395 // <ul>
396 // <li> This class uses reference semantics rather than copy semantics. This
397 // aids in cutting down on the number of temporary objects that need to be
398 // constructed. An example of this is illustrated in the examples section
399 // below.
400 // <li> This class contains functions for converting between different
401 // polarisation representations.
402 // </ul>
403 // The functions for converting between different polarisation representations
404 // require that the supplied and returned vector have all four polarisations.
405 // In the casacore::Stokes representation the order of the elements is I,Q,U,V, in the
406 // linear representation it is XX,XY,YX,YY, and in the circular representation
407 // it is RR,RL,LR,LL.
408 //
409 // These functions will correctly convert between Linear/Circular
410 // representations and the casacore::Stokes representation even if the linear or circular
411 // polarisation cannot represent a physically realisable polarisation (eg if
412 // <src>XY != conj(YX)</src>). In these cases the stokes representation will
413 // have an imaginary component and be complex. When converting the complex
414 // casacore::Stokes representation to a real one the imaginary components are simply
415 // discarded.
416 // </synopsis>
417 //
418 // <example>
419 // The function in this example calculates the total flux of all the
420 // components in a list. It accumulates the flux in a casacore::Vector after ensuring
421 // that the flux is in the appropriate units and Polarisation. It then returns
422 // the sum as a Flux object. Because this class uses reference semantics the
423 // returned object is passed by reference and hence this is a relatively cheap
424 // operation.
425 // <srcblock>
426 // Flux<casacore::Double> totalFlux(ComponentList& list) {
427 // casacore::Vector<casacore::DComplex> sum(4, casacore::DComplex(0.0, 0.0));
428 // for (casacore::uInt i = 0; i < list.nelements(); i++) {
429 // list.component(i).flux().convertPol(ComponentType::STOKES);
430 // list.component(i).flux().convertUnit("Jy");
431 // sum += list.component(i).flux().value()
432 // }
433 // return Flux<casacore::Double>(value, ComponentType::STOKES);
434 // }
435 // </srcblock>
436 // </example>
437 //
438 // <motivation>
439 // This class was needed to contain the flux in the ComponentModels class. It
440 // centralizes a lot of code that would otherwise be duplicated. The reference
441 // semantics further simplify the interface that the component classes use.
442 // </motivation>
443 //
444 // <thrown>
445 // <li> casacore::AipsError, When the Vectors are not of length 4 or when indices are
446 // greater than 4
447 // </thrown>
448 //
449 // <todo asof="1998/03/11">
450 // <li> get this class reviewed.
451 // </todo>
452 
453 template<class T> class Flux
454 {
455 public:
456  // The default constructor makes an object with <src>I = 1, Q=U=V=0</src>,
457  // a casacore::Stokes representation, and units of "Jy".
458  Flux();
459 
460  // The default constructor makes an object with <src>I = 1, Q=U=V=0</src>,
461  // a casacore::Stokes representation, and units of "Jy".
462  Flux(T i);
463 
464  // This constructor makes an object where I,Q,U,V are all specified. It
465  // assumes a casacore::Stokes representation, and units of "Jy".
466  Flux(T i, T q, T u, T v);
467 
468  // This constructor makes an object where the flux values and polarisation
469  // representation are specified. It assumes the units are "Jy".
475 
476  // This constructor makes an object where I,Q,U,V are all specified by a
477  // casacore::Vector that must have four elements. It assumes a casacore::Stokes representation,
478  // and units of "Jy".
479  Flux(const casacore::Vector<T>& flux);
480 
481  // This constructor makes an object where the flux values are all specified
482  // by a casacore::Vector that must have four elements. The polarisation representation
483  // must also be specified. It assumes the units are "Jy".
486 
487  // This constructor makes an object where the flux values are all specified
488  // by a casacore::Quantum<casacore::Vector> that must have four elements. The casacore::Quantum must have
489  // units that are dimensionally equivalent to the "Jy" and these are the
490  // units of the FluxRep object. A casacore::Stokes polarisation representation is
491  // assumed.
493 
494  // This constructor makes an object where the flux values are all specified
495  // by a casacore::Quantum<casacore::Vector> that must have four elements. The casacore::Quantum must have
496  // units that are dimensionally equivalent to the "Jy" and these are the
497  // units of the FluxRep object. The polarisation representation must also be
498  // specified.
501 
502  // The copy constructor uses reference semantics.
503  Flux(const Flux<T>& other);
504 
505  // The destructor is trivial
506  ~Flux();
507 
508  // The assignment operator uses reference semantics.
509  Flux<T>& operator=(const Flux<T>& other);
510 
511  // Return a distinct copy of this flux. As both the assignment operator
512  // and the copy constructor use reference semantics this is the only way to
513  // get a real copy.
514  Flux<T> copy() const;
515 
516  // These two functions return the current units.
517  // <group>
518  const casacore::Unit& unit() const;
519  void unit(casacore::Unit& unit) const;
520  // </group>
521 
522  // This function sets the current unit. It does NOT convert the flux values
523  // to correspond to the new unit. The new unit must be dimensionally
524  // equivalent to the "Jy".
525  void setUnit(const casacore::Unit& unit);
526 
527  // This function sets the current units to the supplied value and
528  // additionally converts the internal flux values to the correspond to the
529  // new unit.
530  void convertUnit(const casacore::Unit& unit);
531 
532  // These two functions return the current polarisation representation.
533  // <group>
535  void pol(ComponentType::Polarisation& pol) const;
536  // </group>
537 
538  // This function sets the current polarisation representation. It does NOT
539  // convert the flux values.
541 
542  // This function sets the current polarisation representation to the supplied
543  // value and additionally converts the internal flux values to the correspond
544  // to the new polarisation representation.
546 
547  // This function returns the flux values. The polarisation representation and
548  // units are in whatever is current.
550 
551  // This function returns the specified component of the flux values.
552  // The polarisation representation and units are in whatever is current.
554 
555  // This function returns the flux values after converting it to the Stokes
556  // representation. The units of the returned casacore::Vector are the current units.
558 
559  // This function returns the flux values. The polarisation representation and
560  // units are in whatever is current.
562 
563  // This function returns the flux values after converting it to the Stokes
564  // representation. The units of the returned casacore::Quantum are the current units of
565  // the FluxRep object. The length of the casacore::Vector in the casacore::Quantum will be
566  // resized to 4 elements if it is not already that length.
568 
569  // This function returns the flux values. The units of the returned Quantum
570  // are the current units of the FluxRep object. Similarly the polarisation
571  // representation of the returned casacore::Quantum is the current polarisation
572  // representation. The length of the casacore::Vector in the casacore::Quantum will be resized to
573  // 4 elements if it is not already that length.
576 
577  // Return the flux value in a casacore::Quantum for the specified Stokes. Can convert
578  // to Jy if requested.
580 
581  // This function sets the Flux values assuming the supplied value represents
582  // the casacore::Stokes I flux in the current units. The other casacore::Stokes parameters are
583  // set to zero.
584  void setValue(T value);
585 
586  // This function sets the Flux values assuming the supplied values represent
587  // the flux in the casacore::Stokes representation and is in the current units. The
588  // casacore::Vector must have four elements.
589  void setValue(const casacore::Vector<T>& value);
590 
591  // This function sets the Flux values assuming the supplied values represent
592  // the flux in the current representation and units. The casacore::Vector must have
593  // four elements.
595 
596  // This function sets the flux values and units assuming the supplied values
597  // represent the flux in the casacore::Stokes representation. The units of the Quantum
598  // must be dimensionally equivalent to the "Jy" and the casacore::Vector must have four
599  // elements.
601 
602  // This function sets the flux values, units and polarisation assuming the
603  // supplied values represent the flux in the specified representation. The
604  // units of the casacore::Quantum must be dimensionally equivalent to the "Jy" and the
605  // casacore::Vector must have four elements.
606  void setValue(const
609 
610 // Set flux for given casacore::Stokes from Quantum.
612 
613  // Scale the Flux value by the specified amount. These functions multiply the
614  // flux values irrespective of the current polarisation representation. If
615  // only one scale factor is supplied then only the first component of the
616  // flux is scaled.
617  // <group>
618  void scaleValue(const T& factor);
619  void scaleValue(const T& factor0, const T& factor1,
620  const T& factor2, const T& factor3);
621  void scaleValue(const typename casacore::NumericTraits<T>::ConjugateType& factor);
622  void scaleValue(const typename casacore::NumericTraits<T>::ConjugateType& factor0,
623  const typename casacore::NumericTraits<T>::ConjugateType& factor1,
624  const typename casacore::NumericTraits<T>::ConjugateType& factor2,
625  const typename casacore::NumericTraits<T>::ConjugateType& factor3);
626  // </group>
627 
628  // Set/get the errors in the flux
629  // <group>
630  void setErrors(const typename casacore::NumericTraits<T>::ConjugateType& error0,
631  const typename casacore::NumericTraits<T>::ConjugateType& error1,
632  const typename casacore::NumericTraits<T>::ConjugateType& error2,
633  const typename casacore::NumericTraits<T>::ConjugateType& error3);
634 
636 
638  // </group>
639 
640  // This functions convert between a casacore::RecordInterface and a Flux object and
641  // define how the Flux is represented in glish. They return false if the
642  // casacore::RecordInterface is malformed and append an error message to the supplied
643  // string giving the reason.
644  // <group>
647  // </group>
648 
649  // casacore::Function which checks the internal data of this class for correct
650  // dimensionality and consistent values. Returns true if everything is fine
651  // otherwise returns false.
652  casacore::Bool ok() const;
653 
654  // This function converts between a casacore::Vector in casacore::Stokes representation and one
655  // in Circular representation.
656  static void
658  const casacore::Vector<T>& in);
659 
660  // This function converts between a casacore::Vector in casacore::Stokes representation and one
661  // in Circular representation. The imaginary components of the casacore::Stokes vector
662  // are NOT ignored.
663  static void
665  const
667 
668  // This function converts between a casacore::Vector in Circular representation and one
669  // in casacore::Stokes representation. The imaginary components of the casacore::Stokes vector
670  // are discarded.
671  static
673  const
675 
676  // This function converts between a casacore::Vector in Circular representation and one
677  // in casacore::Stokes representation. The imaginary components of the casacore::Stokes vector
678  // are NOT ignored.
679  static
681  const
683 
684  // This function converts between a casacore::Vector in casacore::Stokes representation and one
685  // in Linear representation.
686  static void
688  const casacore::Vector<T>& in);
689 
690  // This function converts between a casacore::Vector in casacore::Stokes representation and one
691  // in Linear representation. The imaginary components of the casacore::Stokes vector
692  // are NOT ignored.
693  static
695  const
697 
698  // This function converts between a casacore::Vector in Linear representation and one
699  // in casacore::Stokes representation. The imaginary components of the casacore::Stokes vector
700  // are discarded.
701  static void
703  const
705 
706  // This function converts between a casacore::Vector in Linear representation and one
707  // in casacore::Stokes representation. The imaginary components of the casacore::Stokes vector
708  // are NOT ignored.
709  static void
712 
713  // This function converts between a casacore::Vector in Linear representation and one
714  // in Circular representation.
715  static void
717  const
719 
720  // This function converts between a casacore::Vector in Circular representation and one
721  // in Linear representation.
722  static void
724  const
726 
727 private:
729 };
730 
731 
732 } //# NAMESPACE CASA - END
733 
734 #ifndef CASACORE_NO_AUTO_TEMPLATES
735 #include <components/ComponentModels/Flux.tcc>
736 #endif //# CASACORE_NO_AUTO_TEMPLATES
737 #endif
static void circularToLinear(casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in)
This function converts between a casacore::Vector in Circular representation and one in Linear repres...
A 1-D Specialization of the Array class.
casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > itsVal
Definition: Flux.h:356
casacore::CountedPtr< FluxRep< T > > itsFluxPtr
Definition: Flux.h:728
ComponentType::Polarisation itsPol
Definition: Flux.h:357
ComponentType::Polarisation pol() const
These two functions return the current polarisation representation.
static void linearToStokes(casacore::Vector< T > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in)
This function converts between a casacore::Vector in Linear representation and one in casacore::Stoke...
Flux()
The default constructor makes an object with I = 1, Q=U=V=0, a casacore::Stokes representation, and units of &quot;Jy&quot;.
void convertUnit(const casacore::Unit &unit)
This function sets the current units to the supplied value and additionally converts the internal flu...
const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & value() const
This function returns the flux values.
FluxRep()
The default constructor makes an object with I = 1, Q=U=V=0, a casacore::Stokes representation, and units of &quot;Jy&quot;.
casacore::Bool ok() const
casacore::Function which checks the internal data of this class for correct dimensionality and consis...
void scaleValue(const T &factor)
Scale the Flux value by the specified amount.
FluxRep< T > & operator=(const FluxRep< T > &other)
The assignment operator uses copy semantics.
void convertPol(ComponentType::Polarisation pol)
This function sets the current polarisation representation to the supplied value and additionally con...
Flux< T > & operator=(const Flux< T > &other)
The assignment operator uses reference semantics.
static casacore::Unit _getConversionUnit(const casacore::Unit &unit)
returns the conversion unit to which unit conforms.
A class that represents the Flux (copy semantics)
Definition: Flux.h:157
void setPol(ComponentType::Polarisation pol)
This function sets the current polarisation representation.
ComponentType::Polarisation pol() const
These two functions return the current polarisation representation.
void setErrors(const typename casacore::NumericTraits< T >::ConjugateType &error0, const typename casacore::NumericTraits< T >::ConjugateType &error1, const typename casacore::NumericTraits< T >::ConjugateType &error2, const typename casacore::NumericTraits< T >::ConjugateType &error3)
Set/get the errors in the flux.
StokesTypes
The Stokes types are defined by this enum.
Definition: Stokes.h:66
static void circularToStokes(casacore::Vector< T > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in)
This function converts between a casacore::Vector in Circular representation and one in casacore::Sto...
static const std::vector< casacore::Unit > _allowedUnits
Definition: Flux.h:360
defines physical units
Definition: Unit.h:189
static void stokesToLinear(casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< T > &in)
This function converts between a casacore::Vector in casacore::Stokes representation and one in Linea...
Char ConjugateType
Conjugate (real&lt;-&gt;complex) type.
void setValue(T value)
This function sets the Flux values assuming the supplied value represents the casacore::Stokes I flux...
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
A class that represents the Flux (reference semantics)
Definition: SkyCompBase.h:57
~FluxRep()
The destructor is trivial.
casacore::Bool fromRecord(casacore::String &errorMessage, const casacore::RecordInterface &record)
This functions convert between a casacore::RecordInterface and a FluxRep object and define how the Fl...
void setUnit(const casacore::Unit &unit)
This function sets the current unit.
void setPol(ComponentType::Polarisation pol)
This function sets the current polarisation representation.
casacore::Bool fromRecord(casacore::String &errorMessage, const casacore::RecordInterface &record)
This functions convert between a casacore::RecordInterface and a Flux object and define how the Flux ...
void convertUnit(const casacore::Unit &unit)
This function sets the current units to the supplied value and additionally converts the internal flu...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const casacore::Unit & unit() const
These two functions return the current units.
Quantities (i.e. dimensioned values)
Definition: QuantumHolder.h:44
casacore::Bool toRecord(casacore::String &errorMessage, casacore::RecordInterface &record) const
void scaleValue(const T &factor)
Scale the Flux value by the specified amount.
casacore::Bool toRecord(casacore::String &errorMessage, casacore::RecordInterface &record) const
const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & errors() const
static void stokesToCircular(casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< T > &in)
This function converts between a casacore::Vector in casacore::Stokes representation and one in Circu...
~Flux()
The destructor is trivial.
casacore::Bool ok() const
casacore::Function which checks the internal data of this class for correct dimensionality and consis...
casacore::Unit itsUnit
Definition: Flux.h:358
const casacore::Unit & unit() const
These two functions return the current units.
Polarisation
The ways the Flux polarisation can be represented.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setErrors(const typename casacore::NumericTraits< T >::ConjugateType &error0, const typename casacore::NumericTraits< T >::ConjugateType &error1, const typename casacore::NumericTraits< T >::ConjugateType &error2, const typename casacore::NumericTraits< T >::ConjugateType &error3)
Set/get the errors in the flux.
static void linearToCircular(casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &out, const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > &in)
This function converts between a casacore::Vector in Linear representation and one in Circular repres...
const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & errors() const
Flux< T > copy() const
Return a distinct copy of this flux.
Abstract base class for Record classes.
void convertPol(ComponentType::Polarisation pol)
This function sets the current polarisation representation to the supplied value and additionally con...
casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > itsErr
Definition: Flux.h:359
const casacore::Vector< typename casacore::NumericTraits< T >::ConjugateType > & value() const
This function returns the flux values.
void setValue(T value)
This function sets the Flux values assuming the supplied value represents the casacore::Stokes I flux...
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
void setUnit(const casacore::Unit &unit)
This function sets the current unit.