ARTS 2.5.11 (git: 725533f0)
gas_scattering.cc
Go to the documentation of this file.
1/*===========================================================================
2 === File description
3 ===========================================================================*/
4
5
15#include "arts_conversions.h"
16#include "gas_scattering.h"
17#include "matpack_data.h"
18#include "check_input.h"
19#include <cmath>
20
21Vector calc_rayleighPhaMat(const Numeric& theta_rad,
22 const Index& stokes_dim) {
23
24 using Math::pow2;
25 using Constant::pi;
26
27 chk_if_in_range("Scattering angle", theta_rad, 0, pi);
28
29 Vector pha_mat_int(6, 0.0);
30
31 switch (stokes_dim) {
32 case 4:
33 pha_mat_int[4] = 0.0; //F34
34 pha_mat_int[5] = cos(theta_rad); //F44
35 [[fallthrough]];
36 case 3:
37 pha_mat_int[3] = cos(theta_rad); //F33
38 [[fallthrough]];
39 case 2:
40 pha_mat_int[1] = -0.5 * pow2(sin(theta_rad)); //F12
41 pha_mat_int[2] = 0.5 * (1 + pow2(cos(theta_rad))); //F22
42 [[fallthrough]];
43 case 1:
44 pha_mat_int[0] = 0.5 * (1 + pow2(cos(theta_rad))); //F11
45 }
46
47 pha_mat_int *= 1.5;
48 return pha_mat_int;
49}
Common ARTS conversions.
void chk_if_in_range(const String &x_name, const Index &x, const Index &x_low, const Index &x_high)
chk_if_in_range
Vector calc_rayleighPhaMat(const Numeric &theta_rad, const Index &stokes_dim)
Header file for functions related to gas scattering.
constexpr Numeric pi
The following mathematical constants are generated in python Decimal package by the code:
constexpr auto pow2(auto x) noexcept
power of two