ARTS 2.5.11 (git: 725533f0)
optproperties.h
Go to the documentation of this file.
1/*===========================================================================
2 === File description
3 ===========================================================================*/
4
16#ifndef optproperties_h
17#define optproperties_h
18
19#include "gridded_fields.h"
20#include "matpack_data.h"
21#include "messages.h"
22#include "mystring.h"
23#include "propagationmatrix.h"
24
26//structure (a scattering element).
35enum PType : Index {
39};
40
42
49};
50
51/*===========================================================================
52 === The SingleScatteringData structure
53 ===========================================================================*/
54
65 Vector f_grid;
66 Vector T_grid;
67 Vector za_grid;
68 Vector aa_grid;
69 Tensor7 pha_mat_data;
70 Tensor5 ext_mat_data;
71 Tensor5 abs_vec_data;
72
73 friend ostream& operator<<(ostream& os, const SingleScatteringData& ssd);
74};
75
78
79/*===========================================================================
80 === The ScatteringMetaData structure
81 ===========================================================================*/
94 Numeric mass;
95 Numeric diameter_max;
98
99 friend ostream& operator<<(ostream& os, const ScatteringMetaData& ssd);
100};
101
104
105// General functions:
106// =============================================================
107
108void opt_prop_Bulk( //Output
109 Tensor5& ext_mat,
110 Tensor4& abs_vec,
111 Index& ptype,
112 //Input
113 const ArrayOfTensor5& ext_mat_ss,
114 const ArrayOfTensor4& abs_vec_ss,
115 const ArrayOfIndex& ptypes_ss);
116
117void opt_prop_ScatSpecBulk( //Output
118 ArrayOfTensor5& ext_mat,
119 ArrayOfTensor4& abs_vec,
120 ArrayOfIndex& ptype,
121 //Input
122 const ArrayOfArrayOfTensor5& ext_mat_se,
123 const ArrayOfArrayOfTensor4& abs_vec_se,
124 const ArrayOfArrayOfIndex& ptypes_se,
125 ConstMatrixView pnds,
126 ConstMatrixView t_ok);
127
128void opt_prop_NScatElems( //Output
129 ArrayOfArrayOfTensor5& ext_mat,
130 ArrayOfArrayOfTensor4& abs_vec,
131 ArrayOfArrayOfIndex& ptypes,
132 Matrix& t_ok,
133 //Input
134 const ArrayOfArrayOfSingleScatteringData& scat_data,
135 const Index& stokes_dim,
136 const Vector& T_array,
137 const Matrix& dir_array,
138 const Index& f_index,
139 const Index& t_interp_order = 1);
140
141void opt_prop_1ScatElem( //Output
142 Tensor5View ext_mat,
143 Tensor4View abs_vec,
144 Index& ptype,
145 VectorView t_ok,
146 //Input
147 const SingleScatteringData& ssd,
148 const Vector& T_array,
149 const Matrix& dir_array,
150 const Index& f_index,
151 const Index& t_interp_order = 1);
152
153void ext_mat_SSD2Stokes( //Output
154 MatrixView ext_mat_stokes,
155 //Input
156 ConstVectorView ext_mat_ssd,
157 const Index& stokes_dim,
158 const Index& ptype);
159
160void abs_vec_SSD2Stokes( //Output
161 VectorView abs_vec_stokes,
162 //Input
163 ConstVectorView abs_vec_ssd,
164 const Index& stokes_dim,
165 const Index& ptype);
166
167void pha_mat_Bulk( //Output
168 Tensor6& pha_mat,
169 Index& ptype,
170 //Input
171 const ArrayOfTensor6& pha_mat_ss,
172 const ArrayOfIndex& ptypes_ss);
173
174void pha_mat_ScatSpecBulk( //Output
175 ArrayOfTensor6& pha_mat,
176 ArrayOfIndex& ptype,
177 //Input
178 const ArrayOfArrayOfTensor6& pha_mat_se,
179 const ArrayOfArrayOfIndex& ptypes_se,
180 ConstMatrixView pnds,
181 ConstMatrixView t_ok);
182
183void pha_mat_NScatElems( //Output
184 ArrayOfArrayOfTensor6& pha_mat,
185 ArrayOfArrayOfIndex& ptypes,
186 Matrix& t_ok,
187 //Input
188 const ArrayOfArrayOfSingleScatteringData& scat_data,
189 const Index& stokes_dim,
190 const Vector& T_array,
191 const Matrix& pdir_array,
192 const Matrix& idir_array,
193 const Index& f_index,
194 const Index& t_interp_order = 1);
195
196void pha_mat_1ScatElem( //Output
197 Tensor6View pha_mat,
198 Index& ptype,
199 VectorView t_ok,
200 //Input
201 const SingleScatteringData& ssd,
202 const Vector& T_array,
203 const Matrix& pdir_array,
204 const Matrix& idir_array,
205 const Index& f_start,
206 const Index& t_interp_order = 1);
207
208void abs_vecTransform( //Output and Input
209 StokesVector& abs_vec_lab,
210 //Input
211 ConstTensor3View abs_vec_data,
212 ConstVectorView za_datagrid,
213 ConstVectorView aa_datagrid,
214 const PType& ptype,
215 const Numeric& za_sca,
216 const Numeric& aa_sca,
217 const Verbosity& verbosity);
218
219void ext_matTransform( //Output and Input
220 PropagationMatrix& ext_mat_lab,
221 //Input
222 ConstTensor3View ext_mat_data,
223 ConstVectorView za_datagrid,
224 ConstVectorView aa_datagrid,
225 const PType& ptype,
226 const Numeric& za_sca,
227 const Numeric& aa_sca,
228 const Verbosity& verbosity);
229
230void pha_matTransform( //Output
231 MatrixView pha_mat_lab,
232 //Input
233 ConstTensor5View pha_mat_data,
234 ConstVectorView za_datagrid,
235 ConstVectorView aa_datagrid,
236 const PType& ptype,
237 const Index& za_sca_idx,
238 const Index& aa_sca_idx,
239 const Index& za_inc_idx,
240 const Index& aa_inc_idx,
241 ConstVectorView za_grid,
242 ConstVectorView aa_grid,
243 const Verbosity& verbosity);
244
245void ext_matFromabs_vec( //Output
246 MatrixView ext_mat,
247 //Input
248 ConstVectorView abs_vec,
249 const Index& stokes_dim);
250
251// Functions for the case: Randomly oriented particles:
252// ========================================================
253
254Numeric scat_angle(const Numeric& za_sca,
255 const Numeric& aa_sca,
256 const Numeric& za_inc,
257 const Numeric& aa_inc);
258
259void interpolate_scat_angle( //Output:
260 VectorView pha_mat_int,
261 //Input:
262 ConstTensor5View pha_mat_data,
263 ConstVectorView za_datagrid,
264 const Numeric theta);
265
266void pha_mat_labCalc( //Output:
267 MatrixView pha_mat_lab,
268 //Input:
269 ConstVectorView pha_mat_int,
270 const Numeric& za_sca,
271 const Numeric& aa_sca,
272 const Numeric& za_inc,
273 const Numeric& aa_inc,
274 const Numeric& theta_rad);
275
276// Get ext_mat and abs_vec from propmat_clearsky:
277// ========================================================
278
279void opt_prop_sum_propmat_clearsky( //Output:
280 PropagationMatrix& ext_mat,
281 StokesVector& abs_vec,
282 //Input:
283 const PropagationMatrix& propmat_clearsky);
284
285PType PTypeFromString(const String& ptype_string);
286PType PType2FromString(const String& ptype_string);
287
288String PTypeToString(const PType& ptype);
289
291
293 const String& particle_ssdmethod_string);
294
296 const ParticleSSDMethod& particle_ssdmethod_type);
297
298void ext_abs_pfun_from_tro(MatrixView ext_data,
299 MatrixView abs_data,
300 Tensor3View pfun_data,
301 const ArrayOfSingleScatteringData& scat_data,
302 const Index& iss,
303 ConstMatrixView pnd_data,
304 ArrayOfIndex& cloudbox_limits,
305 ConstVectorView T_grid,
306 ConstVectorView sa_grid,
307 const Index f_index = -1);
308
309#endif //optproperties_h
This can be used to make arrays out of anything.
Definition array.h:31
Implementation of gridded fields.
Declarations having to do with the four output streams.
This file contains the definition of String, the ARTS string class.
PType PType2FromString(const String &ptype_string)
Convert ptype name to enum value.
PType
An attribute to classify the particle type (ptype) of a SingleScatteringData.
@ PTYPE_GENERAL
@ PTYPE_AZIMUTH_RND
@ PTYPE_TOTAL_RND
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.
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.
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.
Array< ScatteringMetaData > ArrayOfScatteringMetaData
ParticleSSDMethod
An attribute to classify the method to be used for SingleScatteringData.
@ PARTICLE_SSDMETHOD_NONE
@ PARTICLE_SSDMETHOD_TMATRIX
void ext_matFromabs_vec(MatrixView ext_mat, ConstVectorView abs_vec, const Index &stokes_dim)
Derive extinction matrix from absorption vector.
void opt_prop_sum_propmat_clearsky(PropagationMatrix &ext_mat, StokesVector &abs_vec, const PropagationMatrix &propmat_clearsky)
Get optical properties from propmat_clearsky.
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.
Numeric scat_angle(const Numeric &za_sca, const Numeric &aa_sca, const Numeric &za_inc, const Numeric &aa_inc)
Calculates the scattering angle.
String ParticleSSDMethodToString(const ParticleSSDMethod &particle_ssdmethod_type)
Array< SingleScatteringData > ArrayOfSingleScatteringData
void ext_abs_pfun_from_tro(MatrixView ext_data, MatrixView abs_data, Tensor3View pfun_data, const ArrayOfSingleScatteringData &scat_data, const Index &iss, ConstMatrixView pnd_data, ArrayOfIndex &cloudbox_limits, ConstVectorView T_grid, ConstVectorView sa_grid, const Index f_index=-1)
Extinction, absorption and phase function for one scattering species, 1D and TRO.
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.
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.
Array< Array< SingleScatteringData > > ArrayOfArrayOfSingleScatteringData
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.
PType PTypeFromString(const String &ptype_string)
Convert ptype name to enum value.
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.
void pha_mat_Bulk(Tensor6 &pha_mat, Index &ptype, const ArrayOfTensor6 &pha_mat_ss, const ArrayOfIndex &ptypes_ss)
Scattering species bulk phase matrix.
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.
void ConvertAzimuthallyRandomSingleScatteringData(SingleScatteringData &ssd)
Convert azimuthally-random oriented SingleScatteringData to latest version.
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.
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
ParticleSSDMethod ParticleSSDMethodFromString(const String &particle_ssdmethod_string)
Convert particle ssd method name to enum value.
Array< Array< ScatteringMetaData > > ArrayOfArrayOfScatteringMetaData
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.
void interpolate_scat_angle(VectorView pha_mat_int, ConstTensor5View pha_mat_data, ConstVectorView za_datagrid, const Numeric theta)
Interpolate data on the scattering angle.
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.
String PTypeToString(const PType &ptype)
Convert particle type enum value to String.
Numeric diameter_area_equ_aerodynamical
friend ostream & operator<<(ostream &os, const ScatteringMetaData &ssd)
Numeric diameter_volume_equ
friend ostream & operator<<(ostream &os, const SingleScatteringData &ssd)