ARTS  2.2.66
check_input.h File Reference
#include "agenda_class.h"
#include "exceptions.h"
#include "matpackVII.h"
#include "mystring.h"
#include "gridded_fields.h"

Go to the source code of this file.

Classes

class  runtime_error_not_found
 Subclasses of runtime_error. More...
 
class  runtime_error_not_unique
 Subclasses of runtime_error. More...
 

Functions

void chk_if_bool (const String &x_name, const Index &x)
 chk_if_bool More...
 
void chk_if_in_range (const String &x_name, const Index &x, const Index &x_low, const Index &x_high)
 chk_if_in_range More...
 
void chk_if_increasing (const String &x_name, const ArrayOfIndex &x)
 chk_if_increasing More...
 
void chk_not_negative (const String &x_name, const Numeric &x)
 chk_not_negative More...
 
void chk_if_in_range (const String &x_name, const Numeric &x, const Numeric &x_low, const Numeric &x_high)
 chk_if_in_range More...
 
void chk_vector_length (const String &x_name, ConstVectorView x, const Index &l)
 chk_vector_length More...
 
void chk_vector_length (const String &x1_name, const String &x2_name, ConstVectorView x1, ConstVectorView x2)
 chk_vector_length More...
 
void chk_if_increasing (const String &x_name, ConstVectorView x)
 chk_if_increasing More...
 
void chk_if_decreasing (const String &x_name, ConstVectorView x)
 chk_if_decreasing More...
 
void chk_if_equal (const String &x1_name, const String &x2_name, ConstVectorView v1, ConstVectorView v2, Numeric margin=1e-6)
 chk_if_equal More...
 
void chk_matrix_ncols (const String &x_name, ConstMatrixView x, const Index &l)
 chk_matrix_ncols More...
 
void chk_matrix_nrows (const String &x_name, ConstMatrixView x, const Index &l)
 chk_matrix_nrows More...
 
template<class T >
Index chk_contains (const String &x_name, const Array< T > &x, const T &what)
 Check if an array contains a value. More...
 
template<class T >
void chk_size (const String &x_name, const Array< T > &x, const Index &c)
 Check the size of an array. More...
 
void chk_size (const String &x_name, ConstVectorView x, const Index &c)
 Runtime check for size of Vector. More...
 
void chk_size (const String &x_name, ConstMatrixView x, const Index &r, const Index &c)
 Runtime check for size of Matrix. More...
 
void chk_size (const String &x_name, ConstTensor3View x, const Index &p, const Index &r, const Index &c)
 Runtime check for size of Tensor. More...
 
void chk_size (const String &x_name, ConstTensor4View x, const Index &b, const Index &p, const Index &r, const Index &c)
 Runtime check for size of Tensor. More...
 
void chk_size (const String &x_name, ConstTensor5View x, const Index &s, const Index &b, const Index &p, const Index &r, const Index &c)
 Runtime check for size of Tensor. More...
 
void chk_size (const String &x_name, ConstTensor6View x, const Index &v, const Index &s, const Index &b, const Index &p, const Index &r, const Index &c)
 Runtime check for size of Tensor. More...
 
void chk_size (const String &x_name, ConstTensor7View x, const Index &l, const Index &v, const Index &s, const Index &b, const Index &p, const Index &r, const Index &c)
 Runtime check for size of Tensor. More...
 
void chk_not_empty (const String &x_name, const Agenda &x)
 chk_not_empty More...
 
void chk_interpolation_grids_loose (Index &ing_min, Index &ing_max, const String &which_interpolation, ConstVectorView old_grid, ConstVectorView new_grid, ConstVectorView data, const Index order=1)
 Check interpolation grids. More...
 
void chk_interpolation_grids_loose_no_data_check (Index &ing_min, Index &ing_max, const String &which_interpolation, ConstVectorView old_grid, ConstVectorView new_grid, const Index order=1)
 Check interpolation grids. More...
 
void chk_interpolation_pgrids_loose_no_data_check (Index &ing_min, Index &ing_max, const String &which_interpolation, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Index order=1)
 Check log pressure interpolation grids. More...
 
void chk_interpolation_grids_loose_check_data (Index &ing_min, Index &ing_max, const String &which_interpolation, ConstVectorView old_grid, ConstVectorView new_grid, ConstVectorView data)
 Check interpolation grids. More...
 
void chk_interpolation_grids (const String &which_interpolation, ConstVectorView old_grid, ConstVectorView new_grid, const Index order=1, const Numeric &extpolfac=0.5, const bool islog=false)
 Check interpolation grids. More...
 
void chk_interpolation_grids (const String &which_interpolation, ConstVectorView old_grid, const Numeric &new_grid, const Index order=1, const Numeric &extpolfac=0.5)
 Check interpolation grids. More...
 
void chk_interpolation_pgrids (const String &which_interpolation, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Index order=1, const Numeric &extpolfac=0.5)
 Check log pressure interpolation grids. More...
 
void chk_atm_grids (const Index &dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid)
 chk_atm_grids More...
 
void chk_atm_field (const String &x_name, ConstTensor3View x, const Index &dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, const bool &chk_lat90=1)
 chk_atm_field (simple fields) More...
 
void chk_atm_field (const String &x_name, ConstTensor4View x, const Index &dim, const Index &nspecies, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid)
 chk_atm_field (fields with one more dimension) More...
 
void chk_atm_vecfield_lat90 (const String &x1_name, ConstTensor3View x1, const String &x2_name, ConstTensor3View x2, const Index &dim, ConstVectorView lat_grid, const Numeric &threshold=1e-3)
 chk_atm_vecfield_lat90 More...
 
void chk_latlon_true (const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lat_true, ConstVectorView lon_true)
 chk_latlon_true More...
 
void chk_atm_surface (const String &x_name, const Matrix &x, const Index &dim, ConstVectorView lat_grid, ConstVectorView lon_grid)
 chk_atm_surface More...
 
void chk_rte_pos (const Index &atmosphere_dim, ConstVectorView rte_pos, const bool &is_rte_pos2=false)
 chk_rte_pos More...
 
void chk_rte_los (const Index &atmosphere_dim, ConstVectorView rte_los)
 chk_rte_los More...
 
void chk_griddedfield_gridname (const GriddedField &gf, const Index gridindex, const String &gridname)
 Check name of grid in GriddedField. More...
 
bool chk_if_std_blackbody_agenda (Workspace &ws, const Agenda &blackbody_radiation_agenda)
 Checks if blackbody_radiation_agenda returns frequency based radiance. More...
 

Detailed Description

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
2002-04-15

This file contains the declaration of functions in check_input.cc.

Definition in file check_input.h.

Function Documentation

◆ chk_atm_field() [1/2]

void chk_atm_field ( const String x_name,
ConstTensor3View  x,
const Index dim,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid,
const bool &  chk_lat90 
)

chk_atm_field (simple fields)

Checks if an atmospheric field matches the dimensionality and the grids.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the atmospheric field.
xA variable holding an atmospheric field.
dimThe atmospheric dimensionality.
p_gridThe pressure grid.
lat_gridThe latitude grid.
lon_gridThe longitude grid.
chk_lat90Flag whether pole consistency check to be done (only relevant for dim==3.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 1385 of file check_input.cc.

References chk_if_bool(), is_lon_cyclic(), is_same_within_epsilon(), max, ConstTensor3View::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), and ConstTensor3View::nrows().

Referenced by atmfields_checkedCalc(), AtmFieldsExpand1D(), AtmFieldsRefinePgrid(), atmgeom_checkedCalc(), cloudbox_checkedCalc(), InterpAtmFieldToPosition(), and wind_u_fieldIncludePlanetRotation().

◆ chk_atm_field() [2/2]

void chk_atm_field ( const String x_name,
ConstTensor4View  x,
const Index dim,
const Index nspecies,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid 
)

chk_atm_field (fields with one more dimension)

Checks if an atmospheric field matches the dimensionality and the grids. This is the version for fields like vmr_field, which are a Tensor4, not a Tensor3. (First dimension is the gas species.)

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the atmospheric field.
xA variable holding an atmospheric field.
dimThe atmospheric dimensionality.
nspeciesNumber of species.
p_gridThe pressure grid.
lat_gridThe latitude grid.
lon_gridThe longitude grid.
Author
Stefan Buehler, cloned from Patrick Eriksson
Date
2002-12-20

Definition at line 1529 of file check_input.cc.

References is_same_within_epsilon(), ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstVectorView::nelem(), ConstTensor4View::npages(), and ConstTensor4View::nrows().

◆ chk_atm_grids()

void chk_atm_grids ( const Index dim,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid 
)

chk_atm_grids

Checks if the atmospheric grids and the specified atmospheric dimensionality match, and if the grids are ordered correctly.

The function gives an error message if this is not the case.

Parameters
dimThe atmospheric dimensionality.
p_gridThe pressure grid.
lat_gridThe latitude grid.
lon_gridThe longitude grid.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 1305 of file check_input.cc.

References chk_if_decreasing(), chk_if_increasing(), and ConstVectorView::nelem().

Referenced by atmfields_checkedCalc(), AtmFieldsCalc(), AtmFieldsCalcExpand1D(), AtmFieldsExpand1D(), AtmFieldsFromCompact(), AtmFieldsRefinePgrid(), atmgeom_checkedCalc(), cloudboxSetAutomatically(), cloudboxSetManually(), doit_i_fieldSetConst(), doit_i_fieldUpdateSeq3D(), DoitCloudboxFieldPut(), InterpAtmFieldToPosition(), InterpSurfaceFieldToPosition(), and pnd_fieldCalc().

◆ chk_atm_surface()

void chk_atm_surface ( const String x_name,
const Matrix x,
const Index dim,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid 
)

chk_atm_surface

Checks if a surface-type variable matches the dimensionality and the grids.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the surface-type variable.
xThe variable holding the surface data.
dimThe atmospheric dimensionality.
lat_gridThe latitude grid.
lon_gridThe longitude grid.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 1862 of file check_input.cc.

References is_same_within_epsilon(), ConstMatrixView::ncols(), ConstVectorView::nelem(), and ConstMatrixView::nrows().

Referenced by atmgeom_checkedCalc(), and InterpSurfaceFieldToPosition().

◆ chk_atm_vecfield_lat90()

void chk_atm_vecfield_lat90 ( const String x1_name,
ConstTensor3View  x1,
const String x2_name,
ConstTensor3View  x2,
const Index dim,
ConstVectorView  lat_grid,
const Numeric threshold 
)

chk_atm_vecfield_lat90

Checks if a two-compnent vector atmospheric field is consistant at the poles.

Similar to the field-constant at poles check of chk_atm_field, but checking the total vector instead of each component to be constant (since this involves some numerics, we allow a deviation threshold instead of perfect match). Note that each component of the vector is stored in a separate atmospheric field. Intended for variables that are supposed to be two horizontal components of a 3D vector field (e.g., winds, magnetic field). It is assumed that individual fields have passed chk_atm_field. The function gives an error message if a mismatch is encountered.

Parameters
x1_nameThe name of the atmospheric field.
x1A variable holding an atmospheric field.
x2_nameThe name of the atmospheric field.
x2A variable holding an atmospheric field.
dimThe atmospheric dimensionality.
lat_gridThe latitude grid.
thresholdThe percentage threshold the total vector lengths along the pole are allowed to deviate.
Author
Jana Mendrok
Date
2012-06-29

Definition at line 1696 of file check_input.cc.

References ConstTensor3View::ncols(), ConstTensor3View::npages(), and ConstTensor3View::nrows().

Referenced by atmfields_checkedCalc().

◆ chk_contains()

template<class T >
Index chk_contains ( const String x_name,
const Array< T > &  x,
const T &  what 
)

Check if an array contains a value.

This makes sure that the array x contains the element with value what exactly once.

As a bonus, it returns the index of what in x.

This template function can be used for arrays of anything, provided that the "==" operator is defined.

Returns
The index of the thing we looked for.
Parameters
x_nameName of the array to check
xThe array to check
whatThe value to look for.
Exceptions
runtime_error_not_found,runtime_error_not_unique
Author
Stefan Buehler
Date
2002-11-28

Definition at line 164 of file check_input.h.

References find_all(), and Array< base >::nelem().

Referenced by GasAbsLookup::Adapt(), get_pointers_for_analytical_jacobians(), and jacobianCalcAbsSpeciesPerturbations().

◆ chk_griddedfield_gridname()

void chk_griddedfield_gridname ( const GriddedField gf,
const Index  gridindex,
const String gridname 
)

◆ chk_if_bool()

void chk_if_bool ( const String x_name,
const Index x 
)

chk_if_bool

Checks that a variable of type Index has the value 0 or 1.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA variable of type Index.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 73 of file check_input.cc.

References is_bool().

Referenced by chk_atm_field(), cloudbox_checkedCalc(), sensor_responseAntenna(), and sensor_responseInit().

◆ chk_if_decreasing()

void chk_if_decreasing ( const String x_name,
ConstVectorView  x 
)

chk_if_decreasing

Checks if a vector is strictly decreasing.

Duplicated values are not allowed.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA variable of type Vector.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 327 of file check_input.cc.

References is_decreasing().

Referenced by GasAbsLookup::Adapt(), chk_atm_grids(), doit_i_fieldUpdate1D(), and doit_i_fieldUpdateSeq1D().

◆ chk_if_equal()

void chk_if_equal ( const String x1_name,
const String x2_name,
ConstVectorView  v1,
ConstVectorView  v2,
Numeric  margin 
)

chk_if_equal

Checks if two vectors are equal within a margin.

Parameters
x1_nameThe name of the first variable (used in error message).
x2_nameThe name of the second variable (used in error message).
v1First vector
v2Second vector
marginuncertainty margin. Default: 1e-6
Author
Gerrit Holl
Date
2011-05-04

Definition at line 356 of file check_input.cc.

References abs, chk_vector_length(), and ConstVectorView::nelem().

Referenced by FieldFromGriddedField(), and FieldFromGriddedFieldCheckLatLonHelper().

◆ chk_if_in_range() [1/2]

void chk_if_in_range ( const String x_name,
const Index x,
const Index x_low,
const Index x_high 
)

◆ chk_if_in_range() [2/2]

void chk_if_in_range ( const String x_name,
const Numeric x,
const Numeric x_low,
const Numeric x_high 
)

chk_if_in_range

Checks that a variable of type Numeric has a value inside the specified range.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA variable of type Numeric.
x_lowLowest allowed value for x.
x_highHighest allowed value for x.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 196 of file check_input.cc.

◆ chk_if_increasing() [1/2]

void chk_if_increasing ( const String x_name,
const ArrayOfIndex x 
)

chk_if_increasing

Checks if an ArrayOfIndex is strictly increasing. Cloned from Patricks similar function for Vector.

Duplicated values are not allowed.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA variable of type ArrayOfIndex.
Author
Stefan Buehler
Date
2007-05-18

Definition at line 132 of file check_input.cc.

References is_increasing().

Referenced by GasAbsLookup::Adapt(), atmgeom_checkedCalc(), chk_atm_grids(), doit_conv_flagAbsBT(), doit_conv_flagLsq(), doit_i_fieldUpdate1D(), doit_i_fieldUpdateSeq1D(), doit_i_fieldUpdateSeq3D(), ParticleType2abs_speciesAdd(), ParticleTypeAdd(), ParticleTypeAddAll(), ScatteringDoit(), sensor_checkedCalc(), sensor_responseAntenna(), sensor_responseInit(), WMRFSelectChannels(), and yCalc().

◆ chk_if_increasing() [2/2]

void chk_if_increasing ( const String x_name,
ConstVectorView  x 
)

chk_if_increasing

Checks if a vector is strictly increasing.

Duplicated values are not allowed.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA variable of type Vector.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 297 of file check_input.cc.

References is_increasing().

◆ chk_if_std_blackbody_agenda()

bool chk_if_std_blackbody_agenda ( Workspace ws,
const Agenda blackbody_radiation_agenda 
)

Checks if blackbody_radiation_agenda returns frequency based radiance.

In several places of ARTS it is demanded that blackbody_radiation_agenda is set to the standard Planck function of ARTS. This Planck function returns W/(m2*sr*Hz) (note HZ, not any wavelength).

This function performes a simple test to check if this Planck function is used.

Returns
True or false.
Parameters
wsThe workspace.
blackbody_radiation_agendaAs the WSV with the same name.
Author
Patrick Eriksson
Date
2012-10-02

Definition at line 2149 of file check_input.cc.

References abs, and blackbody_radiation_agendaExecute().

Referenced by CloudboxGetIncoming(), CloudboxGetIncoming1DAtm(), CloudboxGetIncoming2(), fos(), and iyEmissionStandard().

◆ chk_interpolation_grids() [1/2]

void chk_interpolation_grids ( const String which_interpolation,
ConstVectorView  old_grid,
const Numeric new_grid,
const Index  order,
const Numeric extpolfac 
)

Check interpolation grids.

This function checks if old and new grid for an interpolation are ok. If not, it throws a detailed runtime error message. This is intended for workspace method input variable checking.

This is for the special case that the new grid is just a single Numeric, instead of a Vector. ("Red" interpolation.) It just calles the other more general chk_interpolation_grids function for which both grid arguments are vectors.

Parameters
[in]which_interpolationA string describing the interpolation for which the grids are intended.
[in]old_gridThe original grid.
[in]new_gridThe new grid.
[in]orderInterpolation order. (Default value is 1.)
[in]extpolfacThe extrapolation fraction. See gridpos function for details. Has a default value, which is consistent with gridpos.
Author
Stefan Buehler
Date
2008-11-24

Definition at line 1233 of file check_input.cc.

References chk_interpolation_grids().

◆ chk_interpolation_grids() [2/2]

void chk_interpolation_grids ( const String which_interpolation,
ConstVectorView  old_grid,
ConstVectorView  new_grid,
const Index  order,
const Numeric extpolfac,
const bool  islog 
)

Check interpolation grids.

This function checks if old and new grid for an interpolation are ok. If not, it throws a detailed runtime error message. This is intended for workspace method input variable checking.

Parameters
[in]which_interpolationA string describing the interpolation for which the grids are intended.
[in]old_gridThe original grid.
[in]new_gridThe new grid.
[in]orderInterpolation order. (Default value is 1.)
[in]extpolfacThe extrapolation fraction. See gridpos function for details. Has a default value, which is consistent with gridpos.
Author
Stefan Buehler
Date
2008-11-24

Definition at line 1094 of file check_input.cc.

References is_decreasing(), is_increasing(), max, min, and ConstVectorView::nelem().

Referenced by atm_fields_compactAddSpecies(), AtmFieldsCalc(), chk_interpolation_grids(), chk_interpolation_pgrids(), chk_scat_data(), cia_interpolation(), complex_n_interp(), GriddedFieldLatLonRegridHelper(), gridpos_poly_longitudinal(), InterpSurfaceFieldToPosition(), opt_prop_sptFromData(), pha_mat_sptFromDataDOITOpt(), pha_mat_sptFromMonoData(), rte_pos2gridpos(), scat_data_array_monoCalc(), ScatteringMergeParticles1D(), specular_losCalc(), surface_reflectivityFromGriddedField6(), and surface_scalar_reflectivityFromGriddedField4().

◆ chk_interpolation_grids_loose()

void chk_interpolation_grids_loose ( Index ing_min,
Index ing_max,
const String which_interpolation,
ConstVectorView  old_grid,
ConstVectorView  new_grid,
ConstVectorView  data,
const Index  order 
)

Check interpolation grids.

This function checks if old and new grid for an interpolation are ok. If not, it throws a detailed runtime error message. This is intended for workspace method input variable checking. If the original grid does not have to cover the whole new grid. The returned ing_min and ing_max give the positions in the new grid of the first values that are outside the old grid. This is only allowed if the boundary value in the input data is 0.

Parameters
[out]ing_minIndex in the new grid with first value covered by the old grid.
[out]ing_maxIndex in the new grid with last value covered by the old grid.
[in]which_interpolationA string describing the interpolation for which the grids are intended.
[in]old_gridThe original grid.
[in]new_gridThe new grid.
[in]dataThe data for the interpolation.
[in]orderInterpolation order. (Default value is 1.)
[in]extpolfacThe extrapolation fraction. See gridpos function for details. Has a default value, which is consistent with gridpos.
Author
Oliver Lemke
Date
2012-07-11

Definition at line 819 of file check_input.cc.

References chk_interpolation_grids_loose_check_data(), and chk_interpolation_grids_loose_no_data_check().

◆ chk_interpolation_grids_loose_check_data()

void chk_interpolation_grids_loose_check_data ( Index ing_min,
Index ing_max,
const String which_interpolation,
ConstVectorView  old_grid,
ConstVectorView  new_grid,
ConstVectorView  data 
)

Check interpolation grids.

This function checks if old and new grid for an interpolation are ok. If not, it throws a detailed runtime error message. This is intended for workspace method input variable checking. If the original grid does not have to cover the whole new grid. The returned ing_min and ing_max give the positions in the new grid of the first values that are outside the old grid. This is only allowed if the boundary value in the input data is 0.

Parameters
[out]ing_minIndex in the new grid with first value covered by the old grid.
[out]ing_maxIndex in the new grid with last value covered by the old grid.
[in]which_interpolationA string describing the interpolation for which the grids are intended.
[in]old_gridThe original grid.
[in]new_gridThe new grid.
[in]dataThe data for the interpolation.
Author
Oliver Lemke
Date
2012-03-28

Definition at line 1032 of file check_input.cc.

References ConstVectorView::nelem().

Referenced by chk_interpolation_grids_loose().

◆ chk_interpolation_grids_loose_no_data_check()

void chk_interpolation_grids_loose_no_data_check ( Index ing_min,
Index ing_max,
const String which_interpolation,
ConstVectorView  old_grid,
ConstVectorView  new_grid,
const Index  order 
)

Check interpolation grids.

This function checks if old and new grid for an interpolation are ok. If not, it throws a detailed runtime error message. This is intended for workspace method input variable checking. The original grid does not have to cover the whole new grid. The returned ing_min and ing_max give the positions in the new grid of the first values that are outside the old grid.

Parameters
[out]ing_minIndex in the new grid with first value covered by the old grid.
[out]ing_maxIndex in the new grid with last value covered by the old grid.
[in]which_interpolationA string describing the interpolation for which the grids are intended.
[in]old_gridThe original grid.
[in]new_gridThe new grid.
[in]orderInterpolation order. (Default value is 1.)
[in]extpolfacThe extrapolation fraction. See gridpos function for details. Has a default value, which is consistent with gridpos.
Author
Oliver Lemke (based on chk_interpolation_grids by Stefan)
Date
2012-03-28

Definition at line 859 of file check_input.cc.

References is_decreasing(), is_increasing(), max, min, and ConstVectorView::nelem().

Referenced by chk_interpolation_grids_loose(), chk_interpolation_pgrids_loose_no_data_check(), and GriddedFieldZToPRegridHelper().

◆ chk_interpolation_pgrids()

void chk_interpolation_pgrids ( const String which_interpolation,
ConstVectorView  old_pgrid,
ConstVectorView  new_pgrid,
const Index  order,
const Numeric extpolfac 
)

Check log pressure interpolation grids.

This function checks if old and new grid for an interpolation are ok. If not, it throws a detailed runtime error message. This is intended for workspace method input variable checking.

Parameters
[in]which_interpolationA string describing the interpolation for which the grids are intended.
[in]old_pgridThe original grid.
[in]new_pgridThe new grid.
[in]orderInterpolation order. (Default value is 1.)
[in]extpolfacThe extrapolation fraction. See gridpos function for details. Has a default value, which is consistent with gridpos.
Author
Oliver Lemke
Date
2012-07-11

Definition at line 1266 of file check_input.cc.

References chk_interpolation_grids(), ConstVectorView::nelem(), and transform().

Referenced by AtmFieldsCalc(), GriddedFieldPRegridHelper(), and GriddedFieldZToPRegridHelper().

◆ chk_interpolation_pgrids_loose_no_data_check()

void chk_interpolation_pgrids_loose_no_data_check ( Index ing_min,
Index ing_max,
const String which_interpolation,
ConstVectorView  old_pgrid,
ConstVectorView  new_pgrid,
const Index  order 
)

Check log pressure interpolation grids.

This function checks if old and new grid for an interpolation are ok. If not, it throws a detailed runtime error message. This is intended for workspace method input variable checking. The original grid does not have to cover the whole new grid. The returned ing_min and ing_max give the positions in the new grid of the first values that are outside the old grid.

Parameters
[out]ing_minIndex in the new grid with first value covered by the old grid.
[out]ing_maxIndex in the new grid with last value covered by the old grid.
[in]which_interpolationA string describing the interpolation for which the grids are intended.
[in]old_gridThe original grid.
[in]new_gridThe new grid.
[in]orderInterpolation order. (Default value is 1.)
[in]extpolfacThe extrapolation fraction. See gridpos function for details. Has a default value, which is consistent with gridpos.
Author
Oliver Lemke (based on chk_interpolation_grids by Stefan)
Date
2012-03-28

Definition at line 989 of file check_input.cc.

References chk_interpolation_grids_loose_no_data_check(), ConstVectorView::nelem(), and transform().

Referenced by GriddedFieldPRegridHelper().

◆ chk_latlon_true()

void chk_latlon_true ( const Index atmosphere_dim,
ConstVectorView  lat_grid,
ConstVectorView  lat_true,
ConstVectorView  lon_true 
)

chk_latlon_true

Checks that lat_true and lon_true have the correct size for 1D and 2D cases (they are not used for 3D).

Parameters
atmosphere_dimAs the WSV with the same name
lat_gridAs the WSV with the same name
lat_trueAs the WSV with the same name
lon_trueAs the WSV with the same name
Author
Patrick Eriksson
Date
2012-03-19

Definition at line 1819 of file check_input.cc.

References ConstVectorView::nelem().

Referenced by surface_complex_refr_indexFromGriddedField5(), surface_reflectivityFromGriddedField6(), surface_scalar_reflectivityFromGriddedField4(), and z_fieldFromHSE().

◆ chk_matrix_ncols()

void chk_matrix_ncols ( const String x_name,
ConstMatrixView  x,
const Index l 
)

chk_matrix_ncols

Checks that a matrix has the specified number of columns.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA matrix.
lThe expected length of x.
Author
Patrick Eriksson
Date
2002-05-16

Definition at line 402 of file check_input.cc.

References ConstMatrixView::ncols().

Referenced by GasAbsLookup::Adapt().

◆ chk_matrix_nrows()

void chk_matrix_nrows ( const String x_name,
ConstMatrixView  x,
const Index l 
)

chk_matrix_nrows

Checks that a matrix has the specified number of rows.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA matrix.
lThe expected length of x.
Author
Patrick Eriksson
Date
2002-05-16

Definition at line 431 of file check_input.cc.

References ConstMatrixView::nrows().

Referenced by GasAbsLookup::Adapt().

◆ chk_not_empty()

void chk_not_empty ( const String x_name,
const Agenda x 
)

chk_not_empty

Checks that an agenda is not empty.

The function gives an error message if the agenda is empty.

Parameters
x_nameThe name of the agenda.
xA variable of type Agenda.
Author
Patrick Eriksson
Date
2002-08-20

Definition at line 768 of file check_input.cc.

References Agenda::nelem().

Referenced by cloud_RT_surface(), doit_i_fieldIterate(), doit_i_fieldUpdate1D(), doit_i_fieldUpdateSeq1D(), doit_i_fieldUpdateSeq3D(), doit_scat_fieldCalc(), doit_scat_fieldCalcLimb(), get_iy_of_background(), and ScatteringDoit().

◆ chk_not_negative()

void chk_not_negative ( const String x_name,
const Numeric x 
)

chk_not_negative

Checks that a variable of type Numeric is 0 or positive.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA variable of type Numeric.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 166 of file check_input.cc.

Referenced by surfaceBlackbody(), surfaceFlatReflectivity(), surfaceFlatRefractiveIndex(), surfaceFlatScalarReflectivity(), and surfaceLambertianSimple().

◆ chk_rte_los()

void chk_rte_los ( const Index atmosphere_dim,
ConstVectorView  rte_los 
)

chk_rte_los

Performs all needed checks of rte_los

The function gives an error message if this is not the case.

Parameters
atmosphere_dimAs the WSV with the same name.
rte_losAs the WSV with the same name.
Author
Patrick Eriksson
Date
2012-03-26

Definition at line 2047 of file check_input.cc.

References ConstVectorView::nelem().

Referenced by iyInterpCloudboxField2(), iySurfaceRtpropAgenda(), ppath_calc(), surface_reflectivityFromGriddedField6(), and surface_scalar_reflectivityFromGriddedField4().

◆ chk_rte_pos()

void chk_rte_pos ( const Index atmosphere_dim,
ConstVectorView  rte_pos,
const bool &  is_rte_pos2 
)

chk_rte_pos

Performs all needed checks of rte_pos and rte_pos2.

The function gives an error message if this is not the case.

Parameters
atmosphere_dimAs the WSV with the same name.
rte_posAs WSV rte_pos or rte_pos2.
is_rte_pos2True if rte_pos actually is rte_pos2.
Author
Patrick Eriksson
Date
2012-03-26

Definition at line 1961 of file check_input.cc.

References ConstVectorView::nelem().

Referenced by InterpAtmFieldToPosition(), InterpSurfaceFieldToPosition(), iySurfaceRtpropAgenda(), ppath_calc(), rte_losGeometricFromRtePosToRtePos2(), rte_pos2gridpos(), surface_complex_refr_indexFromGriddedField5(), surface_reflectivityFromGriddedField6(), and surface_scalar_reflectivityFromGriddedField4().

◆ chk_size() [1/8]

template<class T >
void chk_size ( const String x_name,
const Array< T > &  x,
const Index c 
)

Check the size of an array.

Checks the size of an Array. Cloned from Patricks similar function for Vector.

The function throws a runtime_error if the size is not correct.

This is a template function that works for any array type.

Parameters
x_nameThe name of the variable.
xA variable of type ArrayOfIndex.
cThe size to match
Author
Stefan Buehler
Date
2007-05-18

Definition at line 221 of file check_input.h.

References Array< base >::nelem().

◆ chk_size() [2/8]

void chk_size ( const String x_name,
ConstMatrixView  x,
const Index r,
const Index c 
)

Runtime check for size of Matrix.

This is the runtime version of is_size. An appropriate error message is generated if the size is not correct.

Parameters
x_nameThe name of the agenda.
xA variable of type Matrix.
rRequired number of rows
cRequired number of columns
Author
Stefan Buehler
Date
2002-11-29

Definition at line 496 of file check_input.cc.

References is_size(), ConstMatrixView::ncols(), and ConstMatrixView::nrows().

◆ chk_size() [3/8]

void chk_size ( const String x_name,
ConstTensor3View  x,
const Index p,
const Index r,
const Index c 
)

Runtime check for size of Tensor.

This is the runtime version of is_size. An appropriate error message is generated if the size is not correct.

Parameters
x_nameThe name of the agenda.
xA variable of type Tensor3.
pRequired number of pages
rRequired number of rows
cRequired number of columns
Author
Stefan Buehler
Date
2002-11-29

Definition at line 531 of file check_input.cc.

References is_size(), ConstTensor3View::ncols(), ConstTensor3View::npages(), and ConstTensor3View::nrows().

◆ chk_size() [4/8]

void chk_size ( const String x_name,
ConstTensor4View  x,
const Index b,
const Index p,
const Index r,
const Index c 
)

Runtime check for size of Tensor.

This is the runtime version of is_size. An appropriate error message is generated if the size is not correct.

Parameters
x_nameThe name of the agenda.
xA variable of type Tensor4.
bRequired number of books
pRequired number of pages
rRequired number of rows
cRequired number of columns
Author
Stefan Buehler
Date
2002-11-29

Definition at line 570 of file check_input.cc.

References is_size(), ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstTensor4View::npages(), and ConstTensor4View::nrows().

◆ chk_size() [5/8]

void chk_size ( const String x_name,
ConstTensor5View  x,
const Index s,
const Index b,
const Index p,
const Index r,
const Index c 
)

Runtime check for size of Tensor.

This is the runtime version of is_size. An appropriate error message is generated if the size is not correct.

Parameters
x_nameThe name of the agenda.
xA variable of type Tensor5.
sRequired number of shelves
bRequired number of books
pRequired number of pages
rRequired number of rows
cRequired number of columns
Author
Stefan Buehler
Date
2002-11-29

Definition at line 613 of file check_input.cc.

References is_size(), ConstTensor5View::nbooks(), ConstTensor5View::ncols(), ConstTensor5View::npages(), ConstTensor5View::nrows(), and ConstTensor5View::nshelves().

◆ chk_size() [6/8]

void chk_size ( const String x_name,
ConstTensor6View  x,
const Index v,
const Index s,
const Index b,
const Index p,
const Index r,
const Index c 
)

Runtime check for size of Tensor.

This is the runtime version of is_size. An appropriate error message is generated if the size is not correct.

Parameters
x_nameThe name of the agenda.
xA variable of type Tensor6.
vRequired number of vitrines
sRequired number of shelves
bRequired number of books
pRequired number of pages
rRequired number of rows
cRequired number of columns
Author
Stefan Buehler
Date
2002-11-29

Definition at line 660 of file check_input.cc.

References is_size(), ConstTensor6View::nbooks(), ConstTensor6View::ncols(), ConstTensor6View::npages(), ConstTensor6View::nrows(), ConstTensor6View::nshelves(), and ConstTensor6View::nvitrines().

◆ chk_size() [7/8]

void chk_size ( const String x_name,
ConstTensor7View  x,
const Index l,
const Index v,
const Index s,
const Index b,
const Index p,
const Index r,
const Index c 
)

Runtime check for size of Tensor.

This is the runtime version of is_size. An appropriate error message is generated if the size is not correct.

Parameters
x_nameThe name of the agenda.
xA variable of type Tensor7.
lRequired number of libraries
vRequired number of vitrines
sRequired number of shelves
bRequired number of books
pRequired number of pages
rRequired number of rows
cRequired number of columns
Author
Stefan Buehler
Date
2002-11-29

Definition at line 711 of file check_input.cc.

References is_size(), ConstTensor7View::nbooks(), ConstTensor7View::ncols(), ConstTensor7View::nlibraries(), ConstTensor7View::npages(), ConstTensor7View::nrows(), ConstTensor7View::nshelves(), and ConstTensor7View::nvitrines().

◆ chk_size() [8/8]

void chk_size ( const String x_name,
ConstVectorView  x,
const Index c 
)

Runtime check for size of Vector.

This is the runtime version of is_size. An appropriate error message is generated if the size is not correct.

Parameters
x_nameThe name of the agenda.
xA variable of type Vector.
cRequired number of elements
Author
Stefan Buehler
Date
2002-11-29

Definition at line 465 of file check_input.cc.

References is_size(), and ConstVectorView::nelem().

Referenced by abs_coefCalcFromXsec(), GasAbsLookup::Adapt(), chk_scat_data(), doit_i_fieldUpdate1D(), doit_i_fieldUpdateSeq1D(), doit_i_fieldUpdateSeq3D(), doit_za_grid_optCalc(), and FieldFromGriddedFieldCheckLatLonHelper().

◆ chk_vector_length() [1/2]

void chk_vector_length ( const String x1_name,
const String x2_name,
ConstVectorView  x1,
ConstVectorView  x2 
)

chk_vector_length

Checks if two vectors have the same length.

The function gives an error message if this is not the case.

Parameters
x1_nameThe name of the first vector
x2_nameThe name of the second vector
x1The first vector.
x2The second vector.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 264 of file check_input.cc.

References ConstVectorView::nelem().

◆ chk_vector_length() [2/2]

void chk_vector_length ( const String x_name,
ConstVectorView  x,
const Index l 
)

chk_vector_length

Checks that a vector has the specified length.

The function gives an error message if this is not the case.

Parameters
x_nameThe name of the variable.
xA variable of type Vector.
lThe expected length of x.
Author
Patrick Eriksson
Date
2002-04-15

Definition at line 233 of file check_input.cc.

References ConstVectorView::nelem().

Referenced by GasAbsLookup::Adapt(), and chk_if_equal().