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