ARTS 2.5.0 (git: 9ee3ac6c)
TransmissionMatrix Class 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
 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
 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
 
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...
 
Index StokesDim () const
 Stokes dimensionaility. 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
 

Private Attributes

Index stokes_dim
 
std::vector< Eigen::Matrix4d, Eigen::aligned_allocator< Eigen::Matrix4d > > T4
 
std::vector< Eigen::Matrix3d, Eigen::aligned_allocator< Eigen::Matrix3d > > T3
 
std::vector< Eigen::Matrix2d, Eigen::aligned_allocator< Eigen::Matrix2d > > T2
 
std::vector< Eigen::Matrix< double, 1, 1 >, Eigen::aligned_allocator< 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 44 of file transmissionmatrix.h.

Constructor & Destructor Documentation

◆ TransmissionMatrix() [1/4]

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

Construct a new Transmission Matrix object.

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

Definition at line 61 of file transmissionmatrix.h.

References ARTS_ASSERT.

Referenced by TransmissionMatrix().

◆ TransmissionMatrix() [2/4]

TransmissionMatrix::TransmissionMatrix ( TransmissionMatrix &&  tm)
inlinenoexcept

Construct a new Transmission Matrix object.

Parameters
[in]tmMatrix to move from

Definition at line 74 of file transmissionmatrix.h.

◆ TransmissionMatrix() [3/4]

TransmissionMatrix::TransmissionMatrix ( const TransmissionMatrix tm)
default

Construct a new Transmission Matrix object.

Parameters
[in]tmmatrix to copy

◆ TransmissionMatrix() [4/4]

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 1735 of file transmissionmatrix.cc.

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

Member Function Documentation

◆ Frequencies()

Index TransmissionMatrix::Frequencies ( ) const
inline

Number of frequencies.

Definition at line 276 of file transmissionmatrix.h.

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

Referenced by operator Tensor3(), and xml_write_to_stream().

◆ Mat()

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

Get Matrix at position by copy.

Parameters
[in]iPosition
Returns
Right size

Definition at line 165 of file transmissionmatrix.h.

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

◆ Mat1() [1/2]

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

Get Matrix at position.

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

Definition at line 205 of file transmissionmatrix.h.

References T1.

◆ Mat1() [2/2]

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

◆ Mat2() [1/2]

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

Get Matrix at position.

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

Definition at line 198 of file transmissionmatrix.h.

References T2.

◆ Mat2() [2/2]

◆ Mat3() [1/2]

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

Get Matrix at position.

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

Definition at line 191 of file transmissionmatrix.h.

References T3.

◆ Mat3() [2/2]

◆ Mat4() [1/2]

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

Get Matrix at position.

Parameters
[in]

Position

Returns
Eigen::Matrix4d& Matrix

Definition at line 184 of file transmissionmatrix.h.

References T4.

◆ Mat4() [2/2]

◆ mul()

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

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 230 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ mul_aliased()

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

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 245 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ operator Tensor3()

TransmissionMatrix::operator Tensor3 ( ) const
inline

Definition at line 115 of file transmissionmatrix.h.

References Frequencies(), stokes_dim, and T4.

◆ operator()()

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

Access value in matrix.

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

Definition at line 259 of file transmissionmatrix.h.

◆ operator*=()

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

Scale self.

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

Definition at line 311 of file transmissionmatrix.h.

References T1, T2, T3, T4, and transform().

Referenced by operator=().

◆ operator+=()

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

Assign to *this lazily.

Parameters
[in]lstmLazy matrix
Returns
TransmissionMatrix& *this

Definition at line 294 of file transmissionmatrix.h.

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

◆ operator=() [1/3]

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

Assign lazily.

Parameters
[in]lstmLazy value
Returns
TransmissionMatrix& *this

Definition at line 324 of file transmissionmatrix.h.

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)
inlinenoexcept

Move operator.

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

Definition at line 99 of file transmissionmatrix.h.

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

◆ 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 356 of file transmissionmatrix.h.

References IGRF::matrix().

◆ 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 412 of file transmissionmatrix.h.

References d, dx, 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 380 of file transmissionmatrix.h.

References N.

Referenced by RadiationVector::add_weighted().

◆ setIdentity()

void TransmissionMatrix::setIdentity ( )
inline

Set to identity matrix.

Definition at line 208 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ setZero()

void TransmissionMatrix::setZero ( )
inline

Set to zero matrix.

Definition at line 216 of file transmissionmatrix.h.

References T1, T2, T3, and T4.

◆ StokesDim()

Index TransmissionMatrix::StokesDim ( ) const
inline

Stokes dimensionaility.

Definition at line 273 of file transmissionmatrix.h.

References stokes_dim.

Referenced by xml_write_to_stream().

◆ TraMat() [1/2]

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

Simple template access for the transmission.

Definition at line 347 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 338 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 1671 of file transmissionmatrix.cc.

◆ operator>>

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

Input operator.

Definition at line 1711 of file transmissionmatrix.cc.

Member Data Documentation

◆ stokes_dim

Index TransmissionMatrix::stokes_dim
private

Definition at line 46 of file transmissionmatrix.h.

Referenced by Frequencies(), Mat(), operator Tensor3(), operator=(), and StokesDim().

◆ T1

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

◆ T2

std::vector<Eigen::Matrix2d, Eigen::aligned_allocator<Eigen::Matrix2d> > TransmissionMatrix::T2
private

◆ T3

std::vector<Eigen::Matrix3d, Eigen::aligned_allocator<Eigen::Matrix3d> > TransmissionMatrix::T3
private

◆ T4

std::vector<Eigen::Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d> > TransmissionMatrix::T4
private

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