ARTS  2.4.0(git:4fb77825)
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 
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
Matrix
The Matrix class.
Definition: matpackI.h:1193
MCAntenna::get_type
AntennaType get_type() const
AntennaType get_type.
Definition: mc_antenna.cc:141
ran_uniform
Numeric ran_uniform(Rng &rng)
ran_uniform.
Definition: mc_antenna.cc:55
MatrixView
The MatrixView class.
Definition: matpackI.h:1093
MCAntenna::aag
Vector & aag()
Definition: mc_antenna.h:174
MCAntenna::aa_grid
Vector aa_grid
Definition: mc_antenna.h:54
ANTENNA_TYPE_LOOKUP
@ ANTENNA_TYPE_LOOKUP
Definition: mc_antenna.h:44
rotmat_stokes
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
MCAntenna::sza
Numeric & sza()
Definition: mc_antenna.h:173
ANTENNA_TYPE_PENCIL_BEAM
@ ANTENNA_TYPE_PENCIL_BEAM
Definition: mc_antenna.h:42
MCAntenna::set_pencil_beam
void set_pencil_beam()
set_pencil_beam
Definition: mc_antenna.cc:117
ARTS::Var::y
Vector y(Workspace &ws) noexcept
Definition: autoarts.h:7401
ARTS::Var::stokes_dim
Index stokes_dim(Workspace &ws) noexcept
Definition: autoarts.h:6650
MCAntenna
An Antenna object used by MCGeneral.
Definition: mc_antenna.h:51
MCAntenna::set_gaussian_fwhm
void set_gaussian_fwhm(const Numeric &za_fwhm, const Numeric &aa_fwhm)
set_gaussian_fwhm.
Definition: mc_antenna.cc:125
MCAntenna::G_lookup
Matrix G_lookup
Definition: mc_antenna.h:55
stdarrayify
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
MCAntenna::saa
Numeric & saa()
Definition: mc_antenna.h:172
MCAntenna::validType
static bool validType(AntennaType x) noexcept
Definition: mc_antenna.h:167
matpackI.h
Implementation of Matrix, Vector, and such stuff.
rng.h
member functions of the Rng class and gsl_rng code
MCAntenna::G
Matrix & G()
Definition: mc_antenna.h:176
MCAntenna::draw_los
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
MCAntenna::atype
AntennaType atype
Definition: mc_antenna.h:52
MCAntenna::sigma_aa
Numeric sigma_aa
Definition: mc_antenna.h:53
operator<<
ostream & operator<<(ostream &os, const MCAntenna &mca)
Definition: mc_antenna.cc:247
MCAntenna::Type
Index Type(AntennaType x)
Definition: mc_antenna.h:166
VectorView
The VectorView class.
Definition: matpackI.h:610
MCAntenna::sigma_za
Numeric sigma_za
Definition: mc_antenna.h:53
MCAntenna::Type
AntennaType Type() const
Definition: mc_antenna.h:165
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
rotmat_enu
void rotmat_enu(MatrixView R_ant2enu, ConstVectorView prop_los)
rotmat_enu.
Definition: mc_antenna.cc:63
MCAntenna::za_grid
Vector za_grid
Definition: mc_antenna.h:54
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:982
ppath.h
Propagation path structure and functions.
Rng
Definition: rng.h:554
AntennaType
AntennaType
Definition: mc_antenna.h:41
MCAntenna::MCAntenna
MCAntenna()
Definition: mc_antenna.h:58
MCAntenna::set_lookup
void set_lookup(ConstVectorView za_grid, ConstVectorView aa_grid, ConstMatrixView G_lookup)
set_lookup.
Definition: mc_antenna.cc:132
MCAntenna::zag
Vector & zag()
Definition: mc_antenna.h:175
ARTS::Var::x
Vector x(Workspace &ws) noexcept
Definition: autoarts.h:7346
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
ran_gaussian
Numeric ran_gaussian(Rng &rng, const Numeric sigma)
ran_gaussian.
Definition: mc_antenna.cc:38
Vector
The Vector class.
Definition: matpackI.h:860
MCAntenna::return_los
void return_los(Numeric &wgt, ConstMatrixView R_return, ConstMatrixView R_enu2ant) const
return_los
Definition: mc_antenna.cc:143
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:476
MCAntenna::set_gaussian
void set_gaussian(const Numeric &za_sigma, const Numeric &aa_sigma)
set_gaussian.
Definition: mc_antenna.cc:119
arts.h
The global header file for ARTS.
ANTENNA_TYPE_GAUSSIAN
@ ANTENNA_TYPE_GAUSSIAN
Definition: mc_antenna.h:43