ARTS  2.3.1285(git:92a29ea9-dirty)
m_checked.cc File Reference

Workspace functions setting the checked WSVs. More...

#include "arts.h"
#include "auto_md.h"
#include "cloudbox.h"
#include "matpackI.h"

Go to the source code of this file.

Functions

void abs_xsec_agenda_checkedCalc (Workspace &ws, Index &abs_xsec_agenda_checked, const ArrayOfArrayOfSpeciesTag &abs_species, const Agenda &abs_xsec_agenda, const Verbosity &)
 WORKSPACE METHOD: abs_xsec_agenda_checkedCalc. More...
 
void atmfields_checkedCalc (Index &atmfields_checked, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &t_field, const Tensor4 &vmr_field, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const SpeciesAuxData &partition_functions, const Index &abs_f_interp_order, const Index &negative_vmr_ok, const Index &bad_partition_functions_ok, const Verbosity &)
 WORKSPACE METHOD: atmfields_checkedCalc. More...
 
void atmgeom_checkedCalc (Index &atmgeom_checked, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Matrix &z_surface, const Vector &lat_true, const Vector &lon_true, const Verbosity &)
 WORKSPACE METHOD: atmgeom_checkedCalc. More...
 
void cloudbox_checkedCalc (Index &cloudbox_checked, const Index &atmfields_checked, 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 Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfSingleScatteringData &scat_data, const ArrayOfString &scat_species, const Matrix &particle_masses, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &negative_pnd_ok, const Verbosity &)
 WORKSPACE METHOD: cloudbox_checkedCalc. More...
 
void scat_data_checkedCalc (Index &scat_data_checked, const ArrayOfArrayOfSingleScatteringData &scat_data, const Vector &f_grid, const Numeric &dfrel_threshold, const String &check_level, const Numeric &sca_mat_threshold, const Verbosity &verbosity)
 WORKSPACE METHOD: scat_data_checkedCalc. More...
 
void lbl_checkedCalc (Index &lbl_checked, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const SpeciesAuxData &isotopologue_ratios, const SpeciesAuxData &partition_functions, const Verbosity &)
 WORKSPACE METHOD: lbl_checkedCalc. More...
 
void propmat_clearsky_agenda_checkedCalc (Workspace &ws, Index &propmat_clearsky_agenda_checked, const ArrayOfArrayOfSpeciesTag &abs_species, const Agenda &propmat_clearsky_agenda, const Verbosity &)
 WORKSPACE METHOD: propmat_clearsky_agenda_checkedCalc. More...
 
void sensor_checkedCalc (Index &sensor_checked, const Index &atmosphere_dim, const Index &stokes_dim, const Vector &f_grid, const Matrix &sensor_pos, const Matrix &sensor_los, const Matrix &transmitter_pos, const Matrix &mblock_dlos_grid, const Sparse &sensor_response, const Vector &sensor_response_f, const ArrayOfIndex &sensor_response_pol, const Matrix &sensor_response_dlos, const Verbosity &)
 WORKSPACE METHOD: sensor_checkedCalc. More...
 

Variables

const Numeric DEG2RAD
 
const Numeric LAT_LON_MIN
 

Detailed Description

Workspace functions setting the checked WSVs.

Author
Patrick Eriksson patri.nosp@m.ck.e.nosp@m.rikss.nosp@m.on@c.nosp@m.halme.nosp@m.rs.s.nosp@m.e
Date
2013-08-20

These functions are listed in the doxygen documentation as entries of the file auto_md.h.

Definition in file m_checked.cc.

Function Documentation

◆ abs_xsec_agenda_checkedCalc()

void abs_xsec_agenda_checkedCalc ( Workspace ws,
Index abs_xsec_agenda_checked,
const ArrayOfArrayOfSpeciesTag abs_species,
const Agenda abs_xsec_agenda,
const Verbosity verbosity 
)

WORKSPACE METHOD: abs_xsec_agenda_checkedCalc.

Checks if the abs_xsec_agenda contains all necessary methods to calculate all the species in abs_species.

This method should be called just before the abs_xsec_agenda is used, e.g. abs_lookupCalc, ybatchCalc, yCalc

Author
Oliver Lemke
Parameters
[in,out]wsWorkspace
[out]abs_xsec_agenda_checkedWS Output
[in]abs_speciesWS Input
[in]abs_xsec_agendaWS Input

Definition at line 44 of file m_checked.cc.

References find_first_species_tg(), Agenda::has_method(), Array< base >::nelem(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), SpeciesTag::TYPE_CIA, SpeciesTag::TYPE_FREE_ELECTRONS, SpeciesTag::TYPE_HITRAN_XSEC, SpeciesTag::TYPE_PARTICLES, SpeciesTag::TYPE_PLAIN, SpeciesTag::TYPE_PREDEF, and SpeciesTag::TYPE_ZEEMAN.

Referenced by abs_xsec_agenda_checkedCalc_g().

◆ atmfields_checkedCalc()

void atmfields_checkedCalc ( Index atmfields_checked,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const ArrayOfArrayOfSpeciesTag abs_species,
const Tensor3 t_field,
const Tensor4 vmr_field,
const Tensor3 wind_u_field,
const Tensor3 wind_v_field,
const Tensor3 wind_w_field,
const Tensor3 mag_u_field,
const Tensor3 mag_v_field,
const Tensor3 mag_w_field,
const SpeciesAuxData partition_functions,
const Index abs_f_interp_order,
const Index negative_vmr_ok,
const Index bad_partition_functions_ok,
const Verbosity verbosity 
)

WORKSPACE METHOD: atmfields_checkedCalc.

Checks consistency of (clear sky) atmospheric fields.

The following WSVs are treated: p_grid, lat_grid, lon_grid, t_field*, vmr_field, wind_u/v/w_field and mag_u/v/w_field.

If any of the variables above is changed, then this method shall be called again (no automatic check that this is fulfilled!).

The tests include that: <br> 1. Atmospheric grids (p/lat/lon_grid) are OK with respect to <br> atmosphere_dim (and vmr_field also regarding abs_species). <br> 2. Atmospheric fields have sizes consistent with the atmospheric <br> grids. <br> 3. abs_f_interp_order is not zero if any wind is nonzero. <br> 4. All values in t_field are > 0.

Default is that values in vmr_field are demanded to be >= 0 (ie. zero allowed, in contrast to t_field), but this requirement can be removed by the negative_vmr_ok argument.

If any test fails, there is an error. Otherwise, atmfields_checked* is set to 1.

The cloudbox is covered by cloudbox_checked, z_field is part of the checks done around atmgeom_checked.

If you choose to use bad_partition_functions_ok please note that this is done on your own risk and that it could introduce hard-to- track errors into your calculations. Do not use this for anything important.

Author
Patrick Eriksson
Parameters
[out]atmfields_checkedWS Output
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]abs_speciesWS Input
[in]t_fieldWS Input
[in]vmr_fieldWS Input
[in]wind_u_fieldWS Input
[in]wind_v_fieldWS Input
[in]wind_w_fieldWS Input
[in]mag_u_fieldWS Input
[in]mag_v_fieldWS Input
[in]mag_w_fieldWS Input
[in]partition_functionsWS Input
[in]abs_f_interp_orderWS Input
[in]negative_vmr_okGeneric Input (Default: "0")
[in]bad_partition_functions_okGeneric Input (Default: "0")

Definition at line 125 of file m_checked.cc.

References SpeciesAuxData::AT_PARTITIONFUNCTION_COEFF, SpeciesAuxData::AT_PARTITIONFUNCTION_COEFF_VIBROT, SpeciesAuxData::AT_PARTITIONFUNCTION_TFIELD, chk_atm_field(), chk_atm_grids(), chk_atm_vecfield_lat90(), chk_if_in_range(), data, SpeciesAuxData::getParam(), SpeciesAuxData::getParamType(), min, ConstTensor3View::ncols(), Array< base >::nelem(), SpeciesAuxData::nisotopologues(), ConstTensor3View::npages(), ConstTensor3View::nrows(), SpeciesAuxData::nspecies(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by abs_lookupSetupBatch(), and atmfields_checkedCalc_g().

◆ atmgeom_checkedCalc()

void atmgeom_checkedCalc ( Index atmgeom_checked,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Tensor3 z_field,
const Vector refellipsoid,
const Matrix z_surface,
const Vector lat_true,
const Vector lon_true,
const Verbosity verbosity 
)

WORKSPACE METHOD: atmgeom_checkedCalc.

Checks consistency of geometric considerations of the atmosphere.

The following WSVs are checked: z_field, refellipsoid, z_surface, lat_true* and lon_true. If any of the variables above is changed, then this method shall be called again (no automatic check that this is fulfilled!).

The tests include that: <br> 1. refellipsoid has correct size, and that eccentricity is <br> set to zero if 1D atmosphere. <br> 2. z_field and z_surface have sizes consistent with the <br> atmospheric grids. <br> 3. There is no gap between z_surface and z_field.

lat_true* and lon_true are allowed to be empty.

If any test fails, there is an error. Otherwise, atmgeom_checked is set to 1.

See further atmgeom_checkedCalc.

Author
Patrick Eriksson
Parameters
[out]atmgeom_checkedWS Output
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]refellipsoidWS Input
[in]z_surfaceWS Input
[in]lat_trueWS Input
[in]lon_trueWS Input

Definition at line 383 of file m_checked.cc.

References chk_atm_field(), chk_atm_grids(), chk_atm_surface(), chk_if_in_range(), chk_if_increasing(), joker, max, min, ConstTensor3View::ncols(), ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), ConstTensor3View::nrows(), ConstMatrixView::nrows(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by atmgeom_checkedCalc_g().

◆ cloudbox_checkedCalc()

void cloudbox_checkedCalc ( Index cloudbox_checked,
const Index atmfields_checked,
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 Tensor3 wind_u_field,
const Tensor3 wind_v_field,
const Tensor3 wind_w_field,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Tensor4 pnd_field,
const ArrayOfTensor4 dpnd_field_dx,
const ArrayOfRetrievalQuantity jacobian_quantities,
const ArrayOfArrayOfSingleScatteringData scat_data,
const ArrayOfString scat_species,
const Matrix particle_masses,
const ArrayOfArrayOfSpeciesTag abs_species,
const Index negative_pnd_ok,
const Verbosity verbosity 
)

WORKSPACE METHOD: cloudbox_checkedCalc.

Checks consistency and validity of the cloudbox governing variables.

The following WSVs are treated: cloudbox_on, cloudbox_limits, pnd_field*, scat_data, scat_species, abs_species, particle_masses particle_bulkprop_field*, particle_bulkprop_names and wind_u/v/w_field.

If any of these variables is changed, then this method shall be called again (no automatic check that this is fulfilled!).

The main checks are if the cloudbox limits are OK with respect to the atmospheric dimensionality and the limits of the atmosphere, and that the scattering element variables pnd_field and scat_data* match in size.

Further checks on scat_data are performed in scat_data_checkedCalc

scat_species* and particle_masses must either be empty or have a size that matches the other data. If non-empty, some check of these variables are performed.

If any test fails, there is an error. Otherwise, cloudbox_checked is set to 1.

Author
Patrick Eriksson, Jana Mendrok
Parameters
[out]cloudbox_checkedWS Output
[in]atmfields_checkedWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]z_surfaceWS Input
[in]wind_u_fieldWS Input
[in]wind_v_fieldWS Input
[in]wind_w_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]pnd_fieldWS Input
[in]dpnd_field_dxWS Input
[in]jacobian_quantitiesWS Input
[in]scat_dataWS Input
[in]scat_speciesWS Input
[in]particle_massesWS Input
[in]abs_speciesWS Input
[in]negative_pnd_okGeneric Input (Default: "0")

Definition at line 484 of file m_checked.cc.

References abs, chk_atm_field(), chk_if_bool(), DEG2RAD, ConstTensor3View::empty(), ConstMatrixView::empty(), joker, LAT_LON_MIN, max, min, Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), Vector::resize(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), TotalNumberOfElements(), and SpeciesTag::TYPE_PARTICLES.

Referenced by cloudbox_checkedCalc_g().

◆ lbl_checkedCalc()

void lbl_checkedCalc ( Index lbl_checked,
const ArrayOfArrayOfAbsorptionLines abs_lines_per_species,
const ArrayOfArrayOfSpeciesTag abs_species,
const SpeciesAuxData isotopologue_ratios,
const SpeciesAuxData partition_functions,
const Verbosity verbosity 
)

WORKSPACE METHOD: lbl_checkedCalc.

Checks that the line-by-line parameters are OK.

On failure, will throw. On success, lbl_checked evals as true

Note that checks may become more stringent as ARTS evolves, especially for "new" options. This test might succeed in one version of ARTS but fail in later versions

Author
Richard Larsson
Parameters
[out]lbl_checkedWS Output
[in]abs_lines_per_speciesWS Input
[in]abs_speciesWS Input
[in]isotopologue_ratiosWS Input
[in]partition_functionsWS Input

Definition at line 895 of file m_checked.cc.

References checkIsotopologueRatios(), checkPartitionFunctions(), i, Array< base >::nelem(), and SpeciesTag::TYPE_ZEEMAN.

Referenced by lbl_checkedCalc_g().

◆ propmat_clearsky_agenda_checkedCalc()

void propmat_clearsky_agenda_checkedCalc ( Workspace ws,
Index propmat_clearsky_agenda_checked,
const ArrayOfArrayOfSpeciesTag abs_species,
const Agenda propmat_clearsky_agenda,
const Verbosity verbosity 
)

WORKSPACE METHOD: propmat_clearsky_agenda_checkedCalc.

Checks if the propmat_clearsky_agenda contains all necessary methods to calculate all the species in abs_species.

This method should be called just before the propmat_clearsky_agenda is used, e.g. DoitGetIncoming, ybatchCalc, yCalc

Author
Oliver Lemke
Parameters
[in,out]wsWorkspace
[out]propmat_clearsky_agenda_checkedWS Output
[in]abs_speciesWS Input
[in]propmat_clearsky_agendaWS Input

Definition at line 976 of file m_checked.cc.

References Agenda::has_method(), Array< base >::nelem(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), SpeciesTag::TYPE_CIA, SpeciesTag::TYPE_FREE_ELECTRONS, SpeciesTag::TYPE_HITRAN_XSEC, SpeciesTag::TYPE_PARTICLES, SpeciesTag::TYPE_PLAIN, SpeciesTag::TYPE_PREDEF, and SpeciesTag::TYPE_ZEEMAN.

Referenced by propmat_clearsky_agenda_checkedCalc_g().

◆ scat_data_checkedCalc()

void scat_data_checkedCalc ( Index scat_data_checked,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Vector f_grid,
const Numeric dfrel_threshold,
const String check_level,
const Numeric sca_mat_threshold,
const Verbosity verbosity 
)

WORKSPACE METHOD: scat_data_checkedCalc.

Checks dimensions, grids and single scattering properties of all scattering elements in scat_data.

Dimension and grid equirements:

  • The scattering element's f_grid is either identical to f_grid or <br> of dimension 1.
  • In the latter case, the scattering element's f_grid value must <br> not deviate from any of the f_grid values by more than a <br> fraction of dfrel_threshold.
  • The frequency dimension of pha_mat_data, ext_mat_data, and <br> abs_vec_data is either equal to the scattering element's f_grid <br> or 1.
  • The temperature dimension of pha_mat_data, ext_mat_data, and <br> abs_vec_data is either equal to the scattering element's T_grid <br> or 1.
  • The temperature dimension of ext_mat_data, and abs_vec_data is <br> identical.

The single scattering property contents are checked using scat_dataCheck*. For details, see there. The depth of these checks and their rigour can adapted (see description of parameters check_level* and sca_mat_threshold in scat_dataCheck) or can be skipped entirely (setting check_level to 'none'). NOTE: These test shall only be skipped when one is confident that the data is correct, e.g. by having run scat_dataCheck on the set of data before, e.g. in a separate ARTS run.

Author
Jana Mendrok
Parameters
[out]scat_data_checkedWS Output
[in]scat_dataWS Input
[in]f_gridWS Input
[in]dfrel_thresholdGeneric Input (Default: "0.1")
[in]check_levelGeneric Input (Default: "all")
[in]sca_mat_thresholdGeneric Input (Default: "5e-2")

Definition at line 741 of file m_checked.cc.

References chk_if_increasing(), ConstVectorView::empty(), is_same_within_epsilon(), Array< base >::nelem(), ConstVectorView::nelem(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by scat_data_checkedCalc_g().

◆ sensor_checkedCalc()

void sensor_checkedCalc ( Index sensor_checked,
const Index atmosphere_dim,
const Index stokes_dim,
const Vector f_grid,
const Matrix sensor_pos,
const Matrix sensor_los,
const Matrix transmitter_pos,
const Matrix mblock_dlos_grid,
const Sparse sensor_response,
const Vector sensor_response_f,
const ArrayOfIndex sensor_response_pol,
const Matrix sensor_response_dlos,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_checkedCalc.

Checks consistency of the sensor variables.

The following WSVs are examined: f_grid, sensor_pos, sensor_los, transmitter_pos*, mblock_dlos_grid, antenna_dim, sensor_response*, sensor_response_f, sensor_response_pol, and sensor_response_dlos.

If any of these variables are changed, then this method shall be called again (no automatic check that this is fulfilled!).

The main tests are that dimensions of sensor variables agree with other settings, e.g., the size of f_grid, atmosphere_dim, stokes_dim, etc.

If any test fails, there is an error. Otherwise, sensor_checked is set to 1.

Author
Jana Mendrok
Parameters
[out]sensor_checkedWS Output
[in]atmosphere_dimWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]sensor_posWS Input
[in]sensor_losWS Input
[in]transmitter_posWS Input
[in]mblock_dlos_gridWS Input
[in]sensor_responseWS Input
[in]sensor_response_fWS Input
[in]sensor_response_polWS Input
[in]sensor_response_dlosWS Input

Definition at line 1059 of file m_checked.cc.

References ConstMatrixView::empty(), is_increasing(), joker, max, min, Sparse::ncols(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Sparse::nrows(), ConstMatrixView::nrows(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by sensor_checkedCalc_g().

Variable Documentation

◆ DEG2RAD

const Numeric DEG2RAD

Referenced by cloudbox_checkedCalc().

◆ LAT_LON_MIN

const Numeric LAT_LON_MIN

Referenced by cloudbox_checkedCalc().