#include <cmath>
#include <string>
#include "arts.h"
#include "auto_md.h"
#include "check_input.h"
#include "math_funcs.h"
#include "messages.h"
#include "jacobian.h"
#include "rte.h"
#include "absorption.h"
#include "physics_funcs.h"
Go to the source code of this file.
Functions | |
void | jacobianCalc (Workspace &ws, Matrix &jacobian, const Agenda &jacobian_agenda, const ArrayOfArrayOfIndex &jacobian_indices) |
WORKSPACE METHOD: jacobianCalc. | |
void | jacobianClose (Matrix &jacobian, ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfRetrievalQuantity &jacobian_quantities, const Matrix &sensor_pos, const Sparse &sensor_response) |
WORKSPACE METHOD: jacobianClose. | |
void | jacobianInit (Matrix &jacobian, ArrayOfRetrievalQuantity &jacobian_quantities, ArrayOfArrayOfIndex &jacobian_indices, Agenda &jacobian_agenda) |
WORKSPACE METHOD: jacobianInit. | |
void | jacobianOff (Matrix &jacobian, ArrayOfRetrievalQuantity &jacobian_quantities, ArrayOfArrayOfIndex &jacobian_indices, String &jacobian_unit) |
WORKSPACE METHOD: jacobianOff. | |
void | jacobianUnit (Matrix &jacobian, const String &jacobian_unit, const String &y_unit, const Vector &y_f) |
WORKSPACE METHOD: jacobianUnit. | |
void | jacobianAddAbsSpecies (Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Matrix &J, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_p_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &species, const String &method, const String &mode, const Numeric &dx) |
WORKSPACE METHOD: jacobianAddAbsSpecies. | |
void | jacobianCalcAbsSpecies (Workspace &ws, Matrix &J, const Agenda &jacobian_y_agenda, const ArrayOfRetrievalQuantity &jq, const ArrayOfArrayOfIndex &jacobian_indices, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor4 &vmr_field, const Tensor3 &t_field, const Tensor4 &pnd_field, const Matrix &sensor_los, const Vector &y, const String &species) |
WORKSPACE METHOD: jacobianCalcAbsSpecies. | |
void | jacobianAddPointing (Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Matrix &J, const Matrix &sensor_pos, const Vector &sensor_time, const Numeric &dza, const Index &poly_order) |
WORKSPACE METHOD: jacobianAddPointing. | |
void | jacobianCalcPointing (Workspace &ws, Matrix &J, const Agenda &jacobian_y_agenda, const ArrayOfRetrievalQuantity &jq, const ArrayOfArrayOfIndex &jacobian_indices, const Tensor4 &vmr_field, const Tensor3 &t_field, const Tensor4 &pnd_field, const Matrix &sensor_los, const Vector &sensor_time, const Vector &y) |
WORKSPACE METHOD: jacobianCalcPointing. | |
void | jacobianAddPolyfit (Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Matrix &J, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Vector &sensor_response_za_grid, const Matrix &sensor_pos, const Index &poly_order, const Index &no_pol_variation, const Index &no_za_variation, const Index &no_mblock_variation) |
WORKSPACE METHOD: jacobianAddPolyfit. | |
void | jacobianCalcPolyfit (Matrix &J, const ArrayOfRetrievalQuantity &jq, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Vector &sensor_response_za_grid, const Matrix &sensor_pos, const Index &poly_coeff) |
WORKSPACE METHOD: jacobianCalcPolyfit. | |
void | jacobianAddTemperature (Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Matrix &J, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_p_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &hse, const String &method, const Numeric &dx) |
WORKSPACE METHOD: jacobianAddTemperature. | |
void | jacobianCalcTemperature (Workspace &ws, Matrix &J, const Agenda &jacobian_y_agenda, const ArrayOfRetrievalQuantity &jq, const ArrayOfArrayOfIndex &jacobian_indices, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor4 &vmr_field, const Tensor3 &t_field, const Tensor4 &pnd_field, const Matrix &sensor_los, const Vector &y) |
WORKSPACE METHOD: jacobianCalcTemperature. | |
Variables | |
const String | ABSSPECIES_MAINTAG |
const String | POINTING_MAINTAG |
const String | POLYFIT_MAINTAG |
const String | TEMPERATURE_MAINTAG |
Definition in file m_jacobian.cc.
void jacobianAddAbsSpecies | ( | Workspace & | ws, | |
ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
Agenda & | jacobian_agenda, | |||
const Matrix & | jacobian, | |||
const Index & | atmosphere_dim, | |||
const Vector & | p_grid, | |||
const Vector & | lat_grid, | |||
const Vector & | lon_grid, | |||
const Vector & | gin1, | |||
const Vector & | gin2, | |||
const Vector & | gin3, | |||
const String & | species, | |||
const String & | method, | |||
const String & | unit, | |||
const Numeric & | dx | |||
) |
WORKSPACE METHOD: jacobianAddAbsSpecies.
Adds a absorption species as a retrieval quantity to the Jacobian.
For 1D or 2D calculations the latitude and/or longitude grid of the retrieval field should be set to zero length.
There are two possible calculation methods: <br> "analytical" : (semi-)analytical expressions are used <br> "perturbation" : pure numerical perturbations are used
The retrieval unit can be: <br> "vmr" : volume mixing ratio <br> "nd" : number density <br> "rel" : relative unit (e.g. 1.1 means 10% more of the gas)
For perturbation calculations the size of the perturbation is set by the user. The unit of the perturbation size is identical to the retrieval unit.
Generic input: <br> Vector : The pressure grid of the retrieval field. <br> Vector : The latitude grid of the retrieval field. <br> Vector : The longitude grid of the retrieval field.
Keywords: <br> species : The SpeciesTag of the retrieval quantity. <br> method : Calculation method. See above. <br> unit : Retrieval unit. See above. <br> dx : Size of perturbation.
[in,out] | ws | Workspace |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_agenda | WS Output |
[in] | jacobian | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | gin1 | Generic Input |
[in] | gin2 | Generic Input |
[in] | gin3 | Generic Input |
[in] | species | Generic Input |
[in] | method | Generic Input (Default: "analytical") |
[in] | unit | Generic Input (Default: "rel") |
[in] | dx | Generic Input (Default: "0.001") |
Definition at line 243 of file m_jacobian.cc.
References RetrievalQuantity::Analytical(), Agenda::append(), check_retrieval_grids(), RetrievalQuantity::Grids(), RetrievalQuantity::MainTag(), RetrievalQuantity::Mode(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstMatrixView::nrows(), out2, out3, RetrievalQuantity::Perturbation(), and RetrievalQuantity::Subtag().
Referenced by abs_speciesAdd2(), and jacobianAddAbsSpecies_g().
void jacobianAddPointing | ( | Workspace & | ws, | |
ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
Agenda & | jacobian_agenda, | |||
const Matrix & | jacobian, | |||
const Matrix & | sensor_pos, | |||
const Vector & | sensor_time, | |||
const Numeric & | dza, | |||
const Index & | poly_order | |||
) |
WORKSPACE METHOD: jacobianAddPointing.
...
[in,out] | ws | Workspace |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_agenda | WS Output |
[in] | jacobian | WS Input |
[in] | sensor_pos | WS Input |
[in] | sensor_time | WS Input |
[in] | dza | Generic Input (Default: "0.01") |
[in] | poly_order | Generic Input (Default: "0") |
Definition at line 547 of file m_jacobian.cc.
References RetrievalQuantity::Analytical(), Agenda::append(), RetrievalQuantity::Grids(), RetrievalQuantity::MainTag(), RetrievalQuantity::Mode(), ConstMatrixView::ncols(), ConstVectorView::nelem(), Array< base >::nelem(), ConstMatrixView::nrows(), RetrievalQuantity::Perturbation(), Vector::resize(), and RetrievalQuantity::Subtag().
Referenced by jacobianAddPointing_g().
void jacobianAddPolyfit | ( | Workspace & | ws, | |
ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
Agenda & | jacobian_agenda, | |||
const Matrix & | jacobian, | |||
const ArrayOfIndex & | sensor_response_pol_grid, | |||
const Vector & | sensor_response_f_grid, | |||
const Vector & | sensor_response_za_grid, | |||
const Matrix & | sensor_pos, | |||
const Index & | poly_order, | |||
const Index & | no_pol_variation, | |||
const Index & | no_za_variation, | |||
const Index & | no_mblock_variation | |||
) |
WORKSPACE METHOD: jacobianAddPolyfit.
...
[in,out] | ws | Workspace |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_agenda | WS Output |
[in] | jacobian | WS Input |
[in] | sensor_response_pol_grid | WS Input |
[in] | sensor_response_f_grid | WS Input |
[in] | sensor_response_za_grid | WS Input |
[in] | sensor_pos | WS Input |
[in] | poly_order | Generic Input |
[in] | no_pol_variation | Generic Input (Default: "0") |
[in] | no_za_variation | Generic Input (Default: "0") |
[in] | no_mblock_variation | Generic Input (Default: "0") |
Definition at line 780 of file m_jacobian.cc.
References Agenda::append(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), and ConstMatrixView::nrows().
Referenced by jacobianAddPolyfit_g().
void jacobianAddTemperature | ( | Workspace & | ws, | |
ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
Agenda & | jacobian_agenda, | |||
const Matrix & | jacobian, | |||
const Index & | atmosphere_dim, | |||
const Vector & | p_grid, | |||
const Vector & | lat_grid, | |||
const Vector & | lon_grid, | |||
const Vector & | gin1, | |||
const Vector & | gin2, | |||
const Vector & | gin3, | |||
const String & | hse, | |||
const String & | method, | |||
const Numeric & | dx | |||
) |
WORKSPACE METHOD: jacobianAddTemperature.
Adds atmospheric temperatures as a retrieval quantity.
The calculations can be performed by (semi-)analytical expressions or perturbations. Hydrostatic equilibrium can be included for perturbation calculations. These choices are selected by corresponding general input variables.
For 1D or 2D calculations the latitude and/or longitude grid of the retrieval field should be set to zero length. The WSM *jacobianCalcTemperature* is automatically added to jacobian_agenda*.
[in,out] | ws | Workspace |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_agenda | WS Output |
[in] | jacobian | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | gin1 | Generic Input |
[in] | gin2 | Generic Input |
[in] | gin3 | Generic Input |
[in] | hse | Generic Input (Default: "off") |
[in] | method | Generic Input (Default: "analytical") |
[in] | dx | Generic Input (Default: "1") |
Definition at line 983 of file m_jacobian.cc.
References RetrievalQuantity::Analytical(), Agenda::append(), check_retrieval_grids(), RetrievalQuantity::Grids(), RetrievalQuantity::MainTag(), RetrievalQuantity::Mode(), ConstMatrixView::ncols(), Array< base >::nelem(), ConstMatrixView::nrows(), out3, RetrievalQuantity::Perturbation(), and RetrievalQuantity::Subtag().
Referenced by jacobianAddTemperature_g().
void jacobianCalc | ( | Workspace & | ws, | |
Matrix & | jacobian, | |||
const Agenda & | jacobian_agenda, | |||
const ArrayOfArrayOfIndex & | jacobian_indices | |||
) |
WORKSPACE METHOD: jacobianCalc.
Executes *jacobian_agenda* to calculate (parts of) *jacobian*. It is important that *y* holds the original output of *RteCalc* as the methods called performs perturbations to obtain cahnges in y*.
[in,out] | ws | Workspace |
[out] | jacobian | WS Output |
[in] | jacobian_agenda | WS Input |
[in] | jacobian_indices | WS Input |
Definition at line 71 of file m_jacobian.cc.
References jacobian_agendaExecute(), ConstMatrixView::ncols(), Agenda::nelem(), Array< base >::nelem(), and out2.
Referenced by jacobianCalc_g().
void jacobianCalcAbsSpecies | ( | Workspace & | ws, | |
Matrix & | jacobian, | |||
const Agenda & | jacobian_y_agenda, | |||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
const ArrayOfArrayOfIndex & | jacobian_indices, | |||
const Index & | atmosphere_dim, | |||
const Vector & | p_grid, | |||
const Vector & | lat_grid, | |||
const Vector & | lon_grid, | |||
const ArrayOfArrayOfSpeciesTag & | abs_species, | |||
const Tensor4 & | vmr_field, | |||
const Tensor3 & | t_field, | |||
const Tensor4 & | pnd_field, | |||
const Matrix & | sensor_los, | |||
const Vector & | y, | |||
const String & | species | |||
) |
WORKSPACE METHOD: jacobianCalcAbsSpecies.
Calculates absorption species jacobians by perturbations.
This function is added to *jacobian_agenda* by jacobianAddAbsSpecies and should normally not be called by the user.
[in,out] | ws | Workspace |
[out] | jacobian | WS Output |
[in] | jacobian_y_agenda | WS Input |
[in] | jacobian_quantities | WS Input |
[in] | jacobian_indices | 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] | vmr_field | WS Input |
[in] | t_field | WS Input |
[in] | pnd_field | WS Input |
[in] | sensor_los | WS Input |
[in] | y | WS Input |
[in] | species | Generic Input |
Definition at line 348 of file m_jacobian.cc.
References RetrievalQuantity::Analytical(), array_species_tag_from_string(), calc_nd_field(), chk_contains(), get_perturbation_gridpos(), get_perturbation_range(), RetrievalQuantity::Grids(), jacobian_y_agendaExecute(), joker, RetrievalQuantity::Mode(), ConstTensor3View::ncols(), ConstVectorView::nelem(), Array< base >::nelem(), ConstTensor3View::npages(), ConstTensor3View::nrows(), out2, perturbation_field_1d(), perturbation_field_2d(), and perturbation_field_3d().
Referenced by jacobianCalcAbsSpecies_g().
void jacobianCalcPointing | ( | Workspace & | ws, | |
Matrix & | jacobian, | |||
const Agenda & | jacobian_y_agenda, | |||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
const ArrayOfArrayOfIndex & | jacobian_indices, | |||
const Tensor4 & | vmr_field, | |||
const Tensor3 & | t_field, | |||
const Tensor4 & | pnd_field, | |||
const Matrix & | sensor_los, | |||
const Vector & | sensor_time, | |||
const Vector & | y | |||
) |
WORKSPACE METHOD: jacobianCalcPointing.
Calculates pointing deviation jacobians by perturnbations.
This function is added to *jacobian_agenda* by jacobianAddPointing and should normally not be called by the user.
[in,out] | ws | Workspace |
[out] | jacobian | WS Output |
[in] | jacobian_y_agenda | WS Input |
[in] | jacobian_quantities | WS Input |
[in] | jacobian_indices | WS Input |
[in] | vmr_field | WS Input |
[in] | t_field | WS Input |
[in] | pnd_field | WS Input |
[in] | sensor_los | WS Input |
[in] | sensor_time | WS Input |
[in] | y | WS Input |
Definition at line 645 of file m_jacobian.cc.
References chk_if_increasing(), RetrievalQuantity::Grids(), jacobian_y_agendaExecute(), joker, RetrievalQuantity::Mode(), ConstVectorView::nelem(), Array< base >::nelem(), ConstMatrixView::nrows(), RetrievalQuantity::Perturbation(), and polynomial_basis_func().
Referenced by jacobianCalcPointing_g().
void jacobianCalcPolyfit | ( | Matrix & | jacobian, | |
const ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
const ArrayOfArrayOfIndex & | jacobian_indices, | |||
const ArrayOfIndex & | sensor_response_pol_grid, | |||
const Vector & | sensor_response_f_grid, | |||
const Vector & | sensor_response_za_grid, | |||
const Matrix & | sensor_pos, | |||
const Index & | poly_coeff | |||
) |
WORKSPACE METHOD: jacobianCalcPolyfit.
Calculates jacobians for polynomial baseline fit.
This function is added to *jacobian_agenda* by jacobianAddPolyfit and should normally not be called by the user.
[out] | jacobian | WS Output |
[in] | jacobian_quantities | WS Input |
[in] | jacobian_indices | WS Input |
[in] | sensor_response_pol_grid | WS Input |
[in] | sensor_response_f_grid | WS Input |
[in] | sensor_response_za_grid | WS Input |
[in] | sensor_pos | WS Input |
[in] | poly_coeff | Generic Input |
Definition at line 884 of file m_jacobian.cc.
References ConstVectorView::nelem(), Array< base >::nelem(), ConstMatrixView::nrows(), and polynomial_basis_func().
Referenced by jacobianCalcPolyfit_g().
void jacobianCalcTemperature | ( | Workspace & | ws, | |
Matrix & | jacobian, | |||
const Agenda & | jacobian_y_agenda, | |||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
const ArrayOfArrayOfIndex & | jacobian_indices, | |||
const Index & | atmosphere_dim, | |||
const Vector & | p_grid, | |||
const Vector & | lat_grid, | |||
const Vector & | lon_grid, | |||
const Tensor4 & | vmr_field, | |||
const Tensor3 & | t_field, | |||
const Tensor4 & | pnd_field, | |||
const Matrix & | sensor_los, | |||
const Vector & | y | |||
) |
WORKSPACE METHOD: jacobianCalcTemperature.
Calculates atmospheric temperature jacobians by perturbations.
This function is added to *jacobian_agenda* by jacobianAddTemperature and should normally not be called by the user.
[in,out] | ws | Workspace |
[out] | jacobian | WS Output |
[in] | jacobian_y_agenda | WS Input |
[in] | jacobian_quantities | WS Input |
[in] | jacobian_indices | WS Input |
[in] | atmosphere_dim | WS Input |
[in] | p_grid | WS Input |
[in] | lat_grid | WS Input |
[in] | lon_grid | WS Input |
[in] | vmr_field | WS Input |
[in] | t_field | WS Input |
[in] | pnd_field | WS Input |
[in] | sensor_los | WS Input |
[in] | y | WS Input |
Definition at line 1107 of file m_jacobian.cc.
References get_perturbation_gridpos(), get_perturbation_range(), RetrievalQuantity::Grids(), jacobian_y_agendaExecute(), joker, ConstVectorView::nelem(), Array< base >::nelem(), out2, perturbation_field_1d(), perturbation_field_2d(), perturbation_field_3d(), and RetrievalQuantity::Subtag().
Referenced by jacobianCalcTemperature_g().
void jacobianClose | ( | Matrix & | jacobian, | |
ArrayOfArrayOfIndex & | jacobian_indices, | |||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
const Matrix & | sensor_pos, | |||
const Sparse & | sensor_response | |||
) |
WORKSPACE METHOD: jacobianClose.
Close the array of retrieval quantities and prepare for calculation of the Jacobian matrix.
This function closes the *jacobian_quantities* array and sets the correct size of *jacobian*. Retrieval quantities should not be added after a call to this WSM.
To define the final *jacobian* the number of spectra is needed. Therefor the number of measurement blocks, taken from *sensor_pos* and the size of *sensor_response* has to be defined.
[out] | jacobian | WS Output |
[out] | jacobian_indices | WS Output |
[in] | jacobian_quantities | WS Input |
[in] | sensor_pos | WS Input |
[in] | sensor_response | WS Input |
Definition at line 109 of file m_jacobian.cc.
References ConstMatrixView::ncols(), Array< base >::nelem(), Sparse::nrows(), ConstMatrixView::nrows(), and Matrix::resize().
Referenced by jacobianClose_g().
void jacobianInit | ( | Matrix & | jacobian, | |
ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
ArrayOfArrayOfIndex & | jacobian_indices, | |||
Agenda & | jacobian_agenda | |||
) |
WORKSPACE METHOD: jacobianInit.
Initialises the variables connected to the Jacobian matrix.
This function initialises the *jacobian_quantities* array so that retrieval quantities can be added to it, therefor it has to be called before any subsequent calls to jacobianAddGas jacobianAddTemperature, jacobianAddPointing or similar methods.
The Jacobian quantities are initialised to be empty.
[out] | jacobian | WS Output |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_indices | WS Output |
[out] | jacobian_agenda | WS Output |
Definition at line 178 of file m_jacobian.cc.
References Matrix::resize(), and Agenda::set_name().
Referenced by jacobianInit_g(), and jacobianOff().
void jacobianOff | ( | Matrix & | jacobian, | |
ArrayOfRetrievalQuantity & | jacobian_quantities, | |||
ArrayOfArrayOfIndex & | jacobian_indices, | |||
String & | jacobian_unit | |||
) |
WORKSPACE METHOD: jacobianOff.
Makes mandatory initialisation of some jacobian variables.
Some jacobian WSVs must be initilised even if no such calculations will be performed and this is handled with this method. That is, this method must be called when no jacobians will be calculated.
[out] | jacobian | WS Output |
[out] | jacobian_quantities | WS Output |
[out] | jacobian_indices | WS Output |
[out] | jacobian_unit | WS Output |
Definition at line 194 of file m_jacobian.cc.
References jacobianInit().
Referenced by jacobianOff_g(), and RteCalcNoJacobian().
void jacobianUnit | ( | Matrix & | jacobian, | |
const String & | jacobian_unit, | |||
const String & | y_unit, | |||
const Vector & | y_f | |||
) |
WORKSPACE METHOD: jacobianUnit.
Conversion of *jacobian* to other spectral units.
Works as *yUnit* but operates on *jacobian* and conversion <br> determined by *jacobian_unit*.
[out] | jacobian | WS Output |
[in] | jacobian_unit | WS Input |
[in] | y_unit | WS Input |
[in] | y_f | WS Input |
Definition at line 210 of file m_jacobian.cc.
References ybatchUnit().
Referenced by jacobianUnit_g().
const String ABSSPECIES_MAINTAG |
const String POINTING_MAINTAG |
const String POLYFIT_MAINTAG |
const String TEMPERATURE_MAINTAG |