ARTS  2.3.1285(git:92a29ea9-dirty)
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 
51 class 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 
111  void set_lookup(ConstVectorView za_grid,
112  ConstVectorView aa_grid,
113  ConstMatrixView G_lookup);
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 
179 ostream& operator<<(ostream& os, const MCAntenna& mca);
180 
193 Numeric ran_gaussian(Rng& rng, const Numeric sigma);
194 
198 Numeric ran_uniform(Rng& rng);
199 
212 void rotmat_enu(MatrixView R_ant2enu, ConstVectorView prop_los);
213 
237 void 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
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
The VectorView class.
Definition: matpackI.h:610
Numeric & saa()
Definition: mc_antenna.h:172
AntennaType Type() const
Definition: mc_antenna.h:165
Index Type(AntennaType x)
Definition: mc_antenna.h:166
void set_gaussian(const Numeric &za_sigma, const Numeric &aa_sigma)
set_gaussian.
Definition: mc_antenna.cc:119
The Vector class.
Definition: matpackI.h:860
The MatrixView class.
Definition: matpackI.h:1093
Numeric ran_uniform(Rng &rng)
ran_uniform.
Definition: mc_antenna.cc:55
Numeric ran_gaussian(Rng &rng, const Numeric sigma)
ran_gaussian.
Definition: mc_antenna.cc:38
ostream & operator<<(ostream &os, const MCAntenna &mca)
Definition: mc_antenna.cc:247
Numeric sigma_za
Definition: mc_antenna.h:53
void rotmat_enu(MatrixView R_ant2enu, ConstVectorView prop_los)
rotmat_enu.
Definition: mc_antenna.cc:63
The global header file for ARTS.
void set_lookup(ConstVectorView za_grid, ConstVectorView aa_grid, ConstMatrixView G_lookup)
set_lookup.
Definition: mc_antenna.cc:132
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
Vector & aag()
Definition: mc_antenna.h:174
Matrix & G()
Definition: mc_antenna.h:176
AntennaType
Definition: mc_antenna.h:41
static bool validType(AntennaType x) noexcept
Definition: mc_antenna.h:167
member functions of the Rng class and gsl_rng code
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
The Matrix class.
Definition: matpackI.h:1193
void set_pencil_beam()
set_pencil_beam
Definition: mc_antenna.cc:117
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:180
An Antenna object used by MCGeneral.
Definition: mc_antenna.h:51
Implementation of Matrix, Vector, and such stuff.
Propagation path structure and functions.
Vector & zag()
Definition: mc_antenna.h:175
Definition: rng.h:554
void return_los(Numeric &wgt, ConstMatrixView R_return, ConstMatrixView R_enu2ant) const
return_los
Definition: mc_antenna.cc:143
A constant view of a Vector.
Definition: matpackI.h:476
AntennaType get_type() const
AntennaType get_type.
Definition: mc_antenna.cc:141
Vector za_grid
Definition: mc_antenna.h:54
A constant view of a Matrix.
Definition: matpackI.h:982
Numeric sigma_aa
Definition: mc_antenna.h:53
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
AntennaType atype
Definition: mc_antenna.h:52
void set_gaussian_fwhm(const Numeric &za_fwhm, const Numeric &aa_fwhm)
set_gaussian_fwhm.
Definition: mc_antenna.cc:125
Matrix G_lookup
Definition: mc_antenna.h:55
Vector aa_grid
Definition: mc_antenna.h:54
Numeric & sza()
Definition: mc_antenna.h:173