ARTS  2.4.0(git:4fb77825)
fastem.cc
Go to the documentation of this file.
1 /* Copyright (C) 2002-2012
2  Sreerekha Ravi<rekha@sat.physik.uni-bremen.de>
3  Stefan Buehler <sbuehler@ltu.se>
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License as published by the
7  Free Software Foundation; either version 2, or (at your option) any
8  later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18  USA.
19 */
20 
30 /*===========================================================================
31  === External declarations
32  ===========================================================================*/
33 
34 #include <cmath>
35 #include <stdexcept>
36 #include "complex.h"
37 #include "exceptions.h"
38 #include "matpackI.h"
39 
40 using std::ostringstream;
41 using std::runtime_error;
42 
43 extern const Numeric PI;
44 extern const Numeric DEG2RAD;
45 extern const Numeric RAD2DEG;
46 
47 #ifdef ENABLE_FASTEM
48 extern "C" {
49 #endif
50 
51 void rttov_fastem5_(const Index& fastem_version,
52  const Numeric& frequency,
53  const Numeric& za,
54  const Numeric& temperature,
55  const Numeric& salinity,
56  const Numeric& wind_speed,
57  Numeric* emissivity,
58  Numeric* reflectivity,
59  const Numeric& transmittance,
60  const Numeric& rel_azimuth);
61 
62 #ifdef ENABLE_FASTEM
63 }
64 #endif
65 
66 // Define dummy function that throws a runtime error if ARTS is
67 // compiled without FASTEM support.
68 #ifndef ENABLE_FASTEM
69 void rttov_fastem5_(const Index&,
70  const Numeric&,
71  const Numeric&,
72  const Numeric&,
73  const Numeric&,
74  const Numeric&,
75  Numeric*,
76  Numeric*,
77  const Numeric&,
78  const Numeric&) {
79  throw std::runtime_error(
80  "This version of ARTS was compiled without FASTEM support.");
81 }
82 
83 #endif
84 
86 
107 void fastem( // Output:
108  Vector& emissivity,
109  Vector& reflectivity,
110  // Input:
111  const Numeric frequency,
112  const Numeric za,
113  const Numeric temperature,
114  const Numeric salinity,
115  const Numeric wind_speed,
116  const Numeric transmittance,
117  const Numeric rel_azimuth,
118  const Index fastem_version) {
119  emissivity.resize(4);
120  reflectivity.resize(4);
121 
122  rttov_fastem5_(fastem_version,
123  frequency / 1e9,
124  180 - za,
125  temperature,
126  salinity * 1e3,
127  wind_speed,
128  emissivity.get_c_array(),
129  reflectivity.get_c_array(),
130  transmittance,
131  rel_azimuth);
132 }
rttov_fastem5_
void rttov_fastem5_(const Index &fastem_version, const Numeric &frequency, const Numeric &za, const Numeric &temperature, const Numeric &salinity, const Numeric &wind_speed, Numeric *emissivity, Numeric *reflectivity, const Numeric &transmittance, const Numeric &rel_azimuth)
Definition: fastem.cc:69
RAD2DEG
const Numeric RAD2DEG
exceptions.h
The declarations of all the exception classes.
Vector::resize
void resize(Index n)
Resize function.
Definition: matpackI.cc:404
matpackI.h
Implementation of Matrix, Vector, and such stuff.
complex.h
A class implementing complex numbers for ARTS.
fastem
void fastem(Vector &emissivity, Vector &reflectivity, const Numeric frequency, const Numeric za, const Numeric temperature, const Numeric salinity, const Numeric wind_speed, const Numeric transmittance, const Numeric rel_azimuth, const Index fastem_version)
Calculate the surface emissivity using FASTEM.
Definition: fastem.cc:107
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
DEG2RAD
const Numeric DEG2RAD
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
PI
const Numeric PI
Vector
The Vector class.
Definition: matpackI.h:860
VectorView::get_c_array
const Numeric * get_c_array() const
Conversion to plain C-array, const-version.
Definition: matpackI.cc:272