ARTS 2.5.0 (git: 9ee3ac6c)
StokesVector Class Referencefinal

Stokes vector is as Propagation matrix but only has 4 possible values. More...

#include <propagationmatrix.h>

Inheritance diagram for StokesVector:
PropagationMatrix

Public Member Functions

 StokesVector (const Index nr_frequencies=0, const Index stokes_dim=1, const Index nr_za=1, const Index nr_aa=1, const Numeric &v=0.0)
 Initialize variable sizes. More...
 
 StokesVector (Tensor4 x)
 Construct a new Propagation Matrix object. More...
 
 StokesVector (const ConstVectorView &x)
 Construct a new Stokes Vector object. More...
 
 StokesVector (const StokesVector &a, const StokesVector &b, const Numeric &scale=0.5)
 Construct a new Stokes Vector as a scale between two others. More...
 
Index NumberOfNeededVectors () const
 The number of required vectors to fill this StokesVector. More...
 
StokesVectoroperator+= (const PropagationMatrix &x)
 Addition operator. More...
 
StokesVectoroperator+= (const LazyScale< PropagationMatrix > &lpms)
 Addition operator. More...
 
StokesVectoroperator= (const PropagationMatrix &x)
 Set *this from a Propagation matrix. More...
 
StokesVectoroperator= (const LazyScale< PropagationMatrix > &lpms)
 Set this lazily. More...
 
StokesVectoroperator= (const Numeric &x)
 Set this to constant value. More...
 
void MultiplyAndAdd (const Numeric x, const PropagationMatrix &y)
 Add a scaled version of the input. More...
 
VectorView VectorAtPosition (const Index iv=0, const Index iz=0, const Index ia=0)
 Get a vectorview to the position. More...
 
ConstVectorView VectorAtPosition (const Index iv=0, const Index iz=0, const Index ia=0) const
 Get a vectorview to the position. More...
 
void SetAtPosition (const ConstVectorView &x, const Index iv=0, const Index iz=0, const Index ia=0)
 
void AddAverageAtPosition (const ConstVectorView &vec1, const ConstVectorView &vec2, const Index iv=0, const Index iz=0, const Index ia=0)
 Add the average of both inputs at position. More...
 
bool IsPolarized (const Index iv=0, const Index iz=0, const Index ia=0) const
 Checks if vector is polarized. More...
 
bool IsUnpolarized (const Index iv=0, const Index iz=0, const Index ia=0) const
 Checks if vector is polarized. More...
 
bool allZeroes () const
 
- Public Member Functions inherited from PropagationMatrix
 PropagationMatrix (const Index nr_frequencies=0, const Index stokes_dim=1, const Index nr_za=1, const Index nr_aa=1, const Numeric v=0.0)
 Initialize variable sizes. More...
 
 PropagationMatrix (const PropagationMatrix &pm)=default
 Construct a new Propagation Matrix object. More...
 
 PropagationMatrix (PropagationMatrix &&pm) noexcept
 Construct a new Propagation Matrix object. More...
 
 PropagationMatrix (Tensor4 x)
 Construct a new Propagation Matrix object. More...
 
 PropagationMatrix (const ConstMatrixView &x, const bool &assume_fit=false)
 Initialize from single stokes_dim-by-stokes_dim matrix. More...
 
Index StokesDimensions () const
 The stokes dimension of the propagation matrix. More...
 
Index NumberOfFrequencies () const
 The number of frequencies of the propagation matrix. More...
 
Index NumberOfZenithAngles () const
 The number of zenith angles of the propagation matrix. More...
 
Index NumberOfAzimuthAngles () const
 The number of azimuth angles of the propagation matrix. More...
 
bool OK () const
 
bool IsEmpty () const
 Asks if the class is empty. More...
 
bool IsZero (const Index iv=0, const Index iz=0, const Index ia=0) const
 False if any non-zeroes in internal Matrix representation. More...
 
bool IsRotational (const Index iv=0, const Index iz=0, const Index ia=0) const
 False if diagonal element is non-zero in internal Matrix representation. More...
 
Index NumberOfNeededVectors () const
 The number of required vectors to fill this PropagationMatrix. More...
 
Numeric operator() (const Index iv=0, const Index is1=0, const Index is2=0, const Index iz=0, const Index ia=0) const
 access operator. More...
 
void AddFaraday (const Numeric &rot, const Index iv=0, const Index iz=0, const Index ia=0)
 Adds the Faraday rotation to the PropagationMatrix at required position. More...
 
void SetFaraday (const Numeric &rot, const Index iv=0, const Index iz=0, const Index ia=0)
 Sets the Faraday rotation to the PropagationMatrix at required position. More...
 
void MatrixAtPosition (MatrixView ret, const Index iv=0, const Index iz=0, const Index ia=0) const
 Sets the dense matrix. More...
 
PropagationMatrixoperator= (PropagationMatrix &&pm) noexcept
 Move operator. More...
 
PropagationMatrixoperator= (const LazyScale< PropagationMatrix > &lpms)
 Laze equal to opeartor. More...
 
PropagationMatrixoperator= (const PropagationMatrix &other)=default
 Copy operator. More...
 
PropagationMatrixoperator= (const Numeric &x)
 Sets all data to constant. More...
 
void SetAtPosition (const PropagationMatrix &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Set the At Position object. More...
 
void SetAtPosition (const ConstMatrixView &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Set the At Position object. More...
 
void SetAtPosition (const Numeric &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Set the At Position object. More...
 
PropagationMatrixoperator/= (const PropagationMatrix &other)
 Divide operator. More...
 
PropagationMatrixoperator/= (const ConstVectorView &x)
 Divide operator. More...
 
PropagationMatrixoperator/= (const Numeric &x)
 Divide operator. More...
 
void DivideAtPosition (const PropagationMatrix &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Divide at position. More...
 
void DivideAtPosition (const ConstMatrixView &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Divide at position. More...
 
void DivideAtPosition (const Numeric &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Divide at position. More...
 
PropagationMatrixoperator*= (const PropagationMatrix &other)
 Multiply operator. More...
 
PropagationMatrixoperator*= (const ConstVectorView &x)
 Multiply operator. More...
 
PropagationMatrixoperator*= (const Numeric &x)
 Multiply operator. More...
 
void MultiplyAtPosition (const PropagationMatrix &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Multiply operator at position. More...
 
void MultiplyAtPosition (const ConstMatrixView &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Multiply operator at position. More...
 
void MultiplyAtPosition (const Numeric &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Multiply operator at position. More...
 
PropagationMatrixoperator+= (const PropagationMatrix &other)
 Addition operator. More...
 
PropagationMatrixoperator+= (const LazyScale< PropagationMatrix > &lpms)
 Addition operator. More...
 
PropagationMatrixoperator+= (const ConstVectorView &x)
 Addition operator. More...
 
PropagationMatrixoperator+= (const Numeric &x)
 Addition operator. More...
 
void AddAtPosition (const PropagationMatrix &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Addition at position operator. More...
 
void AddAtPosition (const ConstMatrixView &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Addition at position operator. More...
 
void AddAtPosition (const Numeric &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Addition at position operator. More...
 
PropagationMatrixoperator-= (const PropagationMatrix &other)
 Subtraction operator. More...
 
PropagationMatrixoperator-= (const ConstVectorView &x)
 Subtraction operator. More...
 
PropagationMatrixoperator-= (const Numeric &x)
 Subtraction operator. More...
 
void RemoveAtPosition (const PropagationMatrix &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Subtraction at position. More...
 
void RemoveAtPosition (const ConstMatrixView &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Subtraction at position. More...
 
void RemoveAtPosition (const Numeric &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Subtraction at position. More...
 
void AddAbsorptionVectorAtPosition (const ConstVectorView &x, const Index iv=0, const Index iz=0, const Index ia=0)
 Adds as a Stokes vector at position. More...
 
void AddAverageAtPosition (const ConstMatrixView &mat1, const ConstMatrixView &mat2, const Index iv=0, const Index iz=0, const Index ia=0)
 Add the average of the two input at position. More...
 
void MultiplyAndAdd (const Numeric x, const PropagationMatrix &y)
 Multiply input by scalar and add to this. More...
 
void MatrixInverseAtPosition (MatrixView ret, const Index iv=0, const Index iz=0, const Index ia=0) const
 Return the matrix inverse at the position. More...
 
bool FittingShape (const ConstMatrixView &x) const
 Tests of the input matrix fits Propagation Matrix style. More...
 
void GetTensor3 (Tensor3View tensor3, const Index iz=0, const Index ia=0)
 Get a Tensor3 object from this. More...
 
VectorView Kjj (const Index iz=0, const Index ia=0)
 Vector view to diagonal elements. More...
 
VectorView K12 (const Index iz=0, const Index ia=0)
 Vector view to K(0, 1) elements. More...
 
VectorView K13 (const Index iz=0, const Index ia=0)
 Vector view to K(0, 2) elements. More...
 
VectorView K14 (const Index iz=0, const Index ia=0)
 Vector view to K(0, 3) elements. More...
 
VectorView K23 (const Index iz=0, const Index ia=0)
 Vector view to K(1, 2) elements. More...
 
VectorView K24 (const Index iz=0, const Index ia=0)
 Vector view to K(1, 3) elements. More...
 
VectorView K34 (const Index iz=0, const Index ia=0)
 Vector view to K(2, 3) elements. More...
 
ConstVectorView Kjj (const Index iz=0, const Index ia=0) const
 Vector view to diagonal elements. More...
 
ConstVectorView K12 (const Index iz=0, const Index ia=0) const
 Vector view to K(0, 1) elements. More...
 
ConstVectorView K13 (const Index iz=0, const Index ia=0) const
 Vector view to K(0, 2) elements. More...
 
ConstVectorView K14 (const Index iz=0, const Index ia=0) const
 Vector view to K(0, 3) elements. More...
 
ConstVectorView K23 (const Index iz=0, const Index ia=0) const
 Vector view to K(1, 3) elements. More...
 
ConstVectorView K24 (const Index iz=0, const Index ia=0) const
 Vector view to K(1, 3) elements. More...
 
ConstVectorView K34 (const Index iz=0, const Index ia=0) const
 Vector view to diagonal elements. More...
 
void SetZero ()
 Sets all data to zero. More...
 
Tensor4Data ()
 Get full view to data. More...
 
const Tensor4Data () const
 Get full const view to data. More...
 
void LeftMultiplyAtPosition (MatrixView out, const ConstMatrixView &in, const Index iv=0, const Index iz=0, const Index ia=0) const
 Multiply the matrix input from the left of this at position. More...
 
void RightMultiplyAtPosition (MatrixView out, const ConstMatrixView &in, const Index iv=0, const Index iz=0, const Index ia=0) const
 Multiply the matrix input from the right of this at position. More...
 

Additional Inherited Members

- Protected Attributes inherited from PropagationMatrix
Index mfreqs
 
Index mstokes_dim
 
Index mza
 
Index maa
 
Tensor4 mdata
 
bool mvectortype {false}
 

Detailed Description

Stokes vector is as Propagation matrix but only has 4 possible values.

Definition at line 1181 of file propagationmatrix.h.

Constructor & Destructor Documentation

◆ StokesVector() [1/4]

StokesVector::StokesVector ( const Index  nr_frequencies = 0,
const Index  stokes_dim = 1,
const Index  nr_za = 1,
const Index  nr_aa = 1,
const Numeric v = 0.0 
)
inline

Initialize variable sizes.

Will create a Tensor4 of the size and order (nr_aa, nr_za, NumberOfNeededVectors(), nr_frequencies)

Parameters
[in]nr_frequenciesNumber of Dirac frequencies
[in]stokes_dimStokes dimensionality
[in]nr_zaNumber of Dirac Zeniths
[in]nr_aaNumber of Dirac Azimuths
[in]vInitial values of things in the created Tensor4

Definition at line 1195 of file propagationmatrix.h.

References ARTS_ASSERT, PropagationMatrix::maa, PropagationMatrix::mdata, PropagationMatrix::mfreqs, PropagationMatrix::mstokes_dim, PropagationMatrix::mvectortype, PropagationMatrix::mza, and v.

◆ StokesVector() [2/4]

◆ StokesVector() [3/4]

StokesVector::StokesVector ( const ConstVectorView x)
inlineexplicit

◆ StokesVector() [4/4]

StokesVector::StokesVector ( const StokesVector a,
const StokesVector b,
const Numeric scale = 0.5 
)
inline

Construct a new Stokes Vector as a scale between two others.

Parameters
ainput 1
binput 2
scaleScale of inputs

Definition at line 1245 of file propagationmatrix.h.

References a, PropagationMatrix::maa, PropagationMatrix::mdata, PropagationMatrix::mfreqs, PropagationMatrix::mstokes_dim, PropagationMatrix::mvectortype, PropagationMatrix::mza, and Tensor4::resize().

Member Function Documentation

◆ AddAverageAtPosition()

void StokesVector::AddAverageAtPosition ( const ConstVectorView vec1,
const ConstVectorView vec2,
const Index  iv = 0,
const Index  iz = 0,
const Index  ia = 0 
)
inline

Add the average of both inputs at position.

Parameters
[in]vec1input 1
[in]vec2input 2
[in]ivFrequency index
[in]izZenith index
[in]iaAzimuth index

Definition at line 1406 of file propagationmatrix.h.

References PropagationMatrix::mdata, and PropagationMatrix::mstokes_dim.

◆ allZeroes()

bool StokesVector::allZeroes ( ) const
inline

Definition at line 1459 of file propagationmatrix.h.

References PropagationMatrix::maa, and PropagationMatrix::mza.

Referenced by get_stepwise_clearsky_propmat().

◆ IsPolarized()

bool StokesVector::IsPolarized ( const Index  iv = 0,
const Index  iz = 0,
const Index  ia = 0 
) const
inline

Checks if vector is polarized.

Parameters
[in]ivFrequency index
[in]izZenith index
[in]iaAzimuth index
Returns
true if polarized
false if not polarized

Definition at line 1431 of file propagationmatrix.h.

References PropagationMatrix::K12(), PropagationMatrix::K13(), PropagationMatrix::K14(), and PropagationMatrix::mstokes_dim.

Referenced by IsUnpolarized().

◆ IsUnpolarized()

bool StokesVector::IsUnpolarized ( const Index  iv = 0,
const Index  iz = 0,
const Index  ia = 0 
) const
inline

Checks if vector is polarized.

Parameters
[in]ivFrequency index
[in]izZenith index
[in]iaAzimuth index
Returns
true if not polarized
false if polarized

Definition at line 1453 of file propagationmatrix.h.

References IsPolarized().

◆ MultiplyAndAdd()

◆ NumberOfNeededVectors()

Index StokesVector::NumberOfNeededVectors ( ) const
inline

The number of required vectors to fill this StokesVector.

Definition at line 1276 of file propagationmatrix.h.

References PropagationMatrix::mstokes_dim.

◆ operator+=() [1/2]

StokesVector & StokesVector::operator+= ( const LazyScale< PropagationMatrix > &  lpms)
inline

Addition operator.

Parameters
xLazy addition
Returns
StokesVector& *this

Definition at line 1293 of file propagationmatrix.h.

References LazyScale< base >::bas, MultiplyAndAdd(), and LazyScale< base >::scale.

◆ operator+=() [2/2]

StokesVector & StokesVector::operator+= ( const PropagationMatrix x)
inline

Addition operator.

Parameters
xStokes Vector or Propagation Matrix to add
Returns
StokesVector& *this

Definition at line 1283 of file propagationmatrix.h.

References PropagationMatrix::Data(), joker, PropagationMatrix::mdata, and PropagationMatrix::mstokes_dim.

◆ operator=() [1/3]

StokesVector & StokesVector::operator= ( const LazyScale< PropagationMatrix > &  lpms)
inline

Set this lazily.

Parameters
[in]lpmsLazy propagation matrix
Returns
StokesVector& *this

Definition at line 1318 of file propagationmatrix.h.

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

◆ operator=() [2/3]

StokesVector & StokesVector::operator= ( const Numeric x)
inline

Set this to constant value.

Parameters
[in]xconstant value
Returns
StokesVector& *this

Definition at line 1329 of file propagationmatrix.h.

References PropagationMatrix::mdata.

◆ operator=() [3/3]

◆ SetAtPosition()

void StokesVector::SetAtPosition ( const ConstVectorView x,
const Index  iv = 0,
const Index  iz = 0,
const Index  ia = 0 
)
inline

◆ VectorAtPosition() [1/2]

VectorView StokesVector::VectorAtPosition ( const Index  iv = 0,
const Index  iz = 0,
const Index  ia = 0 
)
inline

Get a vectorview to the position.

Parameters
[in]ivFrequency index
[in]izZenith index
[in]iaAzimuth index
Returns
VectorView To StokesVector

Definition at line 1372 of file propagationmatrix.h.

References joker, and PropagationMatrix::mdata.

Referenced by clear_rt_vars_at_gp(), cloud_fieldsCalc(), cloudy_rt_vars_at_gp(), get_stepwise_effective_source(), and rte_step_doit_replacement().

◆ VectorAtPosition() [2/2]

ConstVectorView StokesVector::VectorAtPosition ( const Index  iv = 0,
const Index  iz = 0,
const Index  ia = 0 
) const
inline

Get a vectorview to the position.

Parameters
[in]ivFrequency index
[in]izZenith index
[in]iaAzimuth index
Returns
VectorView To StokesVector

Definition at line 1385 of file propagationmatrix.h.

References joker, and PropagationMatrix::mdata.


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