ARTS  2.3.1285(git:92a29ea9-dirty)
m_conversion.h
Go to the documentation of this file.
1 /* Copyright (C) 2012 Claudia Emde <claudia.emde@lmu.de>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
27 #ifndef m_conversion_h
28 #define m_conversion_h
29 
30 extern const Numeric SPEED_OF_LIGHT;
31 extern const Numeric PI;
32 
33 /* Workspace method: Doxygen documentation will be auto-generated */
34 inline void FrequencyFromWavelength( // WS Generic Output
35  Numeric& frequency,
36  // WS Generic Input
37  const Numeric& wavelength,
38  const Verbosity&) {
39  // Convert from wavelength to frequency
40  frequency = SPEED_OF_LIGHT / wavelength;
41 }
42 
43 /* Workspace method: Doxygen documentation will be auto-generated */
44 inline void FrequencyFromWavelength( // WS Generic Output
45  Vector& frequency,
46  // WS Generic Input
47  const Vector& wavelength,
48  const Verbosity&) {
49  frequency.resize(wavelength.nelem());
50  // Convert from wavelength to frequency
51  for (Index i = 0; i < wavelength.nelem(); i++)
52  frequency[i] = SPEED_OF_LIGHT / wavelength[i];
53 }
54 
55 /* Workspace method: Doxygen documentation will be auto-generated */
56 inline void FrequencyFromCGSAngularWavenumber( // WS Generic Output
57  Numeric& frequency,
58  // WS Generic Input
59  const Numeric& angular_wavenumber,
60  const Verbosity&) {
61  frequency = SPEED_OF_LIGHT * angular_wavenumber / (2 * PI) * 100;
62 }
63 
64 /* Workspace method: Doxygen documentation will be auto-generated */
65 inline void FrequencyFromCGSAngularWavenumber( // WS Generic Output
66  Vector& frequency,
67  // WS Generic Input
68  const Vector& angular_wavenumber,
69  const Verbosity&) {
70  frequency.resize(angular_wavenumber.nelem());
71  // Convert from angular wavenumber to frequency
72  for (Index i = 0; i < angular_wavenumber.nelem(); i++)
73  frequency[i] = SPEED_OF_LIGHT * angular_wavenumber[i] / (2 * PI) * 100;
74 }
75 
76 /* Workspace method: Doxygen documentation will be auto-generated */
77 inline void FrequencyFromCGSKayserWavenumber( // WS Generic Output
78  Numeric& frequency,
79  // WS Generic Input
80  const Numeric& kayser_wavenumber,
81  const Verbosity&) {
82  frequency = SPEED_OF_LIGHT * kayser_wavenumber * 100;
83 }
84 
85 /* Workspace method: Doxygen documentation will be auto-generated */
86 inline void FrequencyFromCGSKayserWavenumber( // WS Generic Output
87  Vector& frequency,
88  // WS Generic Input
89  const Vector& kayser_wavenumber,
90  const Verbosity&) {
91  frequency.resize(kayser_wavenumber.nelem());
92  // Convert from Kayser wavenumber to frequency
93  for (Index i = 0; i < kayser_wavenumber.nelem(); i++)
94  frequency[i] = SPEED_OF_LIGHT * kayser_wavenumber[i] * 100;
95 }
96 
97 #endif /* m_conversion_h */
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
The Vector class.
Definition: matpackI.h:860
void FrequencyFromCGSAngularWavenumber(Numeric &frequency, const Numeric &angular_wavenumber, const Verbosity &)
WORKSPACE METHOD: FrequencyFromCGSAngularWavenumber.
Definition: m_conversion.h:56
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:51
const Numeric PI
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
void FrequencyFromWavelength(Numeric &frequency, const Numeric &wavelength, const Verbosity &)
WORKSPACE METHOD: FrequencyFromWavelength.
Definition: m_conversion.h:34
void FrequencyFromCGSKayserWavenumber(Numeric &frequency, const Numeric &kayser_wavenumber, const Verbosity &)
WORKSPACE METHOD: FrequencyFromCGSKayserWavenumber.
Definition: m_conversion.h:77
void resize(Index n)
Resize function.
Definition: matpackI.cc:404
const Numeric SPEED_OF_LIGHT