ARTS
2.4.0(git:4fb77825)
|
Workspace functions related to making OEM inversions. More...
#include <cmath>
#include <iterator>
#include <sstream>
#include <stdexcept>
#include <string>
#include "array.h"
#include "arts.h"
#include "arts_omp.h"
#include "auto_md.h"
#include "jacobian.h"
#include "math_funcs.h"
#include "physics_funcs.h"
#include "rte.h"
#include "special_interp.h"
#include "surface.h"
Go to the source code of this file.
Functions | |
void | particle_bulkprop_fieldClip (Tensor4 &particle_bulkprop_field, const ArrayOfString &particle_bulkprop_names, const String &bulkprop_name, const Numeric &limit_low, const Numeric &limit_high, const Verbosity &) |
WORKSPACE METHOD: particle_bulkprop_fieldClip. More... | |
void | vmr_fieldClip (Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const String &species, const Numeric &limit_low, const Numeric &limit_high, const Verbosity &) |
WORKSPACE METHOD: vmr_fieldClip. More... | |
void | xClip (Vector &x, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &ijq, const Numeric &limit_low, const Numeric &limit_high, const Verbosity &) |
WORKSPACE METHOD: xClip. More... | |
void | xaStandard (Workspace &ws, Vector &xa, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &cloudbox_on, const Index &cloudbox_checked, const Tensor4 &particle_bulkprop_field, const ArrayOfString &particle_bulkprop_names, 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 Tensor3 &surface_props_data, const ArrayOfString &surface_props_names, const Agenda &water_p_eq_agenda, const Verbosity &) |
WORKSPACE METHOD: xaStandard. More... | |
void | x2artsAtmAndSurf (Workspace &ws, Tensor4 &vmr_field, Tensor3 &t_field, Tensor4 &particle_bulkprop_field, Tensor3 &wind_u_field, Tensor3 &wind_v_field, Tensor3 &wind_w_field, Tensor3 &mag_u_field, Tensor3 &mag_v_field, Tensor3 &mag_w_field, Tensor3 &surface_props_data, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &x, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &cloudbox_on, const Index &cloudbox_checked, const ArrayOfString &particle_bulkprop_names, const ArrayOfString &surface_props_names, const Agenda &water_p_eq_agenda, const Verbosity &) |
WORKSPACE METHOD: x2artsAtmAndSurf. More... | |
void | x2artsSensor (Workspace &ws, Matrix &sensor_los, Vector &f_backend, Vector &y_baseline, Sparse &sensor_response, Vector &sensor_response_f, ArrayOfIndex &sensor_response_pol, Matrix &sensor_response_dlos, Vector &sensor_response_f_grid, ArrayOfIndex &sensor_response_pol_grid, Matrix &sensor_response_dlos_grid, Matrix &mblock_dlos_grid, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &x, const Agenda &sensor_response_agenda, const Index &sensor_checked, const Vector &sensor_time, const Verbosity &) |
WORKSPACE METHOD: x2artsSensor. More... | |
void | x2artsSpectroscopy (const Verbosity &) |
WORKSPACE METHOD: x2artsSpectroscopy. More... | |
void | covmat_soCalc (Matrix &, const Matrix &, const CovarianceMatrix &, const Verbosity &) |
WORKSPACE METHOD: covmat_soCalc. More... | |
void | covmat_ssCalc (Matrix &, const Matrix &, const CovarianceMatrix &, const Verbosity &) |
WORKSPACE METHOD: covmat_ssCalc. More... | |
void | avkCalc (Matrix &, const Matrix &, const Matrix &, const Verbosity &) |
WORKSPACE METHOD: avkCalc. More... | |
void | OEM (Workspace &, Vector &, Vector &, Matrix &, Matrix &, Vector &, Vector &, ArrayOfString &, const Vector &, const CovarianceMatrix &, const Vector &, const CovarianceMatrix &, const Index &, const ArrayOfRetrievalQuantity &, const ArrayOfArrayOfIndex &, const Agenda &, const String &, const Numeric &, const Vector &, const Index &, const Numeric &, const Vector &, const Index &, const Index &, const Verbosity &) |
void | OEM_MPI (Workspace &, Vector &, Vector &, Matrix &, Matrix &, Vector &, Vector &, Matrix &, Matrix &, Vector &, CovarianceMatrix &, CovarianceMatrix &, const Vector &, const Vector &, const Index &, const ArrayOfRetrievalQuantity &, const Agenda &, const String &, const Numeric &, const Vector &, const Index &, const Numeric &, const Vector &, const Index &, const Index &, const Verbosity &) |
Variables | |
const String | ABSSPECIES_MAINTAG |
const String | TEMPERATURE_MAINTAG |
const String | POINTING_MAINTAG |
const String | POINTING_SUBTAG_A |
const String | FREQUENCY_MAINTAG |
const String | FREQUENCY_SUBTAG_0 |
const String | FREQUENCY_SUBTAG_1 |
const String | POLYFIT_MAINTAG |
const String | SCATSPECIES_MAINTAG |
const String | SINEFIT_MAINTAG |
const String | SURFACE_MAINTAG |
const String | WIND_MAINTAG |
const String | MAGFIELD_MAINTAG |
Workspace functions related to making OEM inversions.
These functions are listed in the doxygen documentation as entries of the file auto_md.h.
Definition in file m_oem.cc.
void avkCalc | ( | Matrix & | avk, |
const Matrix & | dxdy, | ||
const Matrix & | jacobian, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: avkCalc.
Calculates the averaging kernel matrix describing the sensitivity of the OEM retrieval with respect to the true state of the system. A prerequisite for the calculation of the averaging kernel matrix is a successful OEM calculation in which the jacobian and the gain matrix dxdy have been calculated.
[out] | avk | WS Output |
[in] | dxdy | WS Input |
[in] | jacobian | WS Input |
Definition at line 1465 of file m_oem.cc.
Referenced by avkCalc_g().
void covmat_soCalc | ( | Matrix & | covmat_so, |
const Matrix & | dxdy, | ||
const CovarianceMatrix & | covmat_se, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: covmat_soCalc.
Calculates the covariance matrix describing the error due to uncertainties in the observation system. The uncertainties of the observation system are described by covmat_se, which must be set by the user to include the relevant contributions from the measurement and the forward model.
Prerequisite for the calculation of covmat_so is a successful OEM computation where also the gain matrix has been computed.
[out] | covmat_so | WS Output |
[in] | dxdy | WS Input |
[in] | covmat_se | WS Input |
Definition at line 1447 of file m_oem.cc.
Referenced by covmat_soCalc_g().
void covmat_ssCalc | ( | Matrix & | covmat_ss, |
const Matrix & | avk, | ||
const CovarianceMatrix & | covmat_sx, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: covmat_ssCalc.
Calculates the covariance matrix describing the error due to smoothing. The calculation of covmat_ss also requires the averaging kernel matrix avk to be computed after a successful OEM calculation.
[out] | covmat_ss | WS Output |
[in] | avk | WS Input |
[in] | covmat_sx | WS Input |
Definition at line 1456 of file m_oem.cc.
Referenced by covmat_ssCalc_g().
void OEM | ( | Workspace & | , |
Vector & | , | ||
Vector & | , | ||
Matrix & | , | ||
Matrix & | , | ||
Vector & | , | ||
Vector & | , | ||
ArrayOfString & | , | ||
const Vector & | , | ||
const CovarianceMatrix & | , | ||
const Vector & | , | ||
const CovarianceMatrix & | , | ||
const Index & | , | ||
const ArrayOfRetrievalQuantity & | , | ||
const ArrayOfArrayOfIndex & | , | ||
const Agenda & | , | ||
const String & | , | ||
const Numeric & | , | ||
const Vector & | , | ||
const Index & | , | ||
const Numeric & | , | ||
const Vector & | , | ||
const Index & | , | ||
const Index & | , | ||
const Verbosity & | |||
) |
void OEM_MPI | ( | Workspace & | , |
Vector & | , | ||
Vector & | , | ||
Matrix & | , | ||
Matrix & | , | ||
Vector & | , | ||
Vector & | , | ||
Matrix & | , | ||
Matrix & | , | ||
Vector & | , | ||
CovarianceMatrix & | , | ||
CovarianceMatrix & | , | ||
const Vector & | , | ||
const Vector & | , | ||
const Index & | , | ||
const ArrayOfRetrievalQuantity & | , | ||
const Agenda & | , | ||
const String & | , | ||
const Numeric & | , | ||
const Vector & | , | ||
const Index & | , | ||
const Numeric & | , | ||
const Vector & | , | ||
const Index & | , | ||
const Index & | , | ||
const Verbosity & | |||
) |
void particle_bulkprop_fieldClip | ( | Tensor4 & | particle_bulkprop_field, |
const ArrayOfString & | particle_bulkprop_names, | ||
const String & | bulkprop_name, | ||
const Numeric & | limit_low, | ||
const Numeric & | limit_high, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: particle_bulkprop_fieldClip.
Clipping of particle_bulkprop_field.
The method allows you to apply hard limits the values of particle_bulkprop_field*. All values, of the property selected, below limit_low, are simply set to limit_low. And the same is performed with respect to limit_high. That is, the data in x for the retrieval quantity are forced to be inside the range [limit_low,limit_high].
Setting species="ALL", is a shortcut for applying the limits on all properties.
[in,out] | particle_bulkprop_field | WS Input/Output |
[in] | particle_bulkprop_names | WS Input |
[in] | bulkprop_name | Generic Input |
[in] | limit_low | Generic Input (Default: "-Inf") |
[in] | limit_high | Generic Input (Default: "Inf") |
Definition at line 74 of file m_oem.cc.
References ARTS::Var::particle_bulkprop_field(), ARTS::Var::particle_bulkprop_names(), and Tensor4Clip().
Referenced by particle_bulkprop_fieldClip_g().
void vmr_fieldClip | ( | Tensor4 & | vmr_field, |
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const String & | species, | ||
const Numeric & | limit_low, | ||
const Numeric & | limit_high, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: vmr_fieldClip.
Clipping of vmr_field.
The method allows you to apply hard limits the values of vmr_field. All values, of the species selected, below limit_low, are simply set to limit_low. And the same is performed with respect to limit_high*. That is, the data in x for the retrieval quantity are forced to be inside the range [limit_low,limit_high].
Setting species="ALL", is a shortcut for applying the limits on all species.
[in,out] | vmr_field | WS Input/Output |
[in] | abs_species | WS Input |
[in] | species | Generic Input |
[in] | limit_low | Generic Input (Default: "-Inf") |
[in] | limit_high | Generic Input (Default: "Inf") |
Definition at line 103 of file m_oem.cc.
References ARTS::Var::abs_species(), Species, Tensor4Clip(), and ARTS::Var::vmr_field().
Referenced by vmr_fieldClip_g().
void x2artsAtmAndSurf | ( | Workspace & | ws, |
Tensor4 & | vmr_field, | ||
Tensor3 & | t_field, | ||
Tensor4 & | particle_bulkprop_field, | ||
Tensor3 & | wind_u_field, | ||
Tensor3 & | wind_v_field, | ||
Tensor3 & | wind_w_field, | ||
Tensor3 & | mag_u_field, | ||
Tensor3 & | mag_v_field, | ||
Tensor3 & | mag_w_field, | ||
Tensor3 & | surface_props_data, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Vector & | x, | ||
const Index & | atmfields_checked, | ||
const Index & | atmgeom_checked, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Index & | cloudbox_on, | ||
const Index & | cloudbox_checked, | ||
const ArrayOfString & | particle_bulkprop_names, | ||
const ArrayOfString & | surface_props_names, | ||
const Agenda & | water_p_eq_agenda, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: x2artsAtmAndSurf.
Maps x to atmospheric and surface variables.
Maps OEM's state vector, x, to the matching ARTS variables. This method handles atmospheric and surface variables. If you retrieve other variables, make sure that you also call x2artsSensor and/or x2artsSpectroscopy*.
The following retrieval quantities are handled by this method: <br> Temperature <br> Absorption species <br> Scattering species <br> Winds <br> Surface variables
Should only be used inside inversion_iterate_agenda.
[in,out] | ws | Workspace |
[in,out] | vmr_field | WS Input/Output |
[in,out] | t_field | WS Input/Output |
[in,out] | particle_bulkprop_field | WS Input/Output |
[in,out] | wind_u_field | WS Input/Output |
[in,out] | wind_v_field | WS Input/Output |
[in,out] | wind_w_field | WS Input/Output |
[in,out] | mag_u_field | WS Input/Output |
[in,out] | mag_v_field | WS Input/Output |
[in,out] | mag_w_field | WS Input/Output |
[in,out] | surface_props_data | WS Input/Output |
[in] | jacobian_quantities | WS Input |
[in] | x | WS Input |
[in] | atmfields_checked | WS Input |
[in] | atmgeom_checked | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | abs_species | WS Input |
[in] | cloudbox_on | WS Input |
[in] | cloudbox_checked | WS Input |
[in] | particle_bulkprop_names | WS Input |
[in] | surface_props_names | WS Input |
[in] | water_p_eq_agenda | WS Input |
Definition at line 542 of file m_oem.cc.
References ARTS::Var::abs_species(), ABSSPECIES_MAINTAG, array_species_tag_from_string(), ARTS::Var::atmfields_checked(), ARTS::Var::atmgeom_checked(), ARTS::Var::atmosphere_dim(), chk_contains(), ARTS::Var::cloudbox_checked(), get_gp_rq_to_atmgrids(), jac_ranges_indices(), ARTS::Var::jacobian_quantities(), joker, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), ConstVectorView::nelem(), number_density(), ARTS::Var::p_grid(), q, regrid_atmfield_by_gp_oem(), reshape(), ARTS::Var::t_field(), TEMPERATURE_MAINTAG, transform_x_back(), ARTS::Var::vmr_field(), ARTS::Var::water_p_eq_agenda(), water_p_eq_agendaExecute(), and ARTS::Var::x().
Referenced by x2artsAtmAndSurf_g().
void x2artsSensor | ( | Workspace & | ws, |
Matrix & | sensor_los, | ||
Vector & | f_backend, | ||
Vector & | y_baseline, | ||
Sparse & | sensor_response, | ||
Vector & | sensor_response_f, | ||
ArrayOfIndex & | sensor_response_pol, | ||
Matrix & | sensor_response_dlos, | ||
Vector & | sensor_response_f_grid, | ||
ArrayOfIndex & | sensor_response_pol_grid, | ||
Matrix & | sensor_response_dlos_grid, | ||
Matrix & | mblock_dlos_grid, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Vector & | x, | ||
const Agenda & | sensor_response_agenda, | ||
const Index & | sensor_checked, | ||
const Vector & | sensor_time, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: x2artsSensor.
Maps x to sensor variables.
Maps OEM's state vector, x, to the matching ARTS variables. This method handles variables associated with the sensor. If you retrieve other variables, make sure that you also call x2artsAtmAndSurf <br> and/or x2artsSpectroscopy.
The following retrieval quantities are handled by this method: <br> Pointing <br> Frequency shift and stretch <br> Baseline fits
Should only be used inside inversion_iterate_agenda.
Elements in x representing pointing corrections are mapped to sensor_los*. Elements representing frequency corrections are mapped to f_backend. Baseline variables are mapped to y_baseline.
The sensor response is recalculated if there is any non-zero frequency correction.
[in,out] | ws | Workspace |
[in,out] | sensor_los | WS Input/Output |
[in,out] | f_backend | WS Input/Output |
[out] | y_baseline | WS Output |
[in,out] | sensor_response | WS Input/Output |
[in,out] | sensor_response_f | WS Input/Output |
[in,out] | sensor_response_pol | WS Input/Output |
[in,out] | sensor_response_dlos | WS Input/Output |
[in,out] | sensor_response_f_grid | WS Input/Output |
[in,out] | sensor_response_pol_grid | WS Input/Output |
[in,out] | sensor_response_dlos_grid | WS Input/Output |
[in,out] | mblock_dlos_grid | WS Input/Output |
[in] | jacobian_quantities | WS Input |
[in] | x | WS Input |
[in] | sensor_response_agenda | WS Input |
[in] | sensor_checked | WS Input |
[in] | sensor_time | WS Input |
Definition at line 912 of file m_oem.cc.
References jac_ranges_indices(), ARTS::Var::jacobian_quantities(), ConstVectorView::nelem(), POINTING_MAINTAG, POINTING_SUBTAG_A, q, ARTS::Var::sensor_checked(), ARTS::Var::sensor_los(), ARTS::Var::sensor_time(), transform_x_back(), w(), and ARTS::Var::x().
Referenced by x2artsSensor_g().
void x2artsSpectroscopy | ( | const Verbosity & | verbosity | ) |
WORKSPACE METHOD: x2artsSpectroscopy.
Just defined to indicate a future extensiom.
Don't call the method, it will just generate an error.
Definition at line 1077 of file m_oem.cc.
Referenced by x2artsSpectroscopy_g().
void xaStandard | ( | Workspace & | ws, |
Vector & | xa, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Index & | atmfields_checked, | ||
const Index & | atmgeom_checked, | ||
const Index & | atmosphere_dim, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | t_field, | ||
const Tensor4 & | vmr_field, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Index & | cloudbox_on, | ||
const Index & | cloudbox_checked, | ||
const Tensor4 & | particle_bulkprop_field, | ||
const ArrayOfString & | particle_bulkprop_names, | ||
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 Tensor3 & | surface_props_data, | ||
const ArrayOfString & | surface_props_names, | ||
const Agenda & | water_p_eq_agenda, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: xaStandard.
Standard function for creating xa.
The method creates xa based on jacobian_quantities and the various atmospheric fields. In the case of scattering species, the data are taken from particle_bulkprop_field. The following retrieval quantities are handled: <br> Temperature <br> Absorption species <br> Scattering species <br> Pointing <br> Polynomial baseline fit <br> Sinusoidal baseline fit
[in,out] | ws | Workspace |
[out] | xa | WS Output |
[in] | jacobian_quantities | WS Input |
[in] | atmfields_checked | WS Input |
[in] | atmgeom_checked | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | t_field | WS Input |
[in] | vmr_field | WS Input |
[in] | abs_species | WS Input |
[in] | cloudbox_on | WS Input |
[in] | cloudbox_checked | WS Input |
[in] | particle_bulkprop_field | WS Input |
[in] | particle_bulkprop_names | WS Input |
[in] | wind_u_field | WS Input |
[in] | wind_v_field | WS Input |
[in] | wind_w_field | WS Input |
[in] | mag_u_field | WS Input |
[in] | mag_v_field | WS Input |
[in] | mag_w_field | WS Input |
[in] | surface_props_data | WS Input |
[in] | surface_props_names | WS Input |
[in] | water_p_eq_agenda | WS Input |
Definition at line 176 of file m_oem.cc.
References ARTS::Var::abs_species(), ABSSPECIES_MAINTAG, array_species_tag_from_string(), ARTS::Var::atmfields_checked(), ARTS::Var::atmgeom_checked(), ARTS::Var::atmosphere_dim(), chk_contains(), ARTS::Var::cloudbox_checked(), flat(), get_gp_atmgrids_to_rq(), jac_ranges_indices(), ARTS::Var::jacobian_quantities(), joker, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), ConstTensor3View::ncols(), ConstTensor3View::npages(), ConstTensor3View::nrows(), number_density(), ARTS::Var::p_grid(), q, regrid_atmfield_by_gp(), ARTS::Var::t_field(), TEMPERATURE_MAINTAG, ARTS::Var::vmr_field(), ARTS::Var::water_p_eq_agenda(), water_p_eq_agendaExecute(), and ARTS::Var::xa().
Referenced by xaStandard_g().
void xClip | ( | Vector & | x, |
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const Index & | ijq, | ||
const Numeric & | limit_low, | ||
const Numeric & | limit_high, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: xClip.
Clipping of the state vector.
The method allows you to apply hard limits the values of a retrieval quantity. The retrieval quantity is specified by ijq*. All values of the quantity below limit_low, are simply set to limit_low. And the same is performed with respect to limit_high*. That is, the data in x for the retrieval quantity are forced to be inside the range [limit_low,limit_high].
Setting ijq=-1, is a shortcut for applying the limits on all retrieval quantities.
Notice that limits must be specified in the unit used in x.
[in,out] | x | WS Input/Output |
[in] | jacobian_quantities | WS Input |
[in] | ijq | Generic Input |
[in] | limit_low | Generic Input (Default: "-Inf") |
[in] | limit_high | Generic Input (Default: "Inf") |
Definition at line 131 of file m_oem.cc.
References jac_ranges_indices(), ARTS::Var::jacobian_quantities(), and ARTS::Var::x().
Referenced by xClip_g().
|
extern |
Referenced by x2artsAtmAndSurf(), and xaStandard().
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Referenced by x2artsSensor().
|
extern |
Referenced by x2artsSensor().
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Referenced by x2artsAtmAndSurf(), and xaStandard().
|
extern |