00001 //# QC.h: physical constants with units 00002 //# Copyright (C) 1994,1995,1996,1997,1998,1999 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 //# $Id$ 00027 00028 #ifndef CASA_QC_H 00029 #define CASA_QC_H 00030 00031 00032 //# Includes 00033 #include <casacore/casa/aips.h> 00034 #include <casacore/casa/BasicSL/Constants.h> 00035 #include <casacore/casa/Quanta/Quantum.h> 00036 #include <casacore/casa/Quanta/UnitMap.h> 00037 00038 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00039 00040 //# Forward Declarations 00041 00042 //# Typedefs 00043 00044 // <summary> 00045 // Physical constants (i.e. dimensioned values) 00046 // </summary> 00047 00048 // <use visibility=export> 00049 00050 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tQuantum"> 00051 00052 // <prerequisite> 00053 // <li> <linkto class=Quantum>Quantum</linkto> 00054 // </prerequisite> 00055 00056 // <etymology> 00057 // A QC is based on the Quantum and C (constants) class 00058 // </etymology> 00059 00060 // <synopsis> 00061 // QC:name will produce a Quantity (Quantum<Double>) value consisting of 00062 // a value and a unit. See the <linkto class=Quantum>Quantum</linkto> class 00063 // for possibilities of manipulating quanta. 00064 // tQuantum will give a list of the currently available constants 00065 // </synopsis> 00066 00067 // <example> 00068 // To obtain the velocity of light in pc/a, use: 00069 // <srcblock> 00070 // #include <casacore/casa/Quanta.h> 00071 // Double vel_pcpy = (C::c).convert("pc/a").getValue(); 00072 // </srcblock> 00073 // </example> 00074 00075 //############################################################################ 00076 //# NOTE: Delete the following listing of the public data members when 00077 //# public data members are handled properly by the documentation 00078 //# extractor. 00079 //############################################################################ 00080 00081 // The following constants are defined as public data members of class QC. 00082 // 00083 // <note role=caution> 00084 // The following public data member documentation is currently extracted by 00085 // hand, and thus could be out of date if this documentation was not updated 00086 // when the class was modified. 00087 // </note> 00088 00089 // <srcblock> 00090 // 00091 // // vel of light 00092 // static Quantum<Double> c; 00093 // 00094 // // Gravitational constant 00095 // static Quantum<Double> G; 00096 // 00097 // // Planck 00098 // static Quantum<Double> h; 00099 // 00100 // // HI line 00101 // static Quantum<Double> HI; 00102 // 00103 // // Gas constant 00104 // static Quantum<Double> R; 00105 // 00106 // // Avogadro 00107 // static Quantum<Double> NA; 00108 // 00109 // // electron charge 00110 // static Quantum<Double> e; 00111 // 00112 // // proton mass 00113 // static Quantum<Double> mp; 00114 // 00115 // // mp/me 00116 // static Quantum<Double> mp_me; 00117 // 00118 // // permeability vacuum 00119 // static Quantum<Double> mu0; 00120 // 00121 // // permittivity vacuum 00122 // static Quantum<Double> epsilon0; 00123 // 00124 // // Boltzmann 00125 // static Quantum<Double> k; 00126 // 00127 // // Faraday 00128 // static Quantum<Double> F; 00129 // 00130 // // mass electron 00131 // static Quantum<Double> me; 00132 // 00133 // // radius electron 00134 // static Quantum<Double> re; 00135 // 00136 // // Bohr's radius 00137 // static Quantum<Double> a0; 00138 // 00139 // // Solar radius 00140 // static Quantum<Double> R0; 00141 // 00142 // // IAU Gaussian grav. const **2 00143 // static Quantum<Double> k2; 00144 // 00145 // // quarter turn = 90 degrees = pi/2 radians 00146 // static Quantum<Double> qTurn; 00147 // 00148 // // half turn = 180 degrees = pi radians 00149 // static Quantum<Double> hTurn; 00150 // 00151 // // full turn = 360 degrees = 2pi radians 00152 // static Quantum<Double> fTurn; 00153 // 00154 // </srcblock> 00155 00156 // <motivation> 00157 // Physical constants should be known with their proper dimensions 00158 // </motivation> 00159 // 00160 // <todo asof="941110"> 00161 // </todo> 00162 00163 class QC { 00164 friend class QC_init; 00165 public: 00166 00167 //# If you change any of the public data members, make the corresponding 00168 //# change above to the documentation of the public data members. 00169 00170 // vel of light 00171 static Quantum<Double> c; 00172 00173 // Gravitational constant 00174 static Quantum<Double> G; 00175 00176 // Planck 00177 static Quantum<Double> h; 00178 00179 // HI line 00180 static Quantum<Double> HI; 00181 00182 // Gas constant 00183 static Quantum<Double> R; 00184 00185 // Avogadro 00186 static Quantum<Double> NA; 00187 00188 // electron charge 00189 static Quantum<Double> e; 00190 00191 // proton mass 00192 static Quantum<Double> mp; 00193 00194 // mp/me 00195 static Quantum<Double> mp_me; 00196 00197 // permeability vacuum 00198 static Quantum<Double> mu0; 00199 00200 // permittivity vacuum 00201 static Quantum<Double> epsilon0; 00202 00203 // Boltzmann 00204 static Quantum<Double> k; 00205 00206 // Faraday 00207 static Quantum<Double> F; 00208 00209 // mass electron 00210 static Quantum<Double> me; 00211 00212 // radius electron 00213 static Quantum<Double> re; 00214 00215 // Bohr's radius 00216 static Quantum<Double> a0; 00217 00218 // Solar radius 00219 static Quantum<Double> R0; 00220 00221 // IAU Gaussian grav. const **2 00222 static Quantum<Double> k2; 00223 00224 // quarter turn = 90 degrees = pi/2 radians 00225 static Quantum<Double> qTurn; 00226 00227 // half turn = 180 degrees = pi radians 00228 static Quantum<Double> hTurn; 00229 00230 // full turn = 360 degrees = 2pi radians 00231 static Quantum<Double> fTurn; 00232 00233 private: 00234 // This function is used, in conjunction with the 00235 // <linkto class=QC_init>QC_init</linkto> 00236 // class to force construction of statics (see ARM 3.4). 00237 static void init(); 00238 }; 00239 00240 00241 // <summary> 00242 // Class used to force construction of <linkto class=QC>QC</linkto>. 00243 // </summary> 00244 00245 // <synopsis> 00246 // A static object of this class is used to make sure that 00247 // <linkto class=QC>QC</linkto> 00248 // is constructed before it is needed, and therefore that its static data 00249 // members are defined. See Meyers, p. 47. 00250 // </synopsis> 00251 00252 // <use visibility=local> 00253 00254 // <linkfrom anchor="QC_init" classes="QC"> 00255 // <here>QC_init</here> -- 00256 // Class used to force construction of <linkto class=QC>QC</linkto>. 00257 // </linkfrom> 00258 00259 class QC_init { 00260 public: 00261 QC_init(); 00262 ~QC_init(); 00263 private: 00264 static uShort count; 00265 }; 00266 00267 // <summary> 00268 // Object used to force construction of <linkto class=QC>QC</linkto>. 00269 // </summary> 00270 00271 // <synopsis> 00272 // This static object of the <linkto class=QC_init>QC_init</linkto> 00273 // class is used to make sure that 00274 // <linkto class=QC>QC</linkto> 00275 // is constructed before it is needed, and therefore that its static data 00276 // members are defined. See Meyers, p. 47. 00277 // </synopsis> 00278 00279 // <use visibility=local> 00280 00281 // <linkfrom anchor="QC initialization object" classes="QC QC_init"> 00282 // <here>QC initialization object</here> -- 00283 // Object used to force construction of <linkto class=QC>QC</linkto>. 00284 // </linkfrom> 00285 00286 // <group name="QC initialization object"> 00287 00288 static QC_init qc_init; 00289 00290 // </group> 00291 00292 //# Inline Implementations 00293 00294 00295 } //# NAMESPACE CASACORE - END 00296 00297 #endif