ARTS 2.5.0 (git: 9ee3ac6c)
mc_antenna.h
Go to the documentation of this file.
1/* Copyright (C) 2005-2012 Cory Davis <cdavis@staffmail.ed.ac.uk>
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
28/*===========================================================================
29 === External declarations
30 ===========================================================================*/
31#ifndef mc_antenna_h
32#define mc_antenna_h
33
34#include <cmath>
35#include <stdexcept>
36#include "arts.h"
37#include "matpackI.h"
38#include "ppath.h"
39#include "rng.h"
40
45};
46
51class MCAntenna {
56
57 public:
59 : atype(),
60 sigma_aa(0.),
61 sigma_za(0.),
62 aa_grid(),
63 za_grid(),
64 G_lookup() { /* Nothing to do here */
65 }
66
71 void set_pencil_beam();
72
84 void set_gaussian(const Numeric& za_sigma, const Numeric& aa_sigma);
85
97 void set_gaussian_fwhm(const Numeric& za_fwhm, const Numeric& aa_fwhm);
98
114
123 AntennaType get_type() const;
124
142 void return_los(Numeric& wgt,
143 ConstMatrixView R_return,
144 ConstMatrixView R_enu2ant) const;
145
159 void draw_los(VectorView sampled_rte_los,
160 MatrixView R_los,
161 Rng& rng,
162 ConstMatrixView R_ant2enu,
163 ConstVectorView bore_sight_los) const;
164
165 AntennaType Type() const {return atype;}
166 Index Type(AntennaType x) {if (validType(x)) {atype = x; return EXIT_SUCCESS;} else return EXIT_FAILURE;}
167 static bool validType(AntennaType x) noexcept
168 {
170 return std::any_of(keys.cbegin(), keys.cend(), [x](auto y){return x == y;});
171 }
172 Numeric& saa() {return sigma_aa;}
173 Numeric& sza() {return sigma_za;};
174 Vector& aag() {return aa_grid;}
175 Vector& zag() {return za_grid;}
176 Matrix& G() {return G_lookup;}
177};
178
179ostream& operator<<(ostream& os, const MCAntenna& mca);
180
193Numeric ran_gaussian(Rng& rng, const Numeric sigma);
194
199
212void rotmat_enu(MatrixView R_ant2enu, ConstVectorView prop_los);
213
237void rotmat_stokes(MatrixView R_pra,
238 const Index& stokes_dim,
239 const Numeric& f1_dir,
240 const Numeric& f2_dir,
241 ConstMatrixView R_f1,
242 ConstMatrixView R_f2);
243
244#endif // mc_antenna_h
constexpr std::array< T, 1+sizeof...(Ts)> stdarrayify(const T &first, const Ts &... the_rest)
Make a std::array of a list of variables (must be 1-long at least)
Definition: array.h:374
The global header file for ARTS.
A constant view of a Matrix.
Definition: matpackI.h:1014
A constant view of a Vector.
Definition: matpackI.h:489
An Antenna object used by MCGeneral.
Definition: mc_antenna.h:51
AntennaType Type() const
Definition: mc_antenna.h:165
static bool validType(AntennaType x) noexcept
Definition: mc_antenna.h:167
Vector & zag()
Definition: mc_antenna.h:175
Matrix G_lookup
Definition: mc_antenna.h:55
Numeric sigma_aa
Definition: mc_antenna.h:53
Numeric & saa()
Definition: mc_antenna.h:172
Numeric sigma_za
Definition: mc_antenna.h:53
AntennaType atype
Definition: mc_antenna.h:52
void draw_los(VectorView sampled_rte_los, MatrixView R_los, Rng &rng, ConstMatrixView R_ant2enu, ConstVectorView bore_sight_los) const
draw_los.
Definition: mc_antenna.cc:178
Matrix & G()
Definition: mc_antenna.h:176
AntennaType get_type() const
AntennaType get_type.
Definition: mc_antenna.cc:141
void return_los(Numeric &wgt, ConstMatrixView R_return, ConstMatrixView R_enu2ant) const
return_los
Definition: mc_antenna.cc:143
Vector & aag()
Definition: mc_antenna.h:174
void set_lookup(ConstVectorView za_grid, ConstVectorView aa_grid, ConstMatrixView G_lookup)
set_lookup.
Definition: mc_antenna.cc:132
void set_gaussian(const Numeric &za_sigma, const Numeric &aa_sigma)
set_gaussian.
Definition: mc_antenna.cc:119
Vector aa_grid
Definition: mc_antenna.h:54
Vector za_grid
Definition: mc_antenna.h:54
void set_gaussian_fwhm(const Numeric &za_fwhm, const Numeric &aa_fwhm)
set_gaussian_fwhm.
Definition: mc_antenna.cc:125
void set_pencil_beam()
set_pencil_beam
Definition: mc_antenna.cc:117
Numeric & sza()
Definition: mc_antenna.h:173
Index Type(AntennaType x)
Definition: mc_antenna.h:166
The MatrixView class.
Definition: matpackI.h:1125
The Matrix class.
Definition: matpackI.h:1225
Definition: rng.h:554
The VectorView class.
Definition: matpackI.h:626
The Vector class.
Definition: matpackI.h:876
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
ostream & operator<<(ostream &os, const MCAntenna &mca)
Definition: mc_antenna.cc:243
Numeric ran_gaussian(Rng &rng, const Numeric sigma)
ran_gaussian.
Definition: mc_antenna.cc:38
AntennaType
Definition: mc_antenna.h:41
@ ANTENNA_TYPE_PENCIL_BEAM
Definition: mc_antenna.h:42
@ ANTENNA_TYPE_GAUSSIAN
Definition: mc_antenna.h:43
@ ANTENNA_TYPE_LOOKUP
Definition: mc_antenna.h:44
void rotmat_stokes(MatrixView R_pra, const Index &stokes_dim, const Numeric &f1_dir, const Numeric &f2_dir, ConstMatrixView R_f1, ConstMatrixView R_f2)
rotmat_stokes.
Definition: mc_antenna.cc:86
Numeric ran_uniform(Rng &rng)
ran_uniform.
Definition: mc_antenna.cc:55
void rotmat_enu(MatrixView R_ant2enu, ConstVectorView prop_los)
rotmat_enu.
Definition: mc_antenna.cc:63
Propagation path structure and functions.
member functions of the Rng class and gsl_rng code