ARTS 2.5.9 (git: 825fa5f2)
TransmissionMatrix Struct Reference

Class to keep track of Transmission Matrices for Stokes Dim 1-4. More...

#include <transmissionmatrix.h>

Public Member Functions

 TransmissionMatrix (Index nf=0, Index stokes=1)
 Construct a new Transmission Matrix object. More...
 
 TransmissionMatrix (TransmissionMatrix &&tm) noexcept=default
 Construct a new Transmission Matrix object. More...
 
 TransmissionMatrix (const TransmissionMatrix &tm)=default
 Construct a new Transmission Matrix object. More...
 
TransmissionMatrixoperator= (const TransmissionMatrix &tm)=default
 Assignment operator. More...
 
TransmissionMatrixoperator= (TransmissionMatrix &&tm) noexcept=default
 Move operator. More...
 
 TransmissionMatrix (const PropagationMatrix &pm, const Numeric &r=1.0)
 Construct a new Transmission Matrix from a Propagation Matrix. More...
 
 operator Tensor3 () const
 
 TransmissionMatrix (const ConstMatrixView &mat)
 
const Eigen::Matrix4d & Mat4 (size_t i) const
 Get Matrix at position. More...
 
const Eigen::Matrix3d & Mat3 (size_t i) const
 Get Matrix at position. More...
 
const Eigen::Matrix2d & Mat2 (size_t i) const
 Get Matrix at position. More...
 
const Eigen::Matrix< double, 1, 1 > & Mat1 (size_t i) const
 Get Matrix at position. More...
 
Eigen::MatrixXd Mat (size_t i) const
 Get Matrix at position by copy. More...
 
Eigen::Matrix4d & Mat4 (size_t i)
 Get Matrix at position. More...
 
Eigen::Matrix3d & Mat3 (size_t i)
 Get Matrix at position. More...
 
Eigen::Matrix2d & Mat2 (size_t i)
 Get Matrix at position. More...
 
Eigen::Matrix< double, 1, 1 > & Mat1 (size_t i)
 Get Matrix at position. More...
 
void setIdentity ()
 Set to identity matrix. More...
 
void setZero ()
 Set to zero matrix. More...
 
void mul (const TransmissionMatrix &A, const TransmissionMatrix &B)
 Set this to a multiple of A by B. More...
 
void mul_aliased (const TransmissionMatrix &A, const TransmissionMatrix &B)
 Set this to a multiple of A by B. More...
 
Numeric operator() (const Index i, const Index j, const Index k) const
 Access value in matrix. More...
 
Numericoperator() (const Index i, const Index j, const Index k)
 Access value in matrix. More...
 
Index Frequencies () const
 Number of frequencies. More...
 
TransmissionMatrixoperator+= (const LazyScale< TransmissionMatrix > &lstm)
 Assign to *this lazily. More...
 
TransmissionMatrixoperator*= (const Numeric &scale)
 Scale self. More...
 
TransmissionMatrixoperator= (const LazyScale< TransmissionMatrix > &lstm)
 Assign lazily. More...
 
template<int N>
auto & TraMat (size_t i) noexcept
 Simple template access for the transmission. More...
 
template<int N>
auto & TraMat (size_t i) const noexcept
 Simple template access for the transmission. More...
 
template<int N>
Eigen::Matrix< Numeric, N, NOptDepth (size_t i) const noexcept
 Simple template access for the optical depth. More...
 
template<int N>
Eigen::Matrix< Numeric, N, 1 > second_order_integration_source (const Eigen::Matrix< Numeric, N, N > T, const Eigen::Matrix< Numeric, N, 1 > far, const Eigen::Matrix< Numeric, N, 1 > close, const Eigen::Matrix< Numeric, N, N > Kfar, const Eigen::Matrix< Numeric, N, N > Kclose, const Numeric r) const noexcept
 
template<int N>
Eigen::Matrix< Numeric, N, 1 > second_order_integration_dsource (size_t i, const TransmissionMatrix &dx, const Eigen::Matrix< Numeric, N, 1 > far, const Eigen::Matrix< Numeric, N, 1 > close, const Eigen::Matrix< Numeric, N, 1 > d, bool isfar) const noexcept
 

Public Attributes

Index stokes_dim
 
std::vector< Eigen::Matrix4d > T4
 
std::vector< Eigen::Matrix3d > T3
 
std::vector< Eigen::Matrix2d > T2
 
std::vector< Eigen::Matrix< double, 1, 1 > > T1
 

Friends

std::ostream & operator<< (std::ostream &os, const TransmissionMatrix &tm)
 Output operator. More...
 
std::istream & operator>> (std::istream &data, TransmissionMatrix &tm)
 Input operator. More...
 

Detailed Description

Class to keep track of Transmission Matrices for Stokes Dim 1-4.

Definition at line 166 of file transmissionmatrix.h.

Constructor & Destructor Documentation

◆ TransmissionMatrix() [1/5]

TransmissionMatrix::TransmissionMatrix ( Index  nf = 0,
Index  stokes = 1 
)

Construct a new Transmission Matrix object.

Parameters
[in]nfNumber of frequencies
[in]stokesStokes dimension

Definition at line 34 of file transmissionmatrix.cc.

References ARTS_ASSERT.

◆ TransmissionMatrix() [2/5]

TransmissionMatrix::TransmissionMatrix ( TransmissionMatrix &&  tm)
defaultnoexcept

Construct a new Transmission Matrix object.

Parameters
[in]tmMatrix to move from

◆ TransmissionMatrix() [3/5]

TransmissionMatrix::TransmissionMatrix ( const TransmissionMatrix tm)
default

Construct a new Transmission Matrix object.

Parameters
[in]tmmatrix to copy

◆ TransmissionMatrix() [4/5]

TransmissionMatrix::TransmissionMatrix ( const PropagationMatrix pm,
const Numeric r = 1.0 
)
explicit

Construct a new Transmission Matrix from a Propagation Matrix.

Parameters
[in]pmPropagation Matrix
[in]rDistance

Definition at line 2323 of file transmissionmatrix.cc.

References PropagationMatrix::NumberOfFrequencies(), PropagationMatrix::StokesDimensions(), and transmat().

◆ TransmissionMatrix() [5/5]

TransmissionMatrix::TransmissionMatrix ( const ConstMatrixView mat)
explicit

Definition at line 162 of file transmissionmatrix.cc.

References ARTS_ASSERT, and stokes_dim.

Member Function Documentation

◆ Frequencies()

Index TransmissionMatrix::Frequencies ( ) const

Number of frequencies.

Definition at line 149 of file transmissionmatrix.cc.

References stokes_dim, T1, T2, T3, and T4.

Referenced by xml_write_to_stream().

◆ Mat()

Eigen::MatrixXd TransmissionMatrix::Mat ( size_t  i) const

Get Matrix at position by copy.

Parameters
[in]iPosition
Returns
Right size

Definition at line 77 of file transmissionmatrix.cc.

References Mat1(), Mat2(), Mat3(), Mat4(), and stokes_dim.

◆ Mat1() [1/2]

Eigen::Matrix< double, 1, 1 > & TransmissionMatrix::Mat1 ( size_t  i)

Get Matrix at position.

Parameters
[in]iPosition
Returns
Eigen::Matrix<double, 1, 1>& Matrix

Definition at line 51 of file transmissionmatrix.cc.

References T1.

◆ Mat1() [2/2]

const Eigen::Matrix< double, 1, 1 > & TransmissionMatrix::Mat1 ( size_t  i) const

◆ Mat2() [1/2]

Eigen::Matrix2d & TransmissionMatrix::Mat2 ( size_t  i)

Get Matrix at position.

Parameters
[in]iPosition
Returns
Eigen::Matrix42& Matrix

Definition at line 50 of file transmissionmatrix.cc.

References T2.

◆ Mat2() [2/2]

◆ Mat3() [1/2]

Eigen::Matrix3d & TransmissionMatrix::Mat3 ( size_t  i)

Get Matrix at position.

Parameters
[in]iPosition
Returns
Eigen::Matrix3d& Matrix

Definition at line 49 of file transmissionmatrix.cc.

References T3.

◆ Mat3() [2/2]

◆ Mat4() [1/2]

Eigen::Matrix4d & TransmissionMatrix::Mat4 ( size_t  i)

Get Matrix at position.

Parameters
[in]

Position

Returns
Eigen::Matrix4d& Matrix

Definition at line 48 of file transmissionmatrix.cc.

References T4.

◆ Mat4() [2/2]

◆ mul()

void TransmissionMatrix::mul ( const TransmissionMatrix A,
const TransmissionMatrix B 
)

Set this to a multiple of A by B.

*this is not aliased with A or B

Parameters
[in]AMatrix 1
[in]BMatrix 2

Definition at line 105 of file transmissionmatrix.cc.

References T1, T2, T3, and T4.

◆ mul_aliased()

void TransmissionMatrix::mul_aliased ( const TransmissionMatrix A,
const TransmissionMatrix B 
)

Set this to a multiple of A by B.

*this is aliased with A or B

Parameters
[in]AMatrix 1
[in]BMatrix 2

Definition at line 113 of file transmissionmatrix.cc.

References T1, T2, T3, and T4.

◆ operator Tensor3()

TransmissionMatrix::operator Tensor3 ( ) const

Definition at line 60 of file transmissionmatrix.cc.

◆ operator()() [1/2]

Numeric & TransmissionMatrix::operator() ( const Index  i,
const Index  j,
const Index  k 
)

Access value in matrix.

Parameters
[in]iPosition in vector
[in]jRow in matrix
[in]kCol in matrix
Returns
const Numeric& value

Definition at line 136 of file transmissionmatrix.cc.

References stokes_dim, T1, T2, T3, and T4.

◆ operator()() [2/2]

Numeric TransmissionMatrix::operator() ( const Index  i,
const Index  j,
const Index  k 
) const

Access value in matrix.

Parameters
[in]iPosition in vector
[in]jRow in matrix
[in]kCol in matrix
Returns
const Numeric& value

Definition at line 121 of file transmissionmatrix.cc.

References stokes_dim, T1, T2, T3, and T4.

◆ operator*=()

TransmissionMatrix & TransmissionMatrix::operator*= ( const Numeric scale)

Scale self.

Parameters
[in]scaleTo scale with
Returns
TransmissionMatrix& *this

Definition at line 182 of file transmissionmatrix.cc.

References T1, T2, T3, and T4.

Referenced by operator=().

◆ operator+=()

TransmissionMatrix & TransmissionMatrix::operator+= ( const LazyScale< TransmissionMatrix > &  lstm)

Assign to *this lazily.

Parameters
[in]lstmLazy matrix
Returns
TransmissionMatrix& *this

Definition at line 169 of file transmissionmatrix.cc.

References LazyScale< base >::bas, LazyScale< base >::scale, T1, T2, T3, and T4.

◆ operator=() [1/3]

TransmissionMatrix & TransmissionMatrix::operator= ( const LazyScale< TransmissionMatrix > &  lstm)

Assign lazily.

Parameters
[in]lstmLazy value
Returns
TransmissionMatrix& *this

Definition at line 53 of file transmissionmatrix.cc.

References LazyScale< base >::bas, operator*=(), operator=(), and LazyScale< base >::scale.

◆ operator=() [2/3]

TransmissionMatrix & TransmissionMatrix::operator= ( const TransmissionMatrix tm)
default

Assignment operator.

Parameters
[in]tmmatrix to copy
Returns
TransmissionMatrix& *this

Referenced by operator=().

◆ operator=() [3/3]

TransmissionMatrix & TransmissionMatrix::operator= ( TransmissionMatrix &&  tm)
defaultnoexcept

Move operator.

Parameters
[in]tmmatrix to move from
Returns
TransmissionMatrix& *this

◆ OptDepth()

template<int N>
Eigen::Matrix< Numeric, N, N > TransmissionMatrix::OptDepth ( size_t  i) const
inlinenoexcept

Simple template access for the optical depth.

Definition at line 386 of file transmissionmatrix.h.

◆ second_order_integration_dsource()

template<int N>
Eigen::Matrix< Numeric, N, 1 > TransmissionMatrix::second_order_integration_dsource ( size_t  i,
const TransmissionMatrix dx,
const Eigen::Matrix< Numeric, N, 1 >  far,
const Eigen::Matrix< Numeric, N, 1 >  close,
const Eigen::Matrix< Numeric, N, 1 >  d,
bool  isfar 
) const
inlinenoexcept

Definition at line 443 of file transmissionmatrix.h.

References d, and N.

Referenced by RadiationVector::addWeightedDerivEmission().

◆ second_order_integration_source()

template<int N>
Eigen::Matrix< Numeric, N, 1 > TransmissionMatrix::second_order_integration_source ( const Eigen::Matrix< Numeric, N, N T,
const Eigen::Matrix< Numeric, N, 1 >  far,
const Eigen::Matrix< Numeric, N, 1 >  close,
const Eigen::Matrix< Numeric, N, N Kfar,
const Eigen::Matrix< Numeric, N, N Kclose,
const Numeric  r 
) const
inlinenoexcept

Return the weighted source term using second order integration

\[ far = \frac{1-\left(1+\log{T_{00}}\right) T}{\log{T_{00}}} \]

\[ close = \frac{\log{T_{00}} - 1 + T}{\log{T_{00}}} \]

This follows definition of equation 3.34 of http://www.ita.uni-heidelberg.de/~dullemond/lectures/radtrans_2013/Chapter_3.pdf.

One key change is that we consider polarization but only based on unpolarized radiation

FIXME: This function is not done properly for Stokes Dim > 1. The results might be correct but the derivation is not understood.

Parameters
[in]TThe transmission matrix
[in]farThe source at the destination of the RT step
[in]closeThe source at the start of the RT step
[in]KfarThe propagation matrix at the destination of the RT step
[in]KcloseThe propagation matrix at the start of the RT step
[in]rThe distance of the RT step
Returns
Linear Weights

Definition at line 410 of file transmissionmatrix.h.

References N.

Referenced by RadiationVector::add_weighted().

◆ setIdentity()

void TransmissionMatrix::setIdentity ( )

Set to identity matrix.

Definition at line 91 of file transmissionmatrix.cc.

References T1, T2, T3, and T4.

Referenced by gas_scattering_matIsotropic().

◆ setZero()

void TransmissionMatrix::setZero ( )

Set to zero matrix.

Definition at line 98 of file transmissionmatrix.cc.

References T1, T2, T3, and T4.

◆ TraMat() [1/2]

template<int N>
auto & TransmissionMatrix::TraMat ( size_t  i) const
inlinenoexcept

Simple template access for the transmission.

Definition at line 372 of file transmissionmatrix.h.

References N, T1, T2, T3, and T4.

◆ TraMat() [2/2]

template<int N>
auto & TransmissionMatrix::TraMat ( size_t  i)
inlinenoexcept

Simple template access for the transmission.

Definition at line 358 of file transmissionmatrix.h.

References N, T1, T2, T3, and T4.

Referenced by RadiationVector::add_weighted().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const TransmissionMatrix tm 
)
friend

Output operator.

Definition at line 2284 of file transmissionmatrix.cc.

◆ operator>>

std::istream & operator>> ( std::istream &  data,
TransmissionMatrix tm 
)
friend

Input operator.

Definition at line 2301 of file transmissionmatrix.cc.

Member Data Documentation

◆ stokes_dim

Index TransmissionMatrix::stokes_dim

◆ T1

std::vector<Eigen::Matrix<double, 1, 1> > TransmissionMatrix::T1

◆ T2

std::vector<Eigen::Matrix2d> TransmissionMatrix::T2

◆ T3

std::vector<Eigen::Matrix3d> TransmissionMatrix::T3

◆ T4

std::vector<Eigen::Matrix4d> TransmissionMatrix::T4

The documentation for this struct was generated from the following files: