PeakIntensityFluxDensityConverter.h

Go to the documentation of this file.
00001 //# tSubImage.cc: Test program for class SubImage
00002 //# Copyright (C) 1998,1999,2000,2001,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This program is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU General Public License as published by the Free
00007 //# Software Foundation; either version 2 of the License, or (at your option)
00008 //# any later version.
00009 //#
00010 //# This program is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00013 //# more details.
00014 //#
00015 //# You should have received a copy of the GNU General Public License along
00016 //# with this program; if not, write to the Free Software Foundation, Inc.,
00017 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: tSubImage.cc 20567 2009-04-09 23:12:39Z gervandiepen $
00027 
00028 #ifndef IMAGEANALYSIS_PEAKINTENSITYFLUXDENSITYCONVERTER_H
00029 #define IMAGEANALYSIS_PEAKINTENSITYFLUXDENSITYCONVERTER_H
00030 
00031 #include <imageanalysis/ImageAnalysis/ImageTask.h>
00032 
00033 #include <components/ComponentModels/ComponentType.h>
00034 #include <scimath/Mathematics/GaussianBeam.h>
00035 
00036 #include <casa/namespace.h>
00037 
00038 namespace casa {
00039 
00040 class PeakIntensityFluxDensityConverter : public ImageTask<Float> {
00041         // <summary>
00042         // Class for converting between peak intensity and flux density of a source
00043         // of specified shape.
00044         // </summary>
00045 
00046         // <reviewed reviewer="" date="" tests="" demos="">
00047         // </reviewed>
00048 
00049         // <prerequisite>
00050         // </prerequisite>
00051 
00052         // <etymology>
00053         // Collapses image.
00054         // </etymology>
00055 
00056         // <synopsis>
00057         // </synopsis>
00058 
00059         // <example>
00060         // <srcblock>
00061         // </srcblock>
00062         // </example>
00063 
00064 public:
00065     using Angular2DGaussian = GaussianBeam;
00066 
00067     // Specify image to get beam and coordinate info from
00068         PeakIntensityFluxDensityConverter(
00069                 const SPCIIF image
00070         );
00071 
00072         // destructor
00073         ~PeakIntensityFluxDensityConverter();
00074 
00075         // set the source size using a GaussianShape object. Note that this in itself,
00076         // does not constrain the shape to be Gaussian, it is just used to set the size
00077         // (and puts the burden on the caller to do sanity checking by first constructing
00078         // a GaussianSource object). The position angle is not used.
00079         void setSize(const Angular2DGaussian& size) { _size = size; }
00080 
00081         // set the component shape
00082 
00083         void setShape(const String& shape) { _shape = ComponentType::shape(shape); }
00084 
00085         void setShape (ComponentType::Shape shape) { _shape = shape; }
00086 
00087         // Given the channel and polarization, determine which beam in the
00088         // image to use for the resolution area.
00089         void setBeam(Int channel, Int polarization);
00090 
00091         Quantity fluxDensityToPeakIntensity(
00092                 Bool& hadToMakeFakeBeam, const Quantity& fluxDensity
00093         ) const;
00094 
00095         Quantity peakIntensityToFluxDensity(
00096                 Bool& hadToMakeFakeBeam, const Quantity& fluxDensity
00097         ) const;
00098 
00099         String getClass() const {
00100                 static const String s = "PeakIntensityFluxDensityConverter";
00101                 return s;
00102         }
00103 
00104 protected:
00105         inline  CasacRegionManager::StokesControl _getStokesControl() const {
00106                 return CasacRegionManager::USE_ALL_STOKES;
00107         }
00108 
00109         inline vector<Coordinate::Type> _getNecessaryCoordinates() const {
00110                 return vector<Coordinate::Type>(1, Coordinate::DIRECTION);
00111         }
00112 
00113 private:
00114 
00115         Angular2DGaussian _size;
00116         ComponentType::Shape _shape;
00117         GaussianBeam _beam;
00118 
00119 
00120 
00121 };
00122 }
00123 
00124 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1