ARTS  2.4.0(git:4fb77825)
optproperties.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2012 Claudia Emde <claudia.emde@dlr.de>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
18 /*===========================================================================
19  === File description
20  ===========================================================================*/
21 
33 #ifndef optproperties_h
34 #define optproperties_h
35 
36 #include "gridded_fields.h"
37 #include "interpolation_poly.h"
38 #include "matpackVII.h"
39 #include "messages.h"
40 #include "mystring.h"
41 #include "propagationmatrix.h"
42 
44 //structure (a scattering element).
53 enum PType : Index {
57 };
58 
60 
67 };
68 
69 /*===========================================================================
70  === The SingleScatteringData structure
71  ===========================================================================*/
72 
90 };
91 
94 
95 ostream& operator<<(ostream& os, const SingleScatteringData& ssd);
96 ostream& operator<<(ostream& os, const ArrayOfSingleScatteringData& assd);
97 
98 /*===========================================================================
99  === The ScatteringMetaData structure
100  ===========================================================================*/
117 };
118 
121 
122 ostream& operator<<(ostream& os, const ScatteringMetaData& ssd);
123 ostream& operator<<(ostream& os, const ArrayOfScatteringMetaData& assd);
124 
125 // General functions:
126 // =============================================================
127 
128 void opt_prop_Bulk( //Output
129  Tensor5& ext_mat,
130  Tensor4& abs_vec,
131  Index& ptype,
132  //Input
133  const ArrayOfTensor5& ext_mat_ss,
134  const ArrayOfTensor4& abs_vec_ss,
135  const ArrayOfIndex& ptypes_ss);
136 
137 void opt_prop_ScatSpecBulk( //Output
140  ArrayOfIndex& ptype,
141  //Input
142  const ArrayOfArrayOfTensor5& ext_mat_se,
143  const ArrayOfArrayOfTensor4& abs_vec_se,
144  const ArrayOfArrayOfIndex& ptypes_se,
145  ConstMatrixView pnds,
146  ConstMatrixView t_ok);
147 
148 void opt_prop_NScatElems( //Output
151  ArrayOfArrayOfIndex& ptypes,
152  Matrix& t_ok,
153  //Input
155  const Index& stokes_dim,
156  const Vector& T_array,
157  const Matrix& dir_array,
158  const Index& f_index,
159  const Index& t_interp_order = 1);
160 
161 void opt_prop_1ScatElem( //Output
164  Index& ptype,
165  VectorView t_ok,
166  //Input
167  const SingleScatteringData& ssd,
168  const Vector& T_array,
169  const Matrix& dir_array,
170  const Index& f_index,
171  const Index& t_interp_order = 1);
172 
173 void ext_mat_SSD2Stokes( //Output
174  MatrixView ext_mat_stokes,
175  //Input
176  ConstVectorView ext_mat_ssd,
177  const Index& stokes_dim,
178  const Index& ptype);
179 
180 void abs_vec_SSD2Stokes( //Output
181  VectorView abs_vec_stokes,
182  //Input
183  ConstVectorView abs_vec_ssd,
184  const Index& stokes_dim,
185  const Index& ptype);
186 
187 void pha_mat_Bulk( //Output
188  Tensor6& pha_mat,
189  Index& ptype,
190  //Input
191  const ArrayOfTensor6& pha_mat_ss,
192  const ArrayOfIndex& ptypes_ss);
193 
194 void pha_mat_ScatSpecBulk( //Output
196  ArrayOfIndex& ptype,
197  //Input
198  const ArrayOfArrayOfTensor6& pha_mat_se,
199  const ArrayOfArrayOfIndex& ptypes_se,
200  ConstMatrixView pnds,
201  ConstMatrixView t_ok);
202 
203 void pha_mat_NScatElems( //Output
205  ArrayOfArrayOfIndex& ptypes,
206  Matrix& t_ok,
207  //Input
209  const Index& stokes_dim,
210  const Vector& T_array,
211  const Matrix& pdir_array,
212  const Matrix& idir_array,
213  const Index& f_index,
214  const Index& t_interp_order = 1);
215 
216 void pha_mat_1ScatElem( //Output
218  Index& ptype,
219  VectorView t_ok,
220  //Input
221  const SingleScatteringData& ssd,
222  const Vector& T_array,
223  const Matrix& pdir_array,
224  const Matrix& idir_array,
225  const Index& f_start,
226  const Index& t_interp_order = 1);
227 
228 void FouComp_1ScatElem( //Output
229  Tensor7View pha_mat_fou,
230  Index& ptype,
231  VectorView t_ok,
232  //Input
233  const SingleScatteringData& ssd,
234  const Vector& T_array,
235  const Vector& pdir_array,
236  const Vector& idir_array,
237  const Index& f_start,
238  const Index& t_interp_order,
239  const Index& naa_totran);
240 
241 void abs_vecTransform( //Output and Input
242  StokesVector& abs_vec_lab,
243  //Input
244  ConstTensor3View abs_vec_data,
245  ConstVectorView za_datagrid,
246  ConstVectorView aa_datagrid,
247  const PType& ptype,
248  const Numeric& za_sca,
249  const Numeric& aa_sca,
250  const Verbosity& verbosity);
251 
252 void ext_matTransform( //Output and Input
253  PropagationMatrix& ext_mat_lab,
254  //Input
255  ConstTensor3View ext_mat_data,
256  ConstVectorView za_datagrid,
257  ConstVectorView aa_datagrid,
258  const PType& ptype,
259  const Numeric& za_sca,
260  const Numeric& aa_sca,
261  const Verbosity& verbosity);
262 
263 void pha_matTransform( //Output
264  MatrixView pha_mat_lab,
265  //Input
266  ConstTensor5View pha_mat_data,
267  ConstVectorView za_datagrid,
268  ConstVectorView aa_datagrid,
269  const PType& ptype,
270  const Index& za_sca_idx,
271  const Index& aa_sca_idx,
272  const Index& za_inc_idx,
273  const Index& aa_inc_idx,
276  const Verbosity& verbosity);
277 
278 void ext_matFromabs_vec( //Output
280  //Input
282  const Index& stokes_dim);
283 
284 void ssd_tinterp_parameters( //Output
285  VectorView t_ok,
286  Index& this_T_interp_order,
287  ArrayOfGridPosPoly& T_gp,
288  Matrix& T_itw,
289  //Input
290  ConstVectorView T_grid,
291  const Vector& T_array,
292  const Index& t_interp_order);
293 
294 // Functions for the case: Randomly oriented particles:
295 // ========================================================
296 
297 Numeric scat_angle(const Numeric& za_sca,
298  const Numeric& aa_sca,
299  const Numeric& za_inc,
300  const Numeric& aa_inc);
301 
302 void interpolate_scat_angle( //Output:
303  VectorView pha_mat_int,
304  //Input:
305  ConstTensor5View pha_mat_data,
306  ConstVectorView za_datagrid,
307  const Numeric theta);
308 
309 void pha_mat_labCalc( //Output:
310  MatrixView pha_mat_lab,
311  //Input:
312  ConstVectorView pha_mat_int,
313  const Numeric& za_sca,
314  const Numeric& aa_sca,
315  const Numeric& za_inc,
316  const Numeric& aa_inc,
317  const Numeric& theta_rad);
318 
319 // Get ext_mat and abs_vec from propmat_clearsky:
320 // ========================================================
321 
322 void opt_prop_sum_propmat_clearsky( //Output:
325  //Input:
327 
328 PType PTypeFromString(const String& ptype_string);
329 PType PType2FromString(const String& ptype_string);
330 
331 String PTypeToString(const PType& ptype);
332 
334 
336  const String& particle_ssdmethod_string);
337 
339  const ParticleSSDMethod& particle_ssdmethod_type);
340 
341 #endif //optproperties_h
Matrix
The Matrix class.
Definition: matpackI.h:1193
ARTS::Var::abs_vec
StokesVector abs_vec(Workspace &ws) noexcept
Definition: autoarts.h:2239
gridded_fields.h
Implementation of gridded fields.
opt_prop_sum_propmat_clearsky
void opt_prop_sum_propmat_clearsky(PropagationMatrix &ext_mat, StokesVector &abs_vec, const ArrayOfPropagationMatrix &propmat_clearsky)
Get optical properties from propmat_clearsky.
Definition: optproperties.cc:2414
Tensor7View
The Tensor7View class.
Definition: matpackVII.h:1286
SingleScatteringData::za_grid
Vector za_grid
Definition: optproperties.h:85
StokesVector
Stokes vector is as Propagation matrix but only has 4 possible values.
Definition: propagationmatrix.h:1075
MatrixView
The MatrixView class.
Definition: matpackI.h:1093
SingleScatteringData::f_grid
Vector f_grid
Definition: optproperties.h:83
PTYPE_GENERAL
@ PTYPE_GENERAL
Definition: optproperties.h:54
pha_mat_labCalc
void pha_mat_labCalc(MatrixView pha_mat_lab, ConstVectorView pha_mat_int, const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc, const Numeric &theta_rad)
Calculate phase matrix in laboratory coordinate system.
Definition: optproperties.cc:2198
ArrayOfArrayOfSingleScatteringData
Array< Array< SingleScatteringData > > ArrayOfArrayOfSingleScatteringData
Definition: optproperties.h:93
ParticleSSDMethodToString
String ParticleSSDMethodToString(const ParticleSSDMethod &particle_ssdmethod_type)
PARTICLE_SSDMETHOD_TMATRIX
@ PARTICLE_SSDMETHOD_TMATRIX
Definition: optproperties.h:66
operator<<
ostream & operator<<(ostream &os, const SingleScatteringData &ssd)
Definition: optproperties.cc:2378
SingleScatteringData::description
String description
Definition: optproperties.h:82
ARTS::Var::verbosity
Verbosity verbosity(Workspace &ws) noexcept
Definition: autoarts.h:7112
ScatteringMetaData::diameter_max
Numeric diameter_max
Definition: optproperties.h:114
ARTS::Var::f_index
Index f_index(Workspace &ws) noexcept
Definition: autoarts.h:3464
SingleScatteringData::aa_grid
Vector aa_grid
Definition: optproperties.h:86
ScatteringMetaData::refr_index
String refr_index
Definition: optproperties.h:112
PropagationMatrix
Definition: propagationmatrix.h:87
ConvertAzimuthallyRandomSingleScatteringData
void ConvertAzimuthallyRandomSingleScatteringData(SingleScatteringData &ssd)
Convert azimuthally-random oriented SingleScatteringData to latest version.
Definition: optproperties.cc:2544
ext_matFromabs_vec
void ext_matFromabs_vec(MatrixView ext_mat, ConstVectorView abs_vec, const Index &stokes_dim)
Derive extinction matrix from absorption vector.
Definition: optproperties.cc:1969
ARTS::Var::stokes_dim
Index stokes_dim(Workspace &ws) noexcept
Definition: autoarts.h:6650
scat_angle
Numeric scat_angle(const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc)
Calculates the scattering angle.
Definition: optproperties.cc:2095
PARTICLE_SSDMETHOD_NONE
@ PARTICLE_SSDMETHOD_NONE
Definition: optproperties.h:65
ArrayOfScatteringMetaData
Array< ScatteringMetaData > ArrayOfScatteringMetaData
Definition: optproperties.h:119
Tensor4
The Tensor4 class.
Definition: matpackIV.h:421
ParticleSSDMethodFromString
ParticleSSDMethod ParticleSSDMethodFromString(const String &particle_ssdmethod_string)
Convert particle ssd method name to enum value.
Definition: optproperties.cc:2658
SingleScatteringData
Definition: optproperties.h:80
ARTS::Var::pha_mat
Tensor4 pha_mat(Workspace &ws) noexcept
Definition: autoarts.h:4881
Array
This can be used to make arrays out of anything.
Definition: array.h:108
ScatteringMetaData::diameter_area_equ_aerodynamical
Numeric diameter_area_equ_aerodynamical
Definition: optproperties.h:116
ssd_tinterp_parameters
void ssd_tinterp_parameters(VectorView t_ok, Index &this_T_interp_order, ArrayOfGridPosPoly &T_gp, Matrix &T_itw, ConstVectorView T_grid, const Vector &T_array, const Index &t_interp_order)
Determine T-interpol parameters for a specific scattering element.
Definition: optproperties.cc:2008
PType2FromString
PType PType2FromString(const String &ptype_string)
Convert ptype name to enum value.
Definition: optproperties.cc:2484
SingleScatteringData::ptype
PType ptype
Definition: optproperties.h:81
PType
PType
An attribute to classify the particle type (ptype) of a SingleScatteringData.
Definition: optproperties.h:53
messages.h
Declarations having to do with the four output streams.
interpolate_scat_angle
void interpolate_scat_angle(VectorView pha_mat_int, ConstTensor5View pha_mat_data, ConstVectorView za_datagrid, const Numeric theta)
Interpolate data on the scattering angle.
Definition: optproperties.cc:2154
my_basic_string< char >
abs_vecTransform
void abs_vecTransform(StokesVector &abs_vec_lab, ConstTensor3View abs_vec_data, ConstVectorView za_datagrid, ConstVectorView aa_datagrid, const PType &ptype, const Numeric &za_sca, const Numeric &aa_sca, const Verbosity &verbosity)
Transformation of absorption vector.
Definition: optproperties.cc:1474
ScatteringMetaData::diameter_volume_equ
Numeric diameter_volume_equ
Definition: optproperties.h:115
ScatteringMetaData
Definition: optproperties.h:109
SingleScatteringData::ext_mat_data
Tensor5 ext_mat_data
Definition: optproperties.h:88
VectorView
The VectorView class.
Definition: matpackI.h:610
ext_matTransform
void ext_matTransform(PropagationMatrix &ext_mat_lab, ConstTensor3View ext_mat_data, ConstVectorView za_datagrid, ConstVectorView aa_datagrid, const PType &ptype, const Numeric &za_sca, const Numeric &aa_sca, const Verbosity &verbosity)
Transformation of extinction matrix.
Definition: optproperties.cc:1572
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Verbosity
Definition: messages.h:49
Tensor5View
The Tensor5View class.
Definition: matpackV.h:333
pha_mat_Bulk
void pha_mat_Bulk(Tensor6 &pha_mat, Index &ptype, const ArrayOfTensor6 &pha_mat_ss, const ArrayOfIndex &ptypes_ss)
Scattering species bulk phase matrix.
Definition: optproperties.cc:670
FouComp_1ScatElem
void FouComp_1ScatElem(Tensor7View pha_mat_fou, Index &ptype, VectorView t_ok, const SingleScatteringData &ssd, const Vector &T_array, const Vector &pdir_array, const Vector &idir_array, const Index &f_start, const Index &t_interp_order, const Index &naa_totran)
Preparing phase matrix fourier series components for one scattering element.
Definition: optproperties.cc:1218
ARTS::Var::ext_mat
PropagationMatrix ext_mat(Workspace &ws) noexcept
Definition: autoarts.h:3390
propagationmatrix.h
Stuff related to the propagation matrix.
ARTS::Var::scat_data
ArrayOfArrayOfSingleScatteringData scat_data(Workspace &ws) noexcept
Definition: autoarts.h:5840
ScatteringMetaData::source
String source
Definition: optproperties.h:111
opt_prop_1ScatElem
void opt_prop_1ScatElem(Tensor5View ext_mat, Tensor4View abs_vec, Index &ptype, VectorView t_ok, const SingleScatteringData &ssd, const Vector &T_array, const Matrix &dir_array, const Index &f_index, const Index &t_interp_order=1)
Preparing extinction and absorption from one scattering element.
Definition: optproperties.cc:335
ARTS::Var::za_grid
Vector za_grid(Workspace &ws) noexcept
Definition: autoarts.h:7771
interpolation_poly.h
Header file for interpolation_poly.cc.
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:982
PTYPE_AZIMUTH_RND
@ PTYPE_AZIMUTH_RND
Definition: optproperties.h:55
pha_mat_ScatSpecBulk
void pha_mat_ScatSpecBulk(ArrayOfTensor6 &pha_mat, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor6 &pha_mat_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok)
Scattering species bulk phase matrices.
Definition: optproperties.cc:708
pha_matTransform
void pha_matTransform(MatrixView pha_mat_lab, ConstTensor5View pha_mat_data, ConstVectorView za_datagrid, ConstVectorView aa_datagrid, const PType &ptype, const Index &za_sca_idx, const Index &aa_sca_idx, const Index &za_inc_idx, const Index &aa_inc_idx, ConstVectorView za_grid, ConstVectorView aa_grid, const Verbosity &verbosity)
Transformation of phase matrix.
Definition: optproperties.cc:1692
Tensor5
The Tensor5 class.
Definition: matpackV.h:506
ParticleSSDMethod
ParticleSSDMethod
An attribute to classify the method to be used for SingleScatteringData.
Definition: optproperties.h:64
ScatteringMetaData::description
String description
Definition: optproperties.h:110
pha_mat_NScatElems
void pha_mat_NScatElems(ArrayOfArrayOfTensor6 &pha_mat, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &pdir_array, const Matrix &idir_array, const Index &f_index, const Index &t_interp_order=1)
Phase matrices from all scattering elements.
Definition: optproperties.cc:796
PTypeFromString
PType PTypeFromString(const String &ptype_string)
Convert ptype name to enum value.
Definition: optproperties.cc:2454
pha_mat_1ScatElem
void pha_mat_1ScatElem(Tensor6View pha_mat, Index &ptype, VectorView t_ok, const SingleScatteringData &ssd, const Vector &T_array, const Matrix &pdir_array, const Matrix &idir_array, const Index &f_start, const Index &t_interp_order=1)
Preparing phase matrix from one scattering element.
Definition: optproperties.cc:881
abs_vec_SSD2Stokes
void abs_vec_SSD2Stokes(VectorView abs_vec_stokes, ConstVectorView abs_vec_ssd, const Index &stokes_dim, const Index &ptype)
Absorption vector scat_data to stokes format conversion.
Definition: optproperties.cc:633
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:132
Tensor4View
The Tensor4View class.
Definition: matpackIV.h:284
SingleScatteringData::abs_vec_data
Tensor5 abs_vec_data
Definition: optproperties.h:89
ext_mat_SSD2Stokes
void ext_mat_SSD2Stokes(MatrixView ext_mat_stokes, ConstVectorView ext_mat_ssd, const Index &stokes_dim, const Index &ptype)
Extinction matrix scat_data to stokes format conversion.
Definition: optproperties.cc:585
ArrayOfSingleScatteringData
Array< SingleScatteringData > ArrayOfSingleScatteringData
Definition: optproperties.h:92
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Tensor6
The Tensor6 class.
Definition: matpackVI.h:1088
opt_prop_NScatElems
void opt_prop_NScatElems(ArrayOfArrayOfTensor5 &ext_mat, ArrayOfArrayOfTensor4 &abs_vec, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &dir_array, const Index &f_index, const Index &t_interp_order=1)
Extinction and absorption from all scattering elements.
Definition: optproperties.cc:248
Vector
The Vector class.
Definition: matpackI.h:860
SingleScatteringData::pha_mat_data
Tensor7 pha_mat_data
Definition: optproperties.h:87
opt_prop_ScatSpecBulk
void opt_prop_ScatSpecBulk(ArrayOfTensor5 &ext_mat, ArrayOfTensor4 &abs_vec, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor5 &ext_mat_se, const ArrayOfArrayOfTensor4 &abs_vec_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok)
Scattering species bulk extinction and absorption.
Definition: optproperties.cc:148
ARTS::Var::propmat_clearsky
ArrayOfPropagationMatrix propmat_clearsky(Workspace &ws) noexcept
Definition: autoarts.h:5398
ARTS::Var::aa_grid
Vector aa_grid(Workspace &ws) noexcept
Definition: autoarts.h:1717
PTYPE_TOTAL_RND
@ PTYPE_TOTAL_RND
Definition: optproperties.h:56
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:476
SingleScatteringData::T_grid
Vector T_grid
Definition: optproperties.h:84
opt_prop_Bulk
void opt_prop_Bulk(Tensor5 &ext_mat, Tensor4 &abs_vec, Index &ptype, const ArrayOfTensor5 &ext_mat_ss, const ArrayOfTensor4 &abs_vec_ss, const ArrayOfIndex &ptypes_ss)
one-line descript
Definition: optproperties.cc:102
PTypeToString
String PTypeToString(const PType &ptype)
Convert particle type enum value to String.
Definition: optproperties.cc:2512
ScatteringMetaData::mass
Numeric mass
Definition: optproperties.h:113
ConstTensor5View
A constant view of a Tensor5.
Definition: matpackV.h:143
mystring.h
This file contains the definition of String, the ARTS string class.
Tensor7
The Tensor7 class.
Definition: matpackVII.h:2382
matpackVII.h
ArrayOfArrayOfScatteringMetaData
Array< Array< ScatteringMetaData > > ArrayOfArrayOfScatteringMetaData
Definition: optproperties.h:120
Tensor6View
The Tensor6View class.
Definition: matpackVI.h:621