\graphicspath{{Figs/clouds/}}

\chapter{Description of scattering media}
 \label{sec:clouds}

\starthistory
 050913 & Created and written by Claudia Emde\\ 
 161107 & Extended regarding internal calculations of scat\_data and pnd\_fields by Jana Mendrok\\ 
\stophistory

\section{Introduction}
\label{sec:clouds:intro}

In the Earth's atmosphere we find liquid water clouds consisting of
approximately spherical water droplets and cirrus clouds consisting of
ice particles of diverse shapes and sizes. We also find different
kinds of aerosols. In order to take into account this variety, the
model allows to define several \emph{scattering elements}.

A scattering element is either a specific single particle or a particle
ensemble, e.g., an ensemble following a certain size or shape distribution. The
scattering element can represent particles that are completely randomly
oriented, azimuthally randomly oriented or arbitrarily oriented. Each scattering
element is characterized by its single scattering properties (SSP) and a field of
particle number densities.
For each grid point in the cloud box, the atmospheric volume that encloses all
scattering particles, the single scattering properties of all scattering
elements weighted by their respective particle number density at this location
are summed up to derive the cloud ensemble optical properties.

The \wsvindex{scat\_data} structure contains the single scattering properties
($\langle\ExtMat_i\rangle$, $\langle\AbsVec_i\rangle$, and
$\langle\PhaMat_i\rangle$) for each of the scattering elements. 
In \wsvindex{scat\_data}, the SSP are stored in different coordinate systems,
depending on the kind of particle. For instance, SSP of totally randomly
oriented particles are stored in the so-called scattering frame in order to
reduce memory requirements, while others use the particle frame.
Section~\ref{sec:clouds:ssp} describes in detail the
\typeindex{SingleScatteringData} class and section~\ref{sec:clouds:ssdgen}
presents options for preparing SSP.
For details on the coordinate systems used also see \theory~Section~%
\ref{T-sec:rtetheory:particle_coordinate_sytems} (Note: Coordinate systems used
by the SSP as well as the line-of-sight and radiation propagation directions in
the scattering solvers and the general radiative transfer part are not fully
consistent. However, as long as only totally or azimuthally randomly oriented
particles and only up to two Stokes components are considered this is of no
practical concern.
\FIXME{add appendix on known ARTS issues with a section on this particular one}).

The number density field, \wsvindex{pnd\_field}, contains the number densities
of all scattering elements at all grid points within the cloudbox. \wsvindex{pnd\_field} can be read in from externally prepared data files or be derived from mass density of flux fields provided to the model. Section \ref{sec:clouds:pndgen} describes the available options.

The WSVs \wsvindex{scat\_data} and \wsvindex{pnd\_field} together exhaustively
describe particle ensembles in ARTS. All ARTS scattering solvers consistently require and use these two WSVs to derive the bulk extinction, absorption, and phase matrices (\aExtMat{p}, \aAbsMat{p}, and \PhaMat).


\section{\textindex{Single scattering properties}}
\label{sec:clouds:ssp}

\subsection{Scattering data structure}
\label{sec:clouds:ARTS_SSP_structure}
 
The single scattering data is stored in a specific structure format, the
the \typeindex{SingleScatteringData} class\footnote{Definition resides in
\fileindex{optproperties.h}.}. The format allows space reduction due to
symmetry for certain special cases, e.g. totally random or azimuthally random
orientation. The class consists of the following fields (compare also Table
\ref{tab:scattering:datastructure}):

\begin{itemize}
\item  {\sl String} \shortcode{ptype}: An attribute, which flags type and format
  of the data stored. It essentially describes the type of particle regarding
  its symmetry properties (totally randomly oriented, azimuthally randomly
  oriented, general case, \dots). This attribute is needed in the radiative
  transfer function to be able to extract the physical phase matrix, the
  physical extinction matrix,  and the physical absorption vector from the data.
  
  Possible values of ptype are:
  
  \shortcode{"totally\_random"} \\
  \shortcode{"azimuthally\_random"} \\
  \shortcode{"general"}
  
  A detailed description of the different types including their different data
  formats and corrdinate systems used is given in
  Section~\ref{sec:clouds:particle_types}.

\item {\sl String} \shortcode{description}: Here, the scattering element
  is characterized explicitly in free text form. For example, information on
  the size and shape of the particle or the respective distributions of a
  particle ensemble might be given. This can be a longer text describing how the
  scattering properties were generated. It should be formatted for direct
  printout to screen or file.
  
\item {\sl Vector} \shortcode{f\_grid}: Frequency grid [Unit: Hz].
  
\item {\sl Vector} \shortcode{T\_grid}: Temperature grid [Unit: K].
  
\item {\sl Vector} \shortcode{za\_grid}:
  \begin{enumerate}
  \item \shortcode{"totally\_random"}:
    Scattering angle grid. Range: 0.0\degree{} $\le$ za $\le$ 180.0\degree{}.
  \item \shortcode{"azimuthally\_random"}:
    Zenith angle grid. Range: 0.0\degree{} $\le$ za $\le$ 180.0\degree{}.
    Symmetric with respect to 90.0\degree{} and explicitly including the
    90.0\degree{} point.
  \item \shortcode{"general"}:
    Zenith angle grid. Range: 0.0\degree{} $\le$ za $\le$ 180.0\degree{}.
  \end{enumerate}
  
\item {\sl Vector} \shortcode{aa\_grid}: Azimuth angle grid.
  \begin{enumerate}
  \item \shortcode{"totally\_random"}:
    Empty (not needed, since optical properties depend solely on scattering
    angle).
  \item \shortcode{"azimuthally\_random"}:
    Range: 0.0\degree{} $\le$ aa $\le$ 180.0\degree{} (due to symmetry only half of
    the general grid is required).
  \item \shortcode{"general"}: Range: -180.0\degree{} $\le$ aa $\le$ 180.0\degree{}
  \end{enumerate}
  
  The angular grids have to satisfy the following conditions:
  \begin{itemize}
  \item Range limits (0\degree{}, 180\degree{}, \dots) must be grid points.
  \item Data at azimuth angle values of -180.0\degree{} and 180.0\degree{} must be equal.
  \end{itemize}
  
\item {\sl Tensor7} \shortcode{pha\_mat\_data}:
  Phase matrix data \EnsAvr\PhaMat\ [Unit: m$^2$].

  The dimensions of the data array are:  
  
  \shortcode{[frequency temperature za\_sca aa\_sca za\_inc aa\_inc matrix\_element]}
  
  The order of matrix elements depends on the ptype of the data. For most types
  not all matrix elements need to be stored (see description of ptypes in
  Section~\ref{sec:clouds:particle_types}).

\item {\sl Tensor5} \shortcode{ext\_mat\_data}:
  Extinction matrix data \EnsAvr\ExtMat\ [Unit: m$^2$].

  The dimensions are: 

  \shortcode{[frequency temperature za\_inc aa\_inc matrix\_element]}
  
  Again, the order of matrix elements depends on the ptype of the data.

\item {\sl Tensor5} \shortcode{abs\_vec\_data}:
  Absorption vector data \EnsAvr\AbsVec\ [Unit: m$^2$]. 
  
  The dimensions are: 
  
  \shortcode{[frequency temperature za\_inc aa\_inc vector\_element]}

  The absorption vector is explicitly given. It could be calculated
  from extinction matrix and phase matrix. However, this would take
  significant computation time, as it requires an angular integration over
  the phase matrix and poses integration accuracy and grid representation
  issues, whereas the additional storage burden is comparably low.
\end{itemize}

\begin{table}
\begin{flushleft}
\begin{tabular}{llll}
\hline
\multicolumn{1}{c}{Symbol}&Type&Dimensions&Description \\
\hline
  &enum& & ptype specification \\
  &String& & short description of the scattering element \\
\Frq & Vector & (\Frq) & frequency grid \\
\Tmp  & Vector & (\Tmp) & temperature grid \\
\ZntAng & Vector & (\ZntAng) & zenith angle grid \\
\AzmAng & Vector & (\AzmAng) & azimuth angle grid \\
\EnsAvr{\PhaMat}  & Tensor7 & (\Frq, \Tmp, \ZntAng, \AzmAng,
$\ZntAng'$, $\AzmAng'$, $i$ )  & phase matrix \\ 
\EnsAvr{\ExtMat} & Tensor5  & (\Frq, \Tmp, \ZntAng, \AzmAng, $i$ ) & extinction matrix \\
\EnsAvr{\AbsVec} & Tensor5 & (\Frq, \Tmp, \ZntAng, \AzmAng, $i$ ) & absorption vector\\
\hline
\end{tabular}
\end{flushleft}
\caption{Structure of single scattering data files}
\label{tab:scattering:datastructure}
\end{table}

\subsection{Definition of \textindex{ptypes}}
\label{sec:clouds:particle_types}

Ptype essentially classifies the scattering elements regarding their symmetry
properties, which are largely governed by particle orientation. As indicated
above, this affects the optimal choice of the coordinate system to represent the
scattering element in. Possible ptypes in the model are:


\subsubsection{``totally\_random''}
The ptype value ``totally\_random'' refers to macroscopically
isotropic and mirror-symmetric scattering media. It covers totally randomly
oriented particles (with at least one plane of symmetry\footnote{Note: Even if
totally randomly oriented, particles lacking a symmetry plane are not part of
this category unless their mirrored counterparts are considered with equal
weight.}) as well as spherical particles.

For this type of scattering media, the optical properties are
stored in the scattering frame (see \theory~%
Section~\ref{T-sec:rtetheory:particle_coordinate_sytems}, where the z-axis
corresponds to the incident direction and the x-z-plane with the scattering
plane. Using this frame, only the scattering angle is needed, the angle between
incident and scattered direction. Furthermore, the number of matrix elements of
both the phase matrix and the extinction matrix can be reduced (see
\citet{Mishchenko:02}, p.90). This representation, however, requires an
ARTS-internal transformation of the phase matrix data from the particle frame
representation (in the scattering frame) to the laboratory frame representation.
These transformations are described in the Appendix of
\citet{emde05:_phdthesis}.

Only six elements of the phase matrix in the scattering frame, which is commonly
called scattering matrix \ScaMat, are independent. The order of the stored matrix
elements is: {\sl F11, F12, F22, F33, F34, F44}. The size of
\shortcode{pha\_mat\_data} is

\shortcode{[N\_f N\_T N\_za\_sca 1 1 1 6]}\\
%
The extinction matrix is in this case diagonal and independent of direction and
polarization. That means only one element per frequency and temperature needs to
be stored. Hence the size of \shortcode{ext\_mat\_data} is

\shortcode{[N\_f N\_T 1 1 1]}\\
%
The absorption vector is also direction and polarization independent. Therefore
the size of \shortcode{abs\_vec\_data} is

\shortcode{[N\_f N\_T 1 1 1]}


\subsubsection{``azimuthally\_random''}
The ptype value ``azimuthally\_random'' refers to particles that exhibit a
preferred orientation with respect to polar angle, but are oriented randomly regarding the
azimuthal angle. Horizontally aligned particles are one prominent example, but
this class is not limited to them. For these particles, one angular dimension is
redundant and can be omitted in the data, if the coordinate system is oriented
appropriately.

SSP here are stored in the laboratory frame. In this frame, the phase matrix,
extinction matrix, and absorption vector become independent of the incident
azimuth angle. Furthermore only half of the ``general'' angle ranges are
required for the azimuth angle due to symmetry reasons.
That is, \shortcode{aa\_grid} from 0\degree{} to 180\degree{}.

All 16 elements of the phase matrix are required. Their order is the same as in
the general case. The size of \shortcode{pha\_mat\_data} is

\shortcode{[N\_f N\_T N\_za\_sca N\_aa\_sca N\_za\_sca 1 16]}\\
For this ptype, the extinction matrix has only three independent elements, {\sl
Kjj}, {\sl K12(=K21)}, and {\sl K34(=-K43)}. The size of
\shortcode{ext\_mat\_data} is

\shortcode{[N\_f N\_T N\_za 1 3]}\\
The absorption coefficient vector has only two independent elements, {\sl a1} and
{\sl a2}. This means that the size of \shortcode{abs\_vec\_data} is 

\shortcode{[N\_f N\_T N\_za 1 2]}

\subsubsection{``general''}

NOTE: While basic definitions and infrastructure to handle particles of general
type exist, not all methods are fully implemented for this type. Hence,
calculations with arbitrary particles are currently \textbf{not possible}.

The ptype value ``general'' refers to arbitrarily shaped and oriented particles.
For those, generally no symmetries exist, hence all 16 elements of
the phase matrix have to be stored for the complete set of incident and
scattered directions. The matrix elements are stored in the order {\sl Z11,
Z12, Z13, Z14, Z21, Z22, \dots}. The size of \shortcode{pha\_mat\_data} is

\shortcode{[N\_f N\_T N\_za\_sca N\_aa\_sca N\_za\_inc N\_aa\_inc 16]}\\
Seven extinction matrix elements are independent (cp. \citet{Mishchenko:02},
p.55). The elements being equal for single particles are equal for a
distribution, too, as total extinction is derived by summing up individual
contribution. Extinction matrix generally only depends on the incident
direction, hence the size of ext\_mat\_data is

\shortcode{[N\_f N\_T N\_za\_inc N\_aa\_inc 7]}\\
The absorption vector in general has four components (cp. Equation
(2.186) in \citet{Mishchenko:02}). The size of abs\_vec\_data is
accordingly

\shortcode{[N\_f N\_T N\_za\_inc N\_aa\_inc 4]}


\section{Generating single scattering properties}
\label{sec:clouds:ssdgen}

The single scattering properties in the above described format have to be
available to ARTS when entering the scattering solver. The data can be
prepared by external tools or from internally interfaced methods.

Generally, single scattering properties can be calculated for example by Mie
\citep[e.g.][]{wiscombe80:_improved_ao, maetzler02:_matlab}, T-Matrix
\citep{Mishchenko:98} or Discrete dipole approximation, DDA,
\citep[e.g][]{yurkin11:_adda_jqsrt} methods. While Mie methods can only provide
data for macroscopically isotropic particles, T-matrix methods are applicable
for certain anisotropic particles, too, and DDA is capable of handling
completely general particles.

The user is free to use any tools to derive the single scattering
properties, but has to ensure to store the data in the appropriate format. That
is, totally\_random particle data has to be provided in the
scattering frame, while the other two types are given in the laboratory frame.
Depending on the method used, averaging the single scattering properties of
particles in fixed orientation over a range of orientations might required.

Within ARTS and its supporting software packages some methods to prepare single
scattering data are available:
\begin{itemize}
\item
The WSM \wsmindex{scat\_data\_singleTmatrix} provides an ARTS internal interface
to the the T-matrix code by \citet{Mishchenko:02}. It allows to calculate single
scattering properties of individual scattering elements including orientation
averaging and reference frame adjustion. It is currently only available for a
limited number of particle shapes (see online documentation) and orientations
(namely for totally randomly oriented and perfectly horizontally aligned
particles, but not for generally azimuthally randomly oriented ones).
\item
The ATMLAB package, available at \artsurl{tools/}, includes functions to
generate single scattering properties for spherical particles (Mie-Theory) as
well as an interface to ARTS' own \wsmindex{scat\_data\_singleTmatrix} WSM.
\item
The Python module PyARTS used to provide methods to generate single scattering
properties for horizontally aligned as well as for randomly oriented particles
in the ARTS data-file-format. NOTE: PyARTS is currently not maintained and
updated along with ARTS development. Hence, functionality of specific methods is
not guaranteed.
\end{itemize}

Since WSVs \wsvindex{scat\_data} and \wsvindex{pnd\_field} form a paired
input to ARTS' scattering solvers, dedicated methods exist for loading
externally prepared data consistently into these WSVs. WSMs
\wsmindex{ScatElementsPndAndScatAdd} and \wsmindex{ScatSpeciesPndAndScatAdd} can
be applied for loading externally prepared single scattering data and particle
number density field raw data (into \wsvindex{pnd\_field\_raw}) simultaneously.
In case, particle scattering should be neglected and particles considered as
absorbing species only (see Section~\ref{sec:absorption:particles}), WSM
\wsmindex{ScatElementsToabs\_speciesAdd} should be used to load the data into
\builtindoc{scat\_data} and \builtindoc{vmr\_field\_raw}. If particle number
density fields are calculated internally from atmospheric cloud fields (see
Section~\ref{sec:clouds:pndgen:internal}, WSM
\wsmindex{ScatSpeciesScatAndMetaRead} can be applied.


\section{Generating particle number density fields}
\label{sec:clouds:pndgen}

\subsection{Externally created particle number density fields}
\label{sec:clouds:pndgen:external}
Externally created particle number density fields have to be provided to ARTS in
the form of GriddedField3 data. Using the WSMs
\wsmindex{ScatElementsPndAndScatAdd} or \wsmindex{ScatSpeciesPndAndScatAdd},
they are loaded into the WSV \wsvindex{pnd\_field\_raw} simultaneously as the
corresponding single scattering properties are loaded into
\wsvindex{scat\_data}. WSM \builtindoc{ScatElementsPndAndScatAdd} reads number
density fields for individual scattering elements, i.e., GriddedField3 format
data, and appends the data as one array element to \wsvindex{pnd\_field\_raw},
whereas \builtindoc{ScatSpeciesPndAndScatAdd} expects a set of number density
fields in the form of ArrayOfGriddedField3, which is appended to
\builtindoc{pnd\_field\_raw}.

Before entering a scattering solver, \wsvindex{pnd\_field} has to be calculated
from the raw number density fields using
\wsmindex{pnd\_fieldCalcFrompnd\_field\_raw}. The data for all scattering
elements is regridded to the common RT calculation grids of pressure, latitude, and
longitude and stored together in Tensor4 format. Particle number density fields
are restricted to the cloudbox, i.e., \builtindoc{pnd\_field} is only derived
for the RT grid points within the cloudbox region. That is, the cloudbox region
has to be defined before applying
\builtindoc{pnd\_fieldCalcFrompnd\_field\_raw}. For WSMs to set the cloudbox see
Section~\ref{sec:fm_defs:cloudbox}.

\subsection{Internal calculation of particle number density fields}
\label{sec:clouds:pndgen:internal}

ARTS offers the possibility to internally derive the \wsvindex{pnd\_field}
making use of atmospheric hydrometeor fields as provided by numerical weather or
general circulation models.

\FIXME{write. consider/discuss:}
\begin{itemize}
\item related atm fields
\item scat\_species, PSDs
\item scat\_meta
\end{itemize}

This mechanism requires additional information about the scattering elements
compared to \wsvindex{scat\_data}, particularly measures used in the
characterization of the hydrometeor ensembles, like mass and other size
parameters. This information, also called the scattering meta data, is stored in
the WSV \wsvindex{scat\_meta}, where the external structure, that is the
scattering species and scattering element hierarchy as well as the number of
these instances) has to be identical to \builtindoc{scat\_data}.

\subsection{Scattering meta data structure}
\label{sec:clouds:ARTS_SMD_structure}
The scattering meta data is stored in a specific structure format, the
the \typeindex{ScatteringMetaData} class\footnote{Definition resides in
\fileindex{optproperties.h}.}. The class consists of the following fields
(compare also %Table \ref{tab:scatmeta:datastructure} and
 the built-in doumentation of \wsvindex{scat\_meta\_single}):

\begin{itemize}
\item  {\sl String} \shortcode{description}:
  Similar to the \shortcode{description} field in \builtindoc{scat\_data}, this
  gives a free-form description of the scattering element, e.g. information
  deemed of interest by the user but not covered by other structure members. It
  is only for informative purpose, i.e., not used within ARTS for any
  classifications or calculations.

\item  {\sl String} \shortcode{source}:
  Free-form description of the source of the data, e.g., Mie, T-Matrix, or DDA
  calculation or a database or literature source. As \shortcode{description}
  only for informative purpose.

\item  {\sl String} \shortcode{refr\_index}:
  Free-form description of the underlying complex refractive index data, e.g., a
literature source. As \shortcode{description} only for informative purpose.

\item  {\sl Numeric} \shortcode{mass}:
  Mass $m$ of the scattering element [Unit: kg].

\item  {\sl Numeric} \shortcode{diameter\_max}:
  Maximum diameter $D_\mathrm{max}$ of the scattering element [Unit: m].

  The maximum diameter (or dimension) is defined by the circumferential sphere
  diameter of the element. Note that this parameter is only used by some size
  distributions; it does not have a proper meaning if the scattering element
  represents an ensemble of differently sized particles.

\item  {\sl Numeric} \shortcode{diameter\_volume\_equ}:
  Volume equivalent sphere diameter $D_\mathrm{veq}$ of the scattering element
  [Unit: m].

  The volume equivalent sphere diameter is the diameter of a sphere with the
same volume. For nonspherical particles, volume refers to the volume of the
particle-forming substance, not that of the circumferential sphere (which can be
derived from diameter\_max).

If the particle consists of a mixture of materials,
the substance encompasses the complete mixture, but excluding inclusions and
pockets of the the material, the particle is embedded in, typically air. Note: 
the air-material mixture of 'soft' particles forms a new substance, though; i.e.
the soft particle volume should include both the basic material and air of the
homogeneous mixture. However, this interpretation might be inconsistent with
certain microphysical models. In this case, the user should rather ensure
consistency of the $D_\mathrm{veq}$ setting with microphysics.

\FIXME{emntion/discuss relation to mass equivalent diameter? melted diameter?}

\item  {\sl Numeric} \shortcode{diameter\_area\_equ\_aerodynamical}:
  Aerodynamical area equivalent sphere diameter of the scattering element [Unit: m].

  The area equivalent sphere diameter is the diameter of a sphere with the same
  cross-sectional area. Here, area refers to the aerodynamically active area,
  i.e., the cross-sectional area perpendicular to the falling direction.
  Similarly to volume in the definition of \shortcode{diameter\_volume\_equ}, for
  non-spherical and mixed-material particles, area refers to the area covered by
  the substance mixture of the particle.
  The parameter might be relevant for characterizing the particle shape
  (preferred orientation) and fall velocity. However, it is so far unused within
  ARTS.
\end{itemize}


\section{Implementation}
\label{sec:clouds:implement}

The workspace methods related to the description of clouds in ARTS are
implemented in the file \fileindex{m\_cloudbox.cc}.
Work space methods related to the optical properties of the clouds are
implemented in the file \fileindex{m\_optproperties.cc}. The coordinate system
transformations described above reside in the file
\fileindex{optproperties.cc}.

\subsection{Work space methods and variables}

The following controlfile section illustrates how a simple cloud can
be included in an ARTS calculation. 

First we have to define the cloudbox region, i.e. the region where
scattering objects are found. To do this we can use the method
\wsmindex{cloudboxSetManuallyAltitude}:
\begin{code}
cloudboxSetManuallyAltitude( cloudbox_on, cloudbox_limits,
                             atmosphere_dim, z_field,
                             lat_grid, lon_grid,
                             8000, 120000,
                             0, 0, 0, 0 )
\end{code}
If we want to do a simulation for a
cirrus cloud at an altitude from 9 to 11\,km the cloudbox limits can
be set to 8 and 12\,km. The latitude and longitude limits are set to
an arbitrary value for a 1D calculation. For 3D calculations they are
also needed. Alternatively one can use the method
\wsmindex{cloudboxSetManually}, where one has to provide pressure
instead of altitude limits. 
 
Now we have to specify the cloud particles inside the scattering
region:
\begin{code}
# Initialisation
ParticleTypeInit
# Only one scattering element is added in this example 
ScatElementsPndAndScatAdd( scat_data, pnd_field_raw,
                 atmosphere_dim, f_grid,
                 ["ssd_sphere_50um_macroscopically_isotropic.xml",
                  "ssd_cylinder_30um_horizontally_aligned.xml"],
                 ["pnd_sphere_50um_macroscopically_isotropic.xml",
                  "pnd_cylinder_30um_horizontally_aligned.xml"] )
\end{code}
In the workspace method \wsmindex{ScatElementsPndAndScatAdd} the single
scattering properties for individual (one or more) scattering elements are read
and the scattering element data is appended to the last defined scattering
species.
The generic input \shortcode{scat\_data\_filenames} holds the list of filenames
of the datafiles containing the single scattering data per scattering element
(class \typeindex{SingleScatteringData}) in xml-format. The generic input
\shortcode{pnd\_field\_files} holds the list of filenames of the
corresponding particle number density fields in xml-format (class
\typeindex{GField3}). Adding multiple scattering element instances can be done
at once as demonstrated in the above example, where two elements, a sphere and
and a horizontally aligned cylindrical particle, are added.

Alternatively it is possible to use the method
\wsmindex{ScatSpeciesPndAndScatAdd}. It is, e.g., convenient to generate a size
distribution using several size bins, where each scattering element constitutes
one size bin. \wsmindex{ScatSpeciesPndAndScatAdd} creates a new scattering
species and adds all data of all covered scattering elements to this species. It
requires as input an array of string including the filenames of the single
scattering data files for all individual scattering elements and the name of the
data file holding the complete variable \wsvindex{pnd\_field\_raw}, i.e., the
particle number density fields for all scattering elements at once. Using this
function, one has to make sure that the order of the filenames containing the
single scattering data corresponds to the order of the particle number density
fields in \wsvindex{pnd\_field\_raw}.

After reading the data the workspace variable \wsvindex{pnd\_field} is
calculated using \wsmindex{pnd\_fieldCalcFrompnd\_field\_raw}: 
\begin{code}
# Calculate the particle number density field
pnd_fieldCalcFrompnd_field_raw
\end{code}

The definition of the single scattering data along with the
corresponding particle number density fields is common in both
scattering modules, the DOIT module described in 
Chapter \ref{sec:scattering:doit} and the Monte Carlo module in
Chapter \ref{sec:scattering:mc}.


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "uguide"
%%% End: 
