casa
$Rev:20696$
|
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 <components/ComponentModels/GaussianBeam.h> 00035 00036 #include <casa/namespace.h> 00037 00038 namespace casa { 00039 00040 class PeakIntensityFluxDensityConverter : public ImageTask { 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 00066 // Specify image to get beam and coordinate info from 00067 PeakIntensityFluxDensityConverter( 00068 const ImageInterface<Float> *const image 00069 ); 00070 00071 // destructor 00072 ~PeakIntensityFluxDensityConverter(); 00073 00074 // set the source size using a GaussianShape object. Note that this in itself, 00075 // does not constrain the shape to be Gaussian, it is just used to set the size 00076 // (and puts the burden on the caller to do sanity checking by first constructing 00077 // a GaussianSource object). The position angle is not used. 00078 void setSize(const Angular2DGaussian& size) { _size = size; } 00079 00080 // set the component shape 00081 00082 void setShape(const String& shape) { _shape = ComponentType::shape(shape); } 00083 00084 void setShape (ComponentType::Shape shape) { _shape = shape; } 00085 00086 // Given the channel and polarization, determine which beam in the 00087 // image to use for the resolution area. 00088 void setBeam(Int channel, Int polarization); 00089 00090 Quantity fluxDensityToPeakIntensity( 00091 Bool& hadToMakeFakeBeam, const Quantity& fluxDensity 00092 ) const; 00093 00094 Quantity peakIntensityToFluxDensity( 00095 Bool& hadToMakeFakeBeam, const Quantity& fluxDensity 00096 ) const; 00097 00098 String getClass() const { 00099 static const String s = "PeakIntensityFluxDensityConverter"; 00100 return s; 00101 } 00102 00103 protected: 00104 inline CasacRegionManager::StokesControl _getStokesControl() const { 00105 return CasacRegionManager::USE_ALL_STOKES; 00106 } 00107 00108 inline vector<Coordinate::Type> _getNecessaryCoordinates() const { 00109 return vector<Coordinate::Type>(1, Coordinate::DIRECTION); 00110 } 00111 00112 private: 00113 00114 Angular2DGaussian _size; 00115 ComponentType::Shape _shape; 00116 GaussianBeam _beam; 00117 00118 00119 00120 }; 00121 } 00122 00123 #endif