ARTS 2.5.0 (git: 9ee3ac6c)
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 "matpack_complex.h"
37#include "exceptions.h"
38#include "matpackI.h"
39
40using std::ostringstream;
41using std::runtime_error;
42
43extern const Numeric PI;
44extern const Numeric DEG2RAD;
45extern const Numeric RAD2DEG;
46
47#ifdef ENABLE_FASTEM
48extern "C" {
49#endif
50
51void 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
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
107void 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}
const Numeric * get_c_array() const ARTS_NOEXCEPT
Conversion to plain C-array, const-version.
Definition: matpackI.cc:271
The Vector class.
Definition: matpackI.h:876
void resize(Index n)
Resize function.
Definition: matpackI.cc:408
The declarations of all the exception classes.
const Numeric RAD2DEG
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
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
const Numeric PI
const Numeric DEG2RAD
Implementation of Matrix, Vector, and such stuff.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33