ARTS
2.4.0(git:4fb77825)
|
Workspace functions related to the definintion of the cloud box. More...
#include <cmath>
#include <cstdlib>
#include <stdexcept>
#include "array.h"
#include "arts.h"
#include "auto_md.h"
#include "check_input.h"
#include "cloudbox.h"
#include "file.h"
#include "gridded_fields.h"
#include "interpolation.h"
#include "lin_alg.h"
#include "logic.h"
#include "math_funcs.h"
#include "messages.h"
#include "microphysics.h"
#include "optproperties.h"
#include "parameters.h"
#include "physics_funcs.h"
#include "rte.h"
#include "sorting.h"
#include "special_interp.h"
#include "xml_io.h"
Go to the source code of this file.
Functions | |
void | cloudboxOff (Index &cloudbox_on, Index &ppath_inside_cloudbox_do, ArrayOfIndex &cloudbox_limits, Agenda &iy_cloudbox_agenda, Tensor4 &pnd_field, ArrayOfTensor4 &dpnd_field_dx, ArrayOfString &scat_species, ArrayOfArrayOfSingleScatteringData &scat_data, ArrayOfArrayOfSingleScatteringData &scat_data_raw, Index &scat_data_checked, Matrix &particle_masses, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &) |
WORKSPACE METHOD: cloudboxOff. More... | |
void | cloudboxSetAutomatically (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor4 &particle_field, const ArrayOfIndex &cloudbox_limits_old, const Numeric &cloudbox_margin, const Verbosity &verbosity) |
WORKSPACE METHOD: cloudboxSetAutomatically. More... | |
void | cloudboxSetFullAtm (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Verbosity &) |
WORKSPACE METHOD: cloudboxSetFullAtm. More... | |
void | cloudboxSetManually (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Numeric &p1, const Numeric &p2, const Numeric &lat1, const Numeric &lat2, const Numeric &lon1, const Numeric &lon2, const Verbosity &) |
WORKSPACE METHOD: cloudboxSetManually. More... | |
void | cloudboxSetManuallyAltitude (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Tensor3 &z_field, const Vector &lat_grid, const Vector &lon_grid, const Numeric &z1, const Numeric &z2, const Numeric &lat1, const Numeric &lat2, const Numeric &lon1, const Numeric &lon2, const Verbosity &) |
WORKSPACE METHOD: cloudboxSetManuallyAltitude. More... | |
void | iyInterpCloudboxField (Matrix &iy, const Tensor7 &cloudbox_field, const Vector &rte_pos, const Vector &rte_los, const Index &jacobian_do, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &z_surface, const Index &stokes_dim, const Vector &za_grid, const Vector &aa_grid, const Vector &f_grid, const Index &za_interp_order, const Index &za_restrict, const Index &cos_za_interp, const Numeric &za_extpolfac, const Index &aa_interp_order, const Verbosity &) |
WORKSPACE METHOD: iyInterpCloudboxField. More... | |
void | cloudbox_fieldCrop (Tensor7 &cloudbox_field, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Index &cloudbox_on, const Index &new_limit0, const Index &new_limit1, const Index &new_limit2, const Index &new_limit3, const Index &new_limit4, const Index &new_limit5, const Verbosity &) |
WORKSPACE METHOD: cloudbox_fieldCrop. More... | |
void | particle_fieldCleanup (Tensor4 &particle_field_out, const Tensor4 &particle_field_in, const Numeric &threshold, const Verbosity &) |
WORKSPACE METHOD: particle_fieldCleanup. More... | |
void | ScatSpeciesInit (ArrayOfString &scat_species, ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfArrayOfScatteringMetaData &scat_meta, Index &scat_data_checked, ArrayOfGriddedField3 &pnd_field_raw, const Verbosity &) |
WORKSPACE METHOD: ScatSpeciesInit. More... | |
void | ScatElementsPndAndScatAdd (ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const ArrayOfString &scat_data_files, const ArrayOfString &pnd_field_files, const Verbosity &verbosity) |
WORKSPACE METHOD: ScatElementsPndAndScatAdd. More... | |
void | ScatSpeciesPndAndScatAdd (ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const ArrayOfString &scat_data_files, const String &pnd_fieldarray_file, const Verbosity &verbosity) |
WORKSPACE METHOD: ScatSpeciesPndAndScatAdd. More... | |
void | ScatElementsToabs_speciesAdd (ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &vmr_field_raw, ArrayOfArrayOfSpeciesTag &abs_species, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfString &scat_data_files, const ArrayOfString &pnd_field_files, const Verbosity &verbosity) |
WORKSPACE METHOD: ScatElementsToabs_speciesAdd. More... | |
void | ScatSpeciesScatAndMetaRead (ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfArrayOfScatteringMetaData &scat_meta, const ArrayOfString &scat_data_files, const Verbosity &verbosity) |
WORKSPACE METHOD: ScatSpeciesScatAndMetaRead. More... | |
void | ScatElementsSelect (ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfArrayOfScatteringMetaData &scat_meta, const ArrayOfString &scat_species, const String &species, const String &sizeparam, const Numeric &sizemin, const Numeric &sizemax, const Numeric &tolerance, const String &delim, const Verbosity &) |
WORKSPACE METHOD: ScatElementsSelect. More... | |
void | ScatSpeciesExtendTemperature (ArrayOfArrayOfSingleScatteringData &scat_data_raw, const ArrayOfString &scat_species, const String &species, const String &scat_species_delim, const Numeric &T_low, const Numeric &T_high, const Verbosity &) |
WORKSPACE METHOD: ScatSpeciesExtendTemperature. More... | |
void | pnd_fieldCalcFrompnd_field_raw (Tensor4 &pnd_field, ArrayOfTensor4 &dpnd_field_dx, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &zeropadding, const Verbosity &verbosity) |
WORKSPACE METHOD: pnd_fieldCalcFrompnd_field_raw. More... | |
void | pnd_fieldExpand1D (Tensor4 &pnd_field, const Index &atmosphere_dim, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &nzero, const Verbosity &) |
WORKSPACE METHOD: pnd_fieldExpand1D. More... | |
void | pnd_fieldZero (Tensor4 &pnd_field, ArrayOfTensor4 &dpnd_field_dx, ArrayOfArrayOfSingleScatteringData &scat_data, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfIndex &cloudbox_limits, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &) |
WORKSPACE METHOD: pnd_fieldZero. More... | |
Variables | |
const Index | GFIELD3_P_GRID |
const Index | GFIELD3_LAT_GRID |
const Index | GFIELD3_LON_GRID |
const Numeric | PI |
const Numeric | DEG2RAD |
const Numeric | RAD2DEG |
const Numeric | LAT_LON_MIN |
const Numeric | DENSITY_OF_ICE |
Workspace functions related to the definintion of the cloud box.
These functions are listed in the doxygen documentation as entries of the file auto_md.h.
Definition in file m_cloudbox.cc.
void cloudbox_fieldCrop | ( | Tensor7 & | cloudbox_field, |
ArrayOfIndex & | cloudbox_limits, | ||
const Index & | atmosphere_dim, | ||
const Index & | cloudbox_on, | ||
const Index & | new_limit0, | ||
const Index & | new_limit1, | ||
const Index & | new_limit2, | ||
const Index & | new_limit3, | ||
const Index & | new_limit4, | ||
const Index & | new_limit5, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: cloudbox_fieldCrop.
Extracts a part of an existing cloudbox_field.
The cropping is defined by defining new cloudbox limits. Note that new_limit0* is an index with respect to p_grid, etc.
The following must be valid: <br> new_limit0 >= cloudbox_limits[0] <br> new_limit1 <= cloudbox_limits[1] <br> new_limit2 >= cloudbox_limits[2] <br> new_limit3 <= cloudbox_limits[3] <br> new_limit4 >= cloudbox_limits[4] <br> new_limit5 <= cloudbox_limits[5]
Indexes for dimensions not used are ignored.
[in,out] | cloudbox_field | WS Input/Output |
[in,out] | cloudbox_limits | WS Input/Output |
[in] | atmosphere_dim | WS Input |
[in] | cloudbox_on | WS Input |
[in] | new_limit0 | Generic Input (Default: "0") |
[in] | new_limit1 | Generic Input (Default: "0") |
[in] | new_limit2 | Generic Input (Default: "0") |
[in] | new_limit3 | Generic Input (Default: "0") |
[in] | new_limit4 | Generic Input (Default: "0") |
[in] | new_limit5 | Generic Input (Default: "0") |
Definition at line 1030 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), ARTS::Var::cloudbox_field(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), and joker.
Referenced by cloudbox_fieldCrop_g().
void cloudboxOff | ( | Index & | cloudbox_on, |
Index & | ppath_inside_cloudbox_do, | ||
ArrayOfIndex & | cloudbox_limits, | ||
Agenda & | iy_cloudbox_agenda, | ||
Tensor4 & | pnd_field, | ||
ArrayOfTensor4 & | dpnd_field_dx, | ||
ArrayOfString & | scat_species, | ||
ArrayOfArrayOfSingleScatteringData & | scat_data, | ||
ArrayOfArrayOfSingleScatteringData & | scat_data_raw, | ||
Index & | scat_data_checked, | ||
Matrix & | particle_masses, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: cloudboxOff.
Deactivates the cloud box.
Use this method if no scattering calculations shall be performed.
The function sets cloudbox_on to 0, cloudbox_limits, pnd_field*, scat_data, scat_data_raw, iy_cloudbox_agenda and particle_masses to be empty and sizes dpnd_field_dx to be consitent with jacobian_quantities.
[out] | cloudbox_on | WS Output |
[out] | ppath_inside_cloudbox_do | WS Output |
[out] | cloudbox_limits | WS Output |
[out] | iy_cloudbox_agenda | WS Output |
[out] | pnd_field | WS Output |
[out] | dpnd_field_dx | WS Output |
[out] | scat_species | WS Output |
[out] | scat_data | WS Output |
[out] | scat_data_raw | WS Output |
[out] | scat_data_checked | WS Output |
[out] | particle_masses | WS Output |
[in] | jacobian_quantities | WS Input |
Definition at line 81 of file m_cloudbox.cc.
References ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), ARTS::Var::dpnd_field_dx(), ARTS::Var::iy_cloudbox_agenda(), ARTS::Var::jacobian_quantities(), ARTS::Var::particle_masses(), ARTS::Var::pnd_field(), ARTS::Var::ppath_inside_cloudbox_do(), ARTS::Var::scat_data(), ARTS::Var::scat_data_checked(), ARTS::Var::scat_data_raw(), and ARTS::Var::scat_species().
Referenced by cloudboxOff_g().
void cloudboxSetAutomatically | ( | Index & | cloudbox_on, |
ArrayOfIndex & | cloudbox_limits, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor4 & | particle_field, | ||
const ArrayOfIndex & | cloudbox_limits_old, | ||
const Numeric & | cloudbox_margin, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: cloudboxSetAutomatically.
Sets the cloud box to encompass the cloud given by the entries in particle_field.
This WSM handles one Tensor4 type particle_field at a time. It can be used to determine the cloudbox from particle_bulkprop_field
The function must be called before executing any WSM that applies cloudbox_limits*.
The function iterates over all 3D fields in particle_field (which might correspond to different particle bulk properties as in particle_bulkprop_field*). Each field is searched for the first and last pressure index, where the value is unequal to zero. This index is then copied to cloudbox_limits. If particle_field is empty, the cloudbox is switched off (cloudbox_on=0).
Additionaly the lower cloudbox_limit is altered by cloudbox_margin. The margin is given as a height difference in meters and transformed into a pressure (via isothermal barometric height formula). This alteration is to ensure covering photons that leave the cloud, but reenter through a limb path. If cloudbox_margin is set to -1 (default), the cloudbox will extend to the surface. Hence, the lower cloudbox_limit is set to 0 (index of first pressure level). cloudbox_margin* will be applied on each call of the WSM.
Works only for atmosphere_dim==1.
[out] | cloudbox_on | WS Output |
[out] | cloudbox_limits | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | particle_field | Generic Input |
[in] | cloudbox_limits_old | Generic Input (Default: "[-1]") |
[in] | cloudbox_margin | Generic Input (Default: "-1") |
Definition at line 112 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), barometric_heightformula(), chk_atm_grids(), chk_if_in_range(), chk_scat_species_field(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), CREATE_OUT0, CREATE_OUT2, ConstTensor4View::empty(), find_cloudlimits(), joker, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), max, min, ConstTensor4View::nbooks(), Array< base >::nelem(), and ARTS::Var::p_grid().
Referenced by cloudboxSetAutomatically_g().
void cloudboxSetFullAtm | ( | Index & | cloudbox_on, |
ArrayOfIndex & | cloudbox_limits, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: cloudboxSetFullAtm.
Sets the cloudbox to cover the full atmosphere.
[out] | cloudbox_on | WS Output |
[out] | cloudbox_limits | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
Definition at line 283 of file m_cloudbox.cc.
References abs, ARTS::Var::atmosphere_dim(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), DEG2RAD, ARTS::Var::lat_grid(), LAT_LON_MIN, ARTS::Var::lon_grid(), max, and ARTS::Var::p_grid().
Referenced by cloudboxSetFullAtm_g(), and DisortCalcClearsky().
void cloudboxSetManually | ( | Index & | cloudbox_on, |
ArrayOfIndex & | cloudbox_limits, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Numeric & | p1, | ||
const Numeric & | p2, | ||
const Numeric & | lat1, | ||
const Numeric & | lat2, | ||
const Numeric & | lon1, | ||
const Numeric & | lon2, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: cloudboxSetManually.
Sets the cloud box to encompass the given positions.
The function sets cloudbox_on to 1 and sets cloudbox_limits following the given pressure, latitude and longitude positions. The index limits in cloudbox_limits are selected to give the smallest possible cloud box that encompass the given points.
The points must be given in the same order as used in cloudbox_limits*. That means that the first keyword argument shall be a higher pressure than argument two, while the latitude and longitude points are given in increasing order. Positions given for dimensions not used by the selected atmospheric dimensionality are ignored.
The given pressure points can be outside the range of p_grid. The pressure limit is then set to the end point of p_grid. The given latitude and longitude points must be inside the range of the corresponding grid. In addition, the latitude and longitude points cannot be inside the outermost grid ranges as the latitude and longitude limits in cloudbox_limits are not allowed to be grid end points.
[out] | cloudbox_on | WS Output |
[out] | cloudbox_limits | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | p1 | Generic Input |
[in] | p2 | Generic Input |
[in] | lat1 | Generic Input |
[in] | lat2 | Generic Input |
[in] | lon1 | Generic Input |
[in] | lon2 | Generic Input |
Definition at line 368 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), chk_atm_grids(), chk_if_in_range(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), and ARTS::Var::p_grid().
Referenced by cloudboxSetManually_g(), and ybatchMetProfiles().
void cloudboxSetManuallyAltitude | ( | Index & | cloudbox_on, |
ArrayOfIndex & | cloudbox_limits, | ||
const Index & | atmosphere_dim, | ||
const Tensor3 & | z_field, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Numeric & | z1, | ||
const Numeric & | z2, | ||
const Numeric & | lat1, | ||
const Numeric & | lat2, | ||
const Numeric & | lon1, | ||
const Numeric & | lon2, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: cloudboxSetManuallyAltitude.
Sets the cloud box to encompass the given positions.
As cloudboxSetManually but uses altitudes instead of pressure. The given altitude points can be outside the range of z_field. The altitude limit is then set to the end point of p_grid.
[out] | cloudbox_on | WS Output |
[out] | cloudbox_limits | WS Output |
[in] | atmosphere_dim | WS Input |
[in] | z_field | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | z1 | Generic Input |
[in] | z2 | Generic Input |
[in] | lat1 | Generic Input |
[in] | lat2 | Generic Input |
[in] | lon1 | Generic Input |
[in] | lon2 | Generic Input |
Definition at line 477 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), chk_if_in_range(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), and ARTS::Var::z_field().
Referenced by cloudboxSetManuallyAltitude_g().
void iyInterpCloudboxField | ( | Matrix & | iy, |
const Tensor7 & | cloudbox_field, | ||
const Vector & | rtp_pos, | ||
const Vector & | rtp_los, | ||
const Index & | jacobian_do, | ||
const Index & | cloudbox_on, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | z_field, | ||
const Matrix & | z_surface, | ||
const Index & | stokes_dim, | ||
const Vector & | za_grid, | ||
const Vector & | aa_grid, | ||
const Vector & | f_grid, | ||
const Index & | za_interp_order, | ||
const Index & | za_restrict, | ||
const Index & | cos_za_interp, | ||
const Numeric & | za_extpolfac, | ||
const Index & | aa_interp_order, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: iyInterpCloudboxField.
Interpolates the intensity field of the cloud box.
Determines the intensity field at the position and direction specified by rte_pos and rte_los. The position can be both inside the cloud box or at its edge.
The interpolation in the spatial dimensions is linear.
For the zenith angle dimensions several options for controlling the interpolation are at hand. Default is linear interpolation. Higher order polynomial interpolation is activated by setting za_interp_order* to a value > 1. Default is to perform the interpolation separately for [0,90[ and ]90,180]. To handle 90 degree or use the full range ([0,180]) as basis for the interpolation, set za_restrict to 0. You can select to use cos(za) as the independent variable (instead of za) by setting cos_za_interp* to 1.
For the azimuth dimension the interpolation order can be selected, in the same manner as for zenith.
[out] | iy | WS Output |
[in] | cloudbox_field | WS Input |
[in] | rtp_pos | WS Input |
[in] | rtp_los | WS Input |
[in] | jacobian_do | WS Input |
[in] | cloudbox_on | WS Input |
[in] | cloudbox_limits | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | z_field | WS Input |
[in] | z_surface | WS Input |
[in] | stokes_dim | WS Input |
[in] | za_grid | WS Input |
[in] | aa_grid | WS Input |
[in] | f_grid | WS Input |
[in] | za_interp_order | Generic Input (Default: "1") |
[in] | za_restrict | Generic Input (Default: "1") |
[in] | cos_za_interp | Generic Input (Default: "0") |
[in] | za_extpolfac | Generic Input (Default: "0.5") |
[in] | aa_interp_order | Generic Input (Default: "1") |
Definition at line 583 of file m_cloudbox.cc.
References ARTS::Var::aa_grid(), ARTS::Var::atmosphere_dim(), ARTS::Var::cloudbox_field(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), DEBUG_ONLY, ARTS::Var::f_grid(), fractional_gp(), gridpos_upperend_check(), GridPos::idx, interp(), interpweights(), is_gridpos_at_index_i(), is_same_within_epsilon(), is_size(), ARTS::Var::iy(), ARTS::Var::jacobian_do(), joker, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), ARTS::Var::p_grid(), ARTS::Var::rte_los(), ARTS::Var::rte_pos(), rte_pos2gridpos(), ARTS::Var::stokes_dim(), ARTS::Var::z_field(), ARTS::Var::z_surface(), and ARTS::Var::za_grid().
Referenced by iyInterpCloudboxField_g().
void particle_fieldCleanup | ( | Tensor4 & | particle_field_out, |
const Tensor4 & | particle_field_in, | ||
const Numeric & | threshold, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: particle_fieldCleanup.
Removes unrealistically small or erroneous data from particle fields.
This WSM checks if the input particle field (e.g. particle_bulkprop_field*) contains values smaller than the given threshold. In this case, these values will be set to zero.
The method should be applied if the particle fields contain unrealistically small or erroneous data (NWP/GCM model data, e.g. from the Chevallierl_91l sets, often contain very small or even negative values, which are numerical artefacts rather than physical values.) For the scat_species_XXX_fields, it needs to be applied separately per Tensor4 type field collection. This allows to use different thresholds for the different types of fields (not for the different scattering species, though).
particle_fieldCleanup* shall be called after generation of the atmopheric fields.
[out] | particle_field_out | Generic output |
[in] | particle_field_in | Generic Input |
[in] | threshold | Generic Input |
Definition at line 1104 of file m_cloudbox.cc.
References ConstTensor4View::nbooks(), and ConstTensor4View::npages().
Referenced by particle_fieldCleanup_g().
void pnd_fieldCalcFrompnd_field_raw | ( | Tensor4 & | pnd_field, |
ArrayOfTensor4 & | dpnd_field_dx, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const ArrayOfGriddedField3 & | pnd_field_raw, | ||
const Index & | atmosphere_dim, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Index & | zeropadding, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: pnd_fieldCalcFrompnd_field_raw.
Interpolation of particle number density fields to calculation grid inside cloudbox.
This method interpolates the particle number density field from the raw data pnd_field_raw to obtain pnd_field. For 1D cases, where internally GriddedFieldPRegrid and GriddedFieldLatLonRegrid* are applied, zeropadding=1 sets the pnd_field* at pressure levels levels exceeding pnd_field_raw's pressure grid to 0 (not implemented for 2D and 3D yet). Default: zeropadding=0, which throws an error if the calculation pressure grid p_grid* is not completely covered by pnd_field_raw's pressure grid.
[out] | pnd_field | WS Output |
[out] | dpnd_field_dx | WS Output |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | pnd_field_raw | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | cloudbox_limits | WS Input |
[in] | jacobian_quantities | WS Input |
[in] | zeropadding | Generic Input (Default: "0") |
Definition at line 1766 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), chk_atm_grids(), chk_pnd_field_raw_only_in_cloudbox(), ARTS::Var::cloudbox_limits(), CREATE_OUT0, data, ARTS::Var::dpnd_field_dx(), FieldFromGriddedField(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, GriddedFieldPRegrid(), gridpos(), interp(), interpweights(), ARTS::Var::jacobian_quantities(), joker, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), p2gridpos(), ARTS::Var::p_grid(), ARTS::Var::pnd_field(), ARTS::Var::pnd_field_raw(), and ARTS::Var::verbosity().
Referenced by pnd_fieldCalcFrompnd_field_raw_g().
void pnd_fieldExpand1D | ( | Tensor4 & | pnd_field, |
const Index & | atmosphere_dim, | ||
const Index & | cloudbox_on, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Index & | nzero, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: pnd_fieldExpand1D.
Maps a 1D pnd_field to a (homogeneous) 2D or 3D pnd_field.
This method takes a 1D pnd_field and converts it to a 2D or 3D "cloud". It is assumed that a complete 1D case has been created, and after this atmosphere_dim, lat_grid, lon_grid and cloudbox_limits* have been changed to a 2D or 3D case (without changing the vertical extent of the cloudbox.
No modification of pnd_field is made for the pressure dimension. At the latitude and longitude cloudbox edge points pnd_field is set to zero. This corresponds to nzero=1. If you want a larger margin between the lat and lon cloudbox edges and the "cloud" you increase nzero*, where nzero is the number of grid points for which pnd_field* shall be set to 0, counted from each lat and lon edge.
See further AtmFieldsExpand1D.
[in,out] | pnd_field | WS Input/Output |
[in] | atmosphere_dim | WS Input |
[in] | cloudbox_on | WS Input |
[in] | cloudbox_limits | WS Input |
[in] | nzero | Generic Input (Default: "1") |
Definition at line 1974 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), and ARTS::Var::pnd_field().
Referenced by pnd_fieldExpand1D_g().
void pnd_fieldZero | ( | Tensor4 & | pnd_field, |
ArrayOfTensor4 & | dpnd_field_dx, | ||
ArrayOfArrayOfSingleScatteringData & | scat_data, | ||
const Index & | atmosphere_dim, | ||
const Vector & | f_grid, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: pnd_fieldZero.
Sets pnd_field to zero.
Creates an empty pnd_field of cloudbox size according to cloudbox_limits* and with number of scattering elemements according to scat_data. If scat_data is not set yet, it will be filled with one dummy scattering element.
The method works with both scat_data and scat_data_raw. This method primarily exists for testing purposes. On the one hand, empty pnd_field runs can be used to test the agreement between true clear-sky (cloudboxOff) solutions and the scattering solver solution in factual clear-sky conditions. It is important to avoid discontinuities when switching from thin-cloud to clear-sky conditions. Moreover, scattering calculations using the DOIT method include interpolation errors. If one is interested in this effect, one should compare the DOIT result with an empty cloudbox to a clearsky calculation. That means that the iterative method is performed for a cloudbox with no particles.
[out] | pnd_field | WS Output |
[out] | dpnd_field_dx | WS Output |
[in,out] | scat_data | WS Input/Output |
[in] | atmosphere_dim | WS Input |
[in] | f_grid | WS Input |
[in] | cloudbox_limits | WS Input |
[in] | jacobian_quantities | WS Input |
Definition at line 2030 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), chk_if_in_range(), ARTS::Var::cloudbox_limits(), ARTS::Var::dpnd_field_dx(), ARTS::Var::f_grid(), ARTS::Var::jacobian_quantities(), nlinspace(), ARTS::Var::pnd_field(), PTYPE_TOTAL_RND, ARTS::Var::scat_data(), TotalNumberOfElements(), and ARTS::Var::za_grid().
Referenced by DisortCalcClearsky(), and pnd_fieldZero_g().
void ScatElementsPndAndScatAdd | ( | ArrayOfArrayOfSingleScatteringData & | scat_data_raw, |
ArrayOfGriddedField3 & | pnd_field_raw, | ||
const Index & | atmosphere_dim, | ||
const ArrayOfString & | scat_data_files, | ||
const ArrayOfString & | pnd_field_files, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ScatElementsPndAndScatAdd.
Adds single scattering data and particle number density for individual scattering elements.
The methods reads the specified files and appends the obtained data to scat_data and pnd_field_raw. Scattering data is appended to the current last existing scattering species in scat_data.
[in,out] | scat_data_raw | WS Input/Output |
[in,out] | pnd_field_raw | WS Input/Output |
[in] | atmosphere_dim | WS Input |
[in] | scat_data_files | Generic Input |
[in] | pnd_field_files | Generic Input |
Definition at line 1145 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), chk_if_in_range(), chk_pnd_data(), CREATE_OUT1, CREATE_OUT2, Array< base >::nelem(), Absorption::nelem(), ARTS::Var::pnd_field_raw(), ARTS::Var::scat_data_raw(), ARTS::Var::scat_data_single(), ARTS::Var::verbosity(), and xml_read_from_file().
Referenced by ScatElementsPndAndScatAdd_g().
void ScatElementsSelect | ( | ArrayOfArrayOfSingleScatteringData & | scat_data_raw, |
ArrayOfArrayOfScatteringMetaData & | scat_meta, | ||
const ArrayOfString & | scat_species, | ||
const String & | species, | ||
const String & | sizeparam, | ||
const Numeric & | sizemin, | ||
const Numeric & | sizemax, | ||
const Numeric & | tolerance, | ||
const String & | delim, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ScatElementsSelect.
Allows to limit considered scattering elements according to size.
Scattering elements of a specified scattering species are removed from scat_data_raw and scat_meta, i.e. removed from further calculations, if their particle size exceeds the specified limits. Specification of the scattering species is done by name matching the scattering species name part of scat_species tag. As size parameter, all size parameters reported by the meta data can be used (see scat_meta_single for offered parameters and their naming).
[in,out] | scat_data_raw | WS Input/Output |
[in,out] | scat_meta | WS Input/Output |
[in] | scat_species | WS Input |
[in] | species | Generic Input |
[in] | sizeparam | Generic Input |
[in] | sizemin | Generic Input (Default: "0.") |
[in] | sizemax | Generic Input (Default: "-1.") |
[in] | tolerance | Generic Input (Default: "1e-6") |
[in] | delim | Generic Input (Default: "-") |
Definition at line 1504 of file m_cloudbox.cc.
References Array< base >::nelem(), parse_partfield_name(), ARTS::Var::scat_data_raw(), ARTS::Var::scat_meta(), ARTS::Var::scat_species(), and TotalNumberOfElements().
Referenced by ScatElementsSelect_g().
void ScatElementsToabs_speciesAdd | ( | ArrayOfArrayOfSingleScatteringData & | scat_data_raw, |
ArrayOfGriddedField3 & | vmr_field_raw, | ||
ArrayOfArrayOfSpeciesTag & | abs_species, | ||
Index & | propmat_clearsky_agenda_checked, | ||
Index & | abs_xsec_agenda_checked, | ||
const Index & | atmosphere_dim, | ||
const Vector & | f_grid, | ||
const ArrayOfString & | scat_data_files, | ||
const ArrayOfString & | pnd_field_files, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ScatElementsToabs_speciesAdd.
Appends scattering elements to abs_species including reading single scattering data and corresponding pnd field.
The methods reads the specified single scattering and pnd_field data of individual scattering elements and appends the obtained data to scat_data (appending to its last scattering species) and vmr_field_raw*. Per scattering element, it also appends one instance of species 'particles' to abs_species.
[in,out] | scat_data_raw | WS Input/Output |
[in,out] | vmr_field_raw | WS Input/Output |
[in,out] | abs_species | WS Input/Output |
[in,out] | propmat_clearsky_agenda_checked | WS Input/Output |
[in,out] | abs_xsec_agenda_checked | WS Input/Output |
[in] | atmosphere_dim | WS Input |
[in] | f_grid | WS Input |
[in] | scat_data_files | Generic Input |
[in] | pnd_field_files | Generic Input |
Definition at line 1256 of file m_cloudbox.cc.
References ARTS::Var::abs_species(), abs_speciesAdd(), ARTS::Var::abs_xsec_agenda_checked(), ARTS::Var::atmosphere_dim(), chk_if_in_range(), chk_if_increasing(), chk_interpolation_grids(), chk_pnd_data(), CREATE_OUT1, CREATE_OUT2, ARTS::Var::f_grid(), Array< base >::nelem(), Absorption::nelem(), ARTS::Var::propmat_clearsky_agenda_checked(), ARTS::Var::scat_data_raw(), ARTS::Var::scat_data_single(), scat_dataCheck(), ARTS::Var::verbosity(), ARTS::Var::vmr_field_raw(), and xml_read_from_file().
Referenced by ScatElementsToabs_speciesAdd_g().
void ScatSpeciesExtendTemperature | ( | ArrayOfArrayOfSingleScatteringData & | scat_data_raw, |
const ArrayOfString & | scat_species, | ||
const String & | species, | ||
const String & | scat_species_delim, | ||
const Numeric & | T_low, | ||
const Numeric & | T_high, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ScatSpeciesExtendTemperature.
Extends valid temperature range of single scattering data.
The method allows to extend the temperature range of given single scattering data by duplicating optical property data at the low and/or high limits of the associated temperature grid. T_low and T_high* specify the temperature grid points that are added. Extension is only performed if T_low is lower and T_high is higher than the original lowest and highest temperatures, respectively, and if the original data contains more than one temperature grid point (i.e., when not assumed constant anyways).
The method is thought, e.g., for atmospheric ice falling into atmospheric layers with temperatures above the melting point of ice, where ambient and particle temperature deviate (as long as frozen the ice temperature remains at the melting point temperature). It is not internally checked, whether the original data includes the melting point. The method can be used in a wider sense. However, it remains in the responsibility of the user to apply the method in a meaningful sense and on meaningful single scattering data.
The temperature extension is applied on all scattering elements of a scattering species. If scat_species is defined, species can be used to select the species on which the extension shall be applied comparing species with the scattering species name part of scat_species. If no species is specified, the method is applied on the current last existing scattering species in scat_data*. Through the latter the method can be applied for cases when scat_species is not defined (e.g. when pnd_field data is created externally instead of from hydrometeor fields
[in,out] | scat_data_raw | WS Input/Output |
[in] | scat_species | WS Input |
[in] | species | Generic Input (Default: "") |
[in] | scat_species_delim | Generic Input (Default: "-") |
[in] | T_low | Generic Input (Default: "-1.") |
[in] | T_high | Generic Input (Default: "-1.") |
Definition at line 1614 of file m_cloudbox.cc.
References SingleScatteringData::aa_grid, SingleScatteringData::abs_vec_data, SingleScatteringData::description, SingleScatteringData::ext_mat_data, SingleScatteringData::f_grid, joker, last(), ConstTensor7View::nbooks(), ConstTensor5View::ncols(), ConstTensor7View::ncols(), ConstVectorView::nelem(), ConstTensor7View::npages(), ConstTensor7View::nrows(), ConstTensor7View::nshelves(), parse_partfield_name(), SingleScatteringData::pha_mat_data, SingleScatteringData::ptype, Tensor7::resize(), Tensor5::resize(), ARTS::Var::scat_data_raw(), ARTS::Var::scat_species(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by ScatSpeciesExtendTemperature_g().
void ScatSpeciesInit | ( | ArrayOfString & | scat_species, |
ArrayOfArrayOfSingleScatteringData & | scat_data_raw, | ||
ArrayOfArrayOfScatteringMetaData & | scat_meta, | ||
Index & | scat_data_checked, | ||
ArrayOfGriddedField3 & | pnd_field_raw, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ScatSpeciesInit.
Initializes the scattering species related data variables.
This method initializes the scat_species WSV, the variables that will hold the raw optical properties and the raw particle number distributions of the scattering elements (scat_data_raw and pnd_field_raw*, respectively) as well as the one holding the meta information about the scattering elements (scat_meta).
This method has to be executed before WSM reading/adding to the said variable, e.g. before ScatSpeciesPndAndScatAdd.
[out] | scat_species | WS Output |
[out] | scat_data_raw | WS Output |
[out] | scat_meta | WS Output |
[out] | scat_data_checked | WS Output |
[out] | pnd_field_raw | WS Output |
Definition at line 1130 of file m_cloudbox.cc.
References ARTS::Var::pnd_field_raw(), ARTS::Var::scat_data_checked(), ARTS::Var::scat_data_raw(), ARTS::Var::scat_meta(), and ARTS::Var::scat_species().
Referenced by ScatSpeciesInit_g().
void ScatSpeciesPndAndScatAdd | ( | ArrayOfArrayOfSingleScatteringData & | scat_data_raw, |
ArrayOfGriddedField3 & | pnd_field_raw, | ||
const Index & | atmosphere_dim, | ||
const ArrayOfString & | scat_data_files, | ||
const String & | pnd_fieldarray_file, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ScatSpeciesPndAndScatAdd.
Adds single scattering data and particle number densities for one scattering species.
The WSV pnd_field_raw containing particle number densities for all scattering species can be generated outside ARTS, for example by using PyARTS or atmlab. This method reads this data as well as its corresponding single scattering data, which is added as a new scattering species to scat_data. This method needs as input an ArrayOfString holding the filenames of the single scattering data for each scattering element and a file containing the corresponding pnd_field_raw. In contrast to the scattering data, the pnd-fields are stored in a single XML-file containing an ArrayofGriddedField3, i.e. holding the pnd-field data of all scattering elements.
Important note: The order of the filenames for the scattering data files has to correspond to the order of the pnd-fields, stored in the variable pnd_field_raw*.
[in,out] | scat_data_raw | WS Input/Output |
[in,out] | pnd_field_raw | WS Input/Output |
[in] | atmosphere_dim | WS Input |
[in] | scat_data_files | Generic Input |
[in] | pnd_fieldarray_file | Generic Input |
Definition at line 1211 of file m_cloudbox.cc.
References ARTS::Var::atmosphere_dim(), chk_if_in_range(), chk_pnd_raw_data(), CREATE_OUT2, Array< base >::nelem(), ARTS::Var::pnd_field_raw(), ARTS::Var::scat_data_raw(), ARTS::Var::verbosity(), and xml_read_from_file().
Referenced by ScatSpeciesPndAndScatAdd_g().
void ScatSpeciesScatAndMetaRead | ( | ArrayOfArrayOfSingleScatteringData & | scat_data_raw, |
ArrayOfArrayOfScatteringMetaData & | scat_meta, | ||
const ArrayOfString & | scat_data_files, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: ScatSpeciesScatAndMetaRead.
Reads single scattering data and scattering meta data for one scattering species.
This method takes a string array as input containing the location (path and filename) of the single scattering data. Location of corresponding scattering meta data is derived applying a naming convention: ending '.xml*' is replaced by '.meta.xml' (search for zipped files is done automatically).
All scattering elements read in one call of the method are assigned to one and the same scattering species. That is, reading in data for a bunch of scattering species can be realized by multiple call of this method. Assignment to scattering species is in the order of the calls (i.e., first method call reads data for first scat_species entry, second call for second scat_species entry and so on). Note that no two scattering elements of the same scattering species are allowed to be equal in size*
Important note: The order of the filenames for the single scattering data files has to exactly correspond to the order of the scattering meta data files.
[in,out] | scat_data_raw | WS Input/Output |
[in,out] | scat_meta | WS Input/Output |
[in] | scat_data_files | Generic Input |
Definition at line 1367 of file m_cloudbox.cc.
References CREATE_OUT2, CREATE_OUT3, file_exists(), find_xml_file(), Array< base >::nelem(), my_basic_string< charT >::split(), ARTS::Var::verbosity(), and xml_read_from_file().
Referenced by ScatSpeciesScatAndMetaRead_g().
|
extern |
Referenced by cloudboxSetFullAtm().
|
extern |
|
extern |
Referenced by pnd_fieldCalcFrompnd_field_raw().
|
extern |
Referenced by pnd_fieldCalcFrompnd_field_raw().
|
extern |
Referenced by pnd_fieldCalcFrompnd_field_raw().
|
extern |
Referenced by cloudboxSetFullAtm().
|
extern |
|
extern |