casacore
QC.h
Go to the documentation of this file.
1 //# QC.h: physical constants with units
2 //# Copyright (C) 1994,1995,1996,1997,1998,1999
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 //# $Id$
27 
28 #ifndef CASA_QC_H
29 #define CASA_QC_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/BasicSL/Constants.h>
35 #include <casacore/casa/Quanta/Quantum.h>
36 #include <casacore/casa/Quanta/UnitMap.h>
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 //# Forward Declarations
41 
42 //# Typedefs
43 
44 // <summary>
45 // Physical constants (i.e. dimensioned values)
46 // </summary>
47 
48 // <use visibility=export>
49 
50 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tQuantum">
51 
52 // <prerequisite>
53 // <li> <linkto class=Quantum>Quantum</linkto>
54 // </prerequisite>
55 
56 // <etymology>
57 // A QC is based on the Quantum and C (constants) class
58 // </etymology>
59 
60 // <synopsis>
61 // QC:name will produce a Quantity (Quantum&lt;Double&gt;) value consisting of
62 // a value and a unit. See the <linkto class=Quantum>Quantum</linkto> class
63 // for possibilities of manipulating quanta.
64 // tQuantum will give a list of the currently available constants
65 // </synopsis>
66 
67 // <example>
68 // To obtain the velocity of light in pc/a, use:
69 // <srcblock>
70 // #include <casacore/casa/Quanta.h>
71 // Double vel_pcpy = (C::c).convert("pc/a").getValue();
72 // </srcblock>
73 // </example>
74 
75 //############################################################################
76 //# NOTE: Delete the following listing of the public data members when
77 //# public data members are handled properly by the documentation
78 //# extractor.
79 //############################################################################
80 
81 // The following constants are defined as public data members of class QC.
82 //
83 // <note role=caution>
84 // The following public data member documentation is currently extracted by
85 // hand, and thus could be out of date if this documentation was not updated
86 // when the class was modified.
87 // </note>
88 
89 // <srcblock>
90 //
91 // // vel of light
92 // static Quantum<Double> c;
93 //
94 // // Gravitational constant
95 // static Quantum<Double> G;
96 //
97 // // Planck
98 // static Quantum<Double> h;
99 //
100 // // HI line
101 // static Quantum<Double> HI;
102 //
103 // // Gas constant
104 // static Quantum<Double> R;
105 //
106 // // Avogadro
107 // static Quantum<Double> NA;
108 //
109 // // electron charge
110 // static Quantum<Double> e;
111 //
112 // // proton mass
113 // static Quantum<Double> mp;
114 //
115 // // mp/me
116 // static Quantum<Double> mp_me;
117 //
118 // // permeability vacuum
119 // static Quantum<Double> mu0;
120 //
121 // // permittivity vacuum
122 // static Quantum<Double> epsilon0;
123 //
124 // // Boltzmann
125 // static Quantum<Double> k;
126 //
127 // // Faraday
128 // static Quantum<Double> F;
129 //
130 // // mass electron
131 // static Quantum<Double> me;
132 //
133 // // radius electron
134 // static Quantum<Double> re;
135 //
136 // // Bohr's radius
137 // static Quantum<Double> a0;
138 //
139 // // Solar radius
140 // static Quantum<Double> R0;
141 //
142 // // IAU Gaussian grav. const **2
143 // static Quantum<Double> k2;
144 //
145 // // quarter turn = 90 degrees = pi/2 radians
146 // static Quantum<Double> qTurn;
147 //
148 // // half turn = 180 degrees = pi radians
149 // static Quantum<Double> hTurn;
150 //
151 // // full turn = 360 degrees = 2pi radians
152 // static Quantum<Double> fTurn;
153 //
154 // </srcblock>
155 
156 // <motivation>
157 // Physical constants should be known with their proper dimensions
158 // </motivation>
159 //
160 // <todo asof="941110">
161 // </todo>
162 
163 class QC {
164 friend class QC_init;
165 public:
166 
167 //# If you change any of the public data members, make the corresponding
168 //# change above to the documentation of the public data members.
169 
170  // vel of light
172 
173  // Gravitational constant
175 
176  // Planck
178 
179  // HI line
181 
182  // Gas constant
184 
185  // Avogadro
187 
188  // electron charge
190 
191  // proton mass
193 
194  // mp/me
196 
197  // permeability vacuum
199 
200  // permittivity vacuum
202 
203  // Boltzmann
205 
206  // Faraday
208 
209  // mass electron
211 
212  // radius electron
214 
215  // Bohr's radius
217 
218  // Solar radius
220 
221  // IAU Gaussian grav. const **2
223 
224  // quarter turn = 90 degrees = pi/2 radians
226 
227  // half turn = 180 degrees = pi radians
229 
230  // full turn = 360 degrees = 2pi radians
232 
233 private:
234 // This function is used, in conjunction with the
235 // <linkto class=QC_init>QC_init</linkto>
236 // class to force construction of statics (see ARM 3.4).
237  static void init();
238 };
239 
240 
241 // <summary>
242 // Class used to force construction of <linkto class=QC>QC</linkto>.
243 // </summary>
244 
245 // <synopsis>
246 // A static object of this class is used to make sure that
247 // <linkto class=QC>QC</linkto>
248 // is constructed before it is needed, and therefore that its static data
249 // members are defined. See Meyers, p. 47.
250 // </synopsis>
251 
252 // <use visibility=local>
253 
254 // <linkfrom anchor="QC_init" classes="QC">
255 // <here>QC_init</here> --
256 // Class used to force construction of <linkto class=QC>QC</linkto>.
257 // </linkfrom>
258 
259 class QC_init {
260  public:
261  QC_init();
262  ~QC_init();
263  private:
264  static uShort count;
265 };
266 
267 // <summary>
268 // Object used to force construction of <linkto class=QC>QC</linkto>.
269 // </summary>
270 
271 // <synopsis>
272 // This static object of the <linkto class=QC_init>QC_init</linkto>
273 // class is used to make sure that
274 // <linkto class=QC>QC</linkto>
275 // is constructed before it is needed, and therefore that its static data
276 // members are defined. See Meyers, p. 47.
277 // </synopsis>
278 
279 // <use visibility=local>
280 
281 // <linkfrom anchor="QC initialization object" classes="QC QC_init">
282 // <here>QC initialization object</here> --
283 // Object used to force construction of <linkto class=QC>QC</linkto>.
284 // </linkfrom>
285 
286 // <group name="QC initialization object">
289 
290 // </group>
291 
292 //# Inline Implementations
293 
294 
295 } //# NAMESPACE CASACORE - END
296 
297 #endif
static Quantum< Double > h
Planck.
Definition: QC.h:177
static Quantum< Double > F
Faraday.
Definition: QC.h:207
static Quantum< Double > mu0
permeability vacuum
Definition: QC.h:198
static Quantum< Double > e
electron charge
Definition: QC.h:189
static Quantum< Double > epsilon0
permittivity vacuum
Definition: QC.h:201
friend class QC_init
Definition: QC.h:164
static Quantum< Double > fTurn
full turn = 360 degrees = 2pi radians
Definition: QC.h:231
static Quantum< Double > qTurn
quarter turn = 90 degrees = pi/2 radians
Definition: QC.h:225
static Quantum< Double > k2
IAU Gaussian grav.
Definition: QC.h:222
static void init()
This function is used, in conjunction with the QC_init class to force construction of statics (see A...
static Quantum< Double > NA
Avogadro.
Definition: QC.h:186
static Quantum< Double > HI
HI line.
Definition: QC.h:180
static Quantum< Double > G
Gravitational constant.
Definition: QC.h:174
static Quantum< Double > R
Gas constant.
Definition: QC.h:183
static Quantum< Double > R0
Solar radius.
Definition: QC.h:219
static Quantum< Double > c
vel of light
Definition: QC.h:171
Class used to force construction of QC .
Definition: QC.h:259
static Quantum< Double > k
Boltzmann.
Definition: QC.h:204
Physical constants (i.e. dimensioned values)
Definition: QC.h:163
static Quantum< Double > re
radius electron
Definition: QC.h:213
static Quantum< Double > hTurn
half turn = 180 degrees = pi radians
Definition: QC.h:228
static Quantum< Double > mp_me
mp/me
Definition: QC.h:195
static Quantum< Double > a0
Bohr&#39;s radius.
Definition: QC.h:216
static Quantum< Double > mp
proton mass
Definition: QC.h:192
static uShort count
Definition: QC.h:264
this file contains all the compiler specific defines
Definition: mainpage.dox:28
static Quantum< Double > me
mass electron
Definition: QC.h:210
unsigned short uShort
Definition: aipstype.h:46