25 Vector itw1(2), itwl(2), itwr(2);
38 return itw1[0] * yl + itw1[1] * yr;
48 os <<
"SLIData2 : Output operator not implemented";
54 const ArrayOfMatrix&
a,
56 DEBUG_ONLY(
const Numeric sum_check_epsilon = 1e-6);
63 ARTS_ASSERT(is_same_within_epsilon(sum(itw), 1, sum_check_epsilon));
65 Index anr =
a[0].nrows();
66 Index anc =
a[0].ncols();
71 for (Index inr = 0; inr < anr; inr++)
72 for (Index inc = 0; inc < anc; inc++) {
74 a[tc.
idx](inr, inc) * itw[0] +
a[tc.
idx + 1](inr, inc) * itw[1];
80 const ArrayOfVector&
a,
82 DEBUG_ONLY(
const Numeric sum_check_epsilon = 1e-6);
88 ARTS_ASSERT(is_same_within_epsilon(sum(itw), 1, sum_check_epsilon));
90 Index an =
a[0].nelem();
94 for (Index i = 0; i < an; ++i) {
95 tia[i] =
a[tc.
idx][i] * itw[0] +
a[tc.
idx + 1][i] * itw[1];
100 VectorView pha_mat_int,
104 const Numeric& za_sca,
105 const Numeric& aa_sca,
106 const Numeric& za_inc,
107 const Numeric& aa_inc,
108 const Numeric& rtp_temperature) {
109 Numeric ANG_TOL = 1e-7;
116 if (abs(aa_sca - aa_inc) < ANG_TOL) {
117 theta_rad =
DEG2RAD * abs(za_sca - za_inc);
118 }
else if (abs(abs(aa_sca - aa_inc) - 180) < ANG_TOL) {
119 theta_rad =
DEG2RAD * (za_sca + za_inc);
120 if (theta_rad >
PI) {
121 theta_rad = 2 *
PI - theta_rad;
124 const Numeric za_sca_rad = za_sca *
DEG2RAD;
125 const Numeric za_inc_rad = za_inc *
DEG2RAD;
126 const Numeric aa_sca_rad = aa_sca *
DEG2RAD;
127 const Numeric aa_inc_rad = aa_inc *
DEG2RAD;
133 acos(cos(za_sca_rad) * cos(za_inc_rad) +
134 sin(za_sca_rad) * sin(za_inc_rad) * cos(aa_sca_rad - aa_inc_rad));
136 const Numeric theta =
RAD2DEG * theta_rad;
144 if (scat_data_single.
T_grid.nelem() == 1) {
148 for (Index i = 0; i < 6; i++) {
150 itw, scat_data_single.
pha_mat_data(0, 0, joker, 0, 0, 0, i), thet_gp);
158 for (Index i = 0; i < 6; i++) {
161 scat_data_single.
pha_mat_data(0, joker, joker, 0, 0, 0, i),
Constants of physical expressions as constexpr.
A 2D sequential linear interpolation (SLI) lookup table This class holds the gridded for 2D SLI as we...
Numeric interpolate(Numeric x1, Numeric x2) const
#define ARTS_ASSERT(condition,...)
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
constexpr Numeric DEG2RAD
void interp(MatrixView tia, ConstVectorView itw, const ArrayOfMatrix &a, const GridPos &tc)
interp.
ostream & operator<<(ostream &os, const SLIData2 &)
constexpr Numeric RAD2DEG
void interp_scat_angle_temperature(VectorView pha_mat_int, Numeric &theta_rad, const SingleScatteringData &scat_data_single, const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc, const Numeric &rtp_temperature)
interp_scat_angle_temperature.
Interpolation classes and functions created for use within Monte Carlo scattering simulations.
void interp(MatrixView tia, ConstVectorView itw, const ArrayOfMatrix &a, const GridPos &tc)
interp.
constexpr Numeric pi
The following mathematical constants are generated in python Decimal package by the code:
constexpr auto deg2rad(auto x) noexcept
Converts degrees to radians.
constexpr auto rad2deg(auto x) noexcept
Converts radians to degrees.
Structure to store a grid position.