Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/ComponentType_8h_source.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 21:26:30 2011 Кодировка: Поисковые слова: polar ring |
00001 //# ComponentType.h: Enumerators common to the Components Module 00002 //# Copyright (C) 1997,1998,1999,2002 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library 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 Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 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 //# 00027 //# $Id: ComponentType.h 20299 2008-04-03 05:56:44Z gervandiepen $ 00028 00029 #ifndef COMPONENTS_COMPONENTTYPE_H 00030 #define COMPONENTS_COMPONENTTYPE_H 00031 00032 #include <casa/aips.h> 00033 namespace casac { 00034 class componentlist; 00035 }; 00036 namespace casa { //# NAMESPACE CASA - BEGIN 00037 00038 class String; 00039 class SkyCompRep; 00040 class ComponentShape; 00041 class SpectralModel; 00042 class componentlist; 00043 00044 // <summary>Enumerators common to the ComponentsModels module</summary> 00045 00046 // <use visibility=export> 00047 00048 // <reviewed reviewer="" date="yyyy/mm/dd" tests="tComponentType" demos=""> 00049 // </reviewed> 00050 00051 // <etymology> 00052 // This class contains the type definitions in the ComponentModels module 00053 // </etymology> 00054 00055 // <synopsis> 00056 // This class does nothing. It is merely a container for the enumerations used 00057 // by the ComponentModels module. These enumerations define the standard 00058 // component types. It also contains: 00059 // <ul> 00060 // <li> static functions which convert between these enumerators and strings. 00061 // <li> static functions which construct the appropriate derived object given 00062 // an enumerator. Note that these functions are only accessible by the 00063 // friend classes <linkto class=SkyCompRep>SkyCompRep</linkto> and 00064 // <linkto class=ComponentList>ComponentList</linkto> and should be 00065 // considered an implementation detail. 00066 // </ul> 00067 // The first element in the enumerator must be represented by zero and every 00068 // enumerator must contain as the second last and last elements an UNKNOWN_* 00069 // and NUMBER_* element. 00070 // </synopsis> 00071 00072 // <example> 00073 // See the documentation for the ComponentModels classes for examples on the 00074 // use of these enumerator and functions. For example the 00075 // <linkto class=ComponentShape>ComponentShape</linkto> class. 00076 // </example> 00077 00078 // <todo asof="1999/11/15"> 00079 // <li> Nothing I can think of. 00080 // </todo> 00081 // 00082 00083 class ComponentType { 00084 public: 00085 // Declare which classes access the private functions which convert 00086 // enumerators to objects. The private construct functions can only be 00087 // accessed by functions in the friend classes specified below. 00088 friend class SkyCompRep; 00089 friend class ::casac::componentlist; 00090 00091 // The shapes of all the components 00092 enum Shape { 00093 // A simple point component 00094 POINT = 0, 00095 // A elliptical Gaussian component 00096 GAUSSIAN, 00097 // A elliptical disk component 00098 DISK, 00099 // An unknown Component 00100 UNKNOWN_SHAPE, 00101 // The number of types in this enumerator 00102 NUMBER_SHAPES 00103 }; 00104 // The ways the Flux polarisation can be represented 00105 enum Polarisation { 00106 // The four Stokes parameters, ie I,Q,U,V 00107 STOKES = 0, 00108 // Linear polarisation feeds ie., XX,XY,YX,YY with zero parrallactic angle 00109 LINEAR, 00110 // Circular polarisation feeds ie., RR, RL, LR, LL 00111 CIRCULAR, 00112 // An unknown Component 00113 UNKNOWN_POLARISATION, 00114 // The number of types in this enumerator 00115 NUMBER_POLARISATIONS 00116 }; 00117 // The different functional forms for the spectral variation. 00118 enum SpectralShape { 00119 // The flux is constant at different frequencies 00120 CONSTANT_SPECTRUM = 0, 00121 // The flux varies as <src>I = I_0 * (nu / nu_0)^alpha</src> 00122 SPECTRAL_INDEX, 00123 // an unknown spectral type 00124 UNKNOWN_SPECTRAL_SHAPE, 00125 // The number of spectral types in this enumerator 00126 NUMBER_SPECTRAL_SHAPES 00127 }; 00128 // Convert the Shape enumerator to a string 00129 static String name(ComponentType::Shape shapeEnum); 00130 // Convert a given String to a Shape enumerator (min match active) 00131 static ComponentType::Shape shape(const String& shapeName); 00132 00133 // Convert the Polarisation enumerator to a string 00134 static String name(ComponentType::Polarisation fluxEnum); 00135 // Convert a given String to a Polarisation enumerator 00136 static ComponentType::Polarisation polarisation(const String& 00137 polarisationName); 00138 // Convert the SpectralShape enumerator to a string 00139 static String name(ComponentType::SpectralShape spectralEnum); 00140 // Convert a given String to a SpectralShape enumerator 00141 static ComponentType::SpectralShape spectralShape(const String& 00142 spectralName); 00143 private: 00144 00145 // Convert the Shape enumerator to a shape object (upcast to the base 00146 // object). Returns a null pointer if the object could not be 00147 // constructed. This will occur is the enumerator is UNKNOWN_SHAPE or 00148 // NUMBER_SHAPES or there is insufficient memory. The caller of this function 00149 // is responsible for deleting the pointer. 00150 static ComponentShape* construct(ComponentType::Shape shapeEnum); 00151 00152 // Convert the SpectralShape enumerator to a spectral model object (upcast to 00153 // the base object). Returns a null pointer if the object could not be 00154 // constructed. This will occur is the enumerator is UNKNOWN_SPECTRAL_SHAPE 00155 // or NUMBER_SPECTRAL_SHAPES or there is insufficient memory. The caller of 00156 // this function is responsible for deleting the pointer. 00157 static SpectralModel* construct(ComponentType::SpectralShape spectralEnum); 00158 }; 00159 00160 } //# NAMESPACE CASA - END 00161 00162 #endif