ARTS 2.5.9 (git: 825fa5f2)
m_checked.cc File Reference

Workspace functions setting the checked WSVs. More...

#include "arts.h"
#include "arts_conversions.h"
#include "auto_md.h"
#include "check_input.h"
#include "cloudbox.h"
#include "matpackI.h"
#include "wigner_functions.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 &)
 
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 Index &abs_f_interp_order, const Index &negative_vmr_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 Numeric &max500hpa_gradient, 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 &demand_latlon_margin, 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 SpeciesIsotopologueRatios &isotopologue_ratios, 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

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
 

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  
)

◆ 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 Index abs_f_interp_order,
const Index negative_vmr_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.

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]abs_f_interp_orderWS Input
[in]negative_vmr_okGeneric Input (Default: "0")

Definition at line 97 of file m_checked.cc.

References ARTS_USER_ERROR_IF, chk_atm_field(), chk_atm_grids(), chk_atm_vecfield_lat90(), chk_if_in_range(), min(), Array< base >::nelem(), and ConstTensor3View::npages().

Referenced by 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 Numeric max500hpa_gradient,
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. <br> 4. A rough search of maximum gradient of the altitude of the pressure <br> level closest to 500 hPa is made. If this value exceeds the GIN <br> max500hpa_gradient an error is issued. Please note that the unit <br> of this GIN is m per 100km. For normal conditions on Earth, large <br> scale gradients of the 500 hPa level is in the order of 20m/100km.

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
[in]max500hpa_gradientGeneric Input (Default: "500")

Definition at line 262 of file m_checked.cc.

References abs(), ARTS_USER_ERROR_IF, 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 var_string().

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 demand_latlon_margin,
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.

Default is to demand that there is a margin between the cloudbox and the ends of latitide and longitude grids. Such margins are required by MC and DOIT/3D, but are not needed for e.g. IBA. If the margins not are a demand, set GIN demand_latlon_margin to 0.

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]demand_latlon_marginGeneric Input (Default: "1")
[in]negative_pnd_okGeneric Input (Default: "0")

Definition at line 387 of file m_checked.cc.

References a, abs(), ARTS_USER_ERROR_IF, chk_atm_field(), chk_if_bool(), DEG2RAD, ConstMatrixView::empty(), ConstTensor3View::empty(), joker, max(), min(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), Vector::resize(), and TotalNumberOfElements().

Referenced by cloudbox_checkedCalc_g().

◆ lbl_checkedCalc()

void lbl_checkedCalc ( Index lbl_checked,
const ArrayOfArrayOfAbsorptionLines abs_lines_per_species,
const ArrayOfArrayOfSpeciesTag abs_species,
const SpeciesIsotopologueRatios isotopologue_ratios,
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

Definition at line 754 of file m_checked.cc.

References ARTS_USER_ERROR, ARTS_USER_ERROR_IF, checkIsotopologueRatios(), checkPartitionFunctions(), is_wigner3_ready(), Array< base >::nelem(), and Absorption::relaxationtype_relmat().

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 872 of file m_checked.cc.

References ARTS_ASSERT, ARTS_USER_ERROR_IF, and Agenda::has_method().

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 636 of file m_checked.cc.

References abs(), ARTS_USER_ERROR_IF, chk_if_increasing(), ConstVectorView::empty(), is_same_within_epsilon(), Array< base >::nelem(), ConstVectorView::nelem(), scat_dataCheck(), and my_basic_string< charT >::toupper().

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 983 of file m_checked.cc.

References ARTS_USER_ERROR_IF, ConstMatrixView::empty(), is_increasing(), joker, max(), min(), Sparse::ncols(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), Sparse::nrows(), and ConstMatrixView::nrows().

Referenced by sensor_checkedCalc_g().

Variable Documentation

◆ DEG2RAD

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
inlineconstexpr

Definition at line 43 of file m_checked.cc.

Referenced by cloudbox_checkedCalc().