ARTS 2.5.10 (git: 2f1c442c)
|
Routines for setting up the jacobian. More...
#include "arts_conversions.h"
#include "arts_options.h"
#include "array.h"
#include "bifstream.h"
#include "enums.h"
#include "interpolation.h"
#include "logic.h"
#include "matpackI.h"
#include "methods.h"
#include "mystring.h"
#include "ppath_struct.h"
#include "quantum_numbers.h"
#include "species_tags.h"
#include <iostream>
#include <map>
#include <stdexcept>
#include <utility>
Go to the source code of this file.
Classes | |
struct | Jacobian::Target |
Holds all information required for individual partial derivatives. More... | |
class | RetrievalQuantity |
Deals with internal derivatives, Jacobian definition, and OEM calculations. More... | |
struct | jacobianVMRcheck |
Deals with whether or not we should do a VMR derivative. More... | |
Namespaces | |
namespace | Jacobian |
Macros | |
#define | FOR_ANALYTICAL_JACOBIANS_DO(what_to_do) |
#define | FOR_ANALYTICAL_JACOBIANS_DO2(what_to_do) |
Typedefs | |
using | JacobianTarget = Jacobian::Target |
using | ArrayOfJacobianTarget = Array< Jacobian::Target > |
using | ArrayOfRetrievalQuantity = Array< RetrievalQuantity > |
Functions | |
Jacobian::ENUMCLASS (Type, char, Atm, Line, Sensor, Special) ENUMCLASS(Atm | |
Holds the type of the target quantity. | |
Particulates ENUMCLASS(Line, char, VMR, Strength, Center, ShapeG0X0, ShapeG0X1, ShapeG0X2, ShapeG0X3, ShapeD0X0, ShapeD0X1, ShapeD0X2, ShapeD0X3, ShapeG2X0, ShapeG2X1, ShapeG2X2, ShapeG2X3, ShapeD2X0, ShapeD2X1, ShapeD2X2, ShapeD2X3, ShapeFVCX0, ShapeFVCX1, ShapeFVCX2, ShapeFVCX3, ShapeETAX0, ShapeETAX1, ShapeETAX2, ShapeETAX3, ShapeYX0, ShapeYX1, ShapeYX2, ShapeYX3, ShapeGX0, ShapeGX1, ShapeGX2, ShapeGX3, ShapeDVX0, ShapeDVX1, ShapeDVX2, ShapeDVX3, ECS_SCALINGX0, ECS_SCALINGX1, ECS_SCALINGX2, ECS_SCALINGX3, ECS_BETAX0, ECS_BETAX1, ECS_BETAX2, ECS_BETAX3, ECS_LAMBDAX0, ECS_LAMBDAX1, ECS_LAMBDAX2, ECS_LAMBDAX3, ECS_DCX0, ECS_DCX1, ECS_DCX2, ECS_DCX3, NLTE) static_assert(Index(Line | Jacobian::ENUMCLASS (Sensor, char, FrequencyShift, FrequencyStretch, Polyfit, Sinefit, PointingZenithInterp, PointingZenithRecalc) ENUMCLASS(Special |
Holds the Line-related targets. | |
void | jac_ranges_indices (ArrayOfArrayOfIndex &jis, bool &any_affine, const ArrayOfRetrievalQuantity &jqs, const bool &before_affine=false) |
Determines the index range inside x and the Jacobian for each retrieval quantity. | |
void | transform_jacobian (Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs) |
Applies both functional and affine transformations. | |
void | transform_x (Vector &x, const ArrayOfRetrievalQuantity &jqs) |
Handles transformations of the state vector. | |
void | transform_x_back (Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms=true) |
Handles back-transformations of the state vector. | |
bool | check_retrieval_grids (ArrayOfVector &grids, ostringstream &os, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &p_retr, const Vector &lat_retr, const Vector &lon_retr, const String &p_retr_name, const String &lat_retr_name, const String &lon_retr_name, const Index &dim) |
Check that the retrieval grids are defined for each atmosphere dim. | |
bool | check_retrieval_grids (ArrayOfVector &grids, ostringstream &os, const Vector &lat_grid, const Vector &lon_grid, const Vector &lat_retr, const Vector &lon_retr, const String &lat_retr_name, const String &lon_retr_name, const Index &dim) |
Check that the retrieval grids are defined for each atmosphere dim. | |
void | diy_from_path_to_rgrids (Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstTensor3View diy_dpath, const Index &atmosphere_dim, const Ppath &ppath, ConstVectorView ppath_p) |
Maps jacobian data for points along the propagation path, to jacobian retrieval grid data. | |
void | diy_from_pos_to_rgrids (Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstMatrixView diy_dpos, const Index &atmosphere_dim, ConstVectorView rtp_pos) |
diy_from_pos_to_rgrids | |
ArrayOfTensor3 | get_standard_diy_dpath (const ArrayOfRetrievalQuantity &jacobian_quantities, Index np, Index nf, Index ns, bool active) |
Help function for analytical jacobian calculations. | |
ArrayOfTensor3 | get_standard_starting_diy_dx (const ArrayOfRetrievalQuantity &jacobian_quantities, Index np, Index nf, Index ns, bool active) |
Help function for analytical jacobian calculations. | |
ArrayOfIndex | get_pointers_for_analytical_species (const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfSpeciesTag &abs_species) |
Help function for analytical jacobian calculations. | |
ArrayOfIndex | get_pointers_for_scat_species (const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfString &scat_species, const bool cloudbox_on) |
Help function for analytical jacobian calculations. | |
template<std::size_t N> | |
Index | do_analytical_jacobian (const ArrayOfRetrievalQuantity &jacobian_quantities) |
Checks if analytical calculations are needed at all. | |
void | jacobian_type_extrapol (ArrayOfGridPos &gp) |
Adopts grid positions to extrapolation used for jacobians. | |
void | polynomial_basis_func (Vector &b, const Vector &x, const Index &poly_coeff) |
Calculates polynomial basis functions. | |
void | calcBaselineFit (Vector &y_baseline, const Vector &x, const Index &mblock_index, const Sparse &sensor_response, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const RetrievalQuantity &rq, const Index rq_index, const ArrayOfArrayOfIndex &jacobian_indices) |
Calculate baseline fit. | |
void | vmrunitscf (Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t) |
Scale factor for conversion between gas species units. | |
void | dxdvmrscf (Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t) |
Scale factor for conversion of derivatives with respect to VMR. | |
Numeric | temperature_perturbation (const ArrayOfRetrievalQuantity &js) noexcept |
Returns the temperature perturbation if it exists. | |
Numeric | frequency_perturbation (const ArrayOfRetrievalQuantity &js) noexcept |
Returns the frequency perturbation if it exists. | |
Numeric | magnetic_field_perturbation (const ArrayOfRetrievalQuantity &js) noexcept |
Returns the magnetic field perturbation if it exists. | |
String | propmattype_string (const RetrievalQuantity &rq) |
Returns a string of the retrieval quantity propagation matrix type. | |
bool | is_wind_parameter (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a wind parameter in propagation matrix calculations. | |
bool | is_frequency_parameter (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations. | |
bool | is_derived_magnetic_parameter (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a derived magnetic parameter. | |
bool | is_nlte_parameter (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a NLTE parameter. | |
bool | is_pressure_broadening_G0 (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a G0 derivative. | |
bool | is_pressure_broadening_D0 (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a D0 derivative. | |
bool | is_pressure_broadening_G2 (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a G0 derivative. | |
bool | is_pressure_broadening_D2 (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a D2 derivative. | |
bool | is_pressure_broadening_FVC (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a FVC derivative. | |
bool | is_pressure_broadening_ETA (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a ETA derivative. | |
bool | is_pressure_broadening_Y (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a Y derivative. | |
bool | is_pressure_broadening_G (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a G derivative. | |
bool | is_pressure_broadening_DV (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a DV derivative. | |
bool | is_lineshape_parameter_X0 (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a X0 derivative. | |
bool | is_lineshape_parameter_X1 (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a X1 derivative. | |
bool | is_lineshape_parameter_X2 (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a X2 derivative. | |
bool | is_lineshape_parameter_bar_linemixing (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC derivative. | |
bool | is_lineshape_parameter (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC, Y, G, DV derivative. | |
bool | is_line_parameter (const RetrievalQuantity &t) noexcept |
Returns if the Retrieval quantity is related to the absorption line. | |
bool | supports_CIA (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports CIA derivatives. | |
bool | supports_hitran_xsec (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports HITRAN cross-section derivatives. | |
bool | supports_continuum (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports continuum derivatives. | |
bool | supports_relaxation_matrix (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports relaxation matrix derivatives. | |
bool | supports_lookup (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports lookup table derivatives. | |
bool | supports_zeeman (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports Zeeman derivatives. | |
bool | supports_faraday (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports Faraday derivatives. | |
bool | supports_propmat_clearsky (const ArrayOfRetrievalQuantity &js) |
Returns if the array supports propagation matrix derivatives. | |
bool | species_match (const RetrievalQuantity &rq, const ArrayOfSpeciesTag &ast) |
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags. | |
bool | species_match (const RetrievalQuantity &rq, const Species::Species species) |
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags. | |
bool | species_iso_match (const RetrievalQuantity &rq, const Species::IsotopeRecord &ir) |
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags. | |
bool | do_temperature_jacobian (const ArrayOfRetrievalQuantity &js) noexcept |
Returns if the array wants the temperature derivative. | |
jacobianVMRcheck | do_vmr_jacobian (const ArrayOfRetrievalQuantity &js, const QuantumIdentifier &line_qid) noexcept |
Returns the required info for VMR Jacobian. | |
bool | do_line_center_jacobian (const ArrayOfRetrievalQuantity &js) noexcept |
Returns if the array wants a line center derivative. | |
bool | do_wind_jacobian (const ArrayOfRetrievalQuantity &js) noexcept |
Returns if the array wants a wind-based frequency derivative derivative. | |
bool | do_frequency_jacobian (const ArrayOfRetrievalQuantity &js) noexcept |
Returns if the array wants a frequency derivative. | |
bool | do_magnetic_jacobian (const ArrayOfRetrievalQuantity &js) noexcept |
Returns if the array wants a magnetic derivative. | |
Variables | |
Jacobian::char | |
Jacobian::Temperature | |
Jacobian::WindMagnitude | |
Jacobian::WindU | |
Jacobian::WindV | |
Jacobian::WindW | |
Jacobian::MagneticMagnitude | |
Jacobian::MagneticU | |
Jacobian::MagneticV | |
Jacobian::MagneticW | |
Jacobian::Electrons | |
Particulates ENUMCLASS(Line, char, VMR, Strength, Center, ShapeG0X0, ShapeG0X1, ShapeG0X2, ShapeG0X3, ShapeD0X0, ShapeD0X1, ShapeD0X2, ShapeD0X3, ShapeG2X0, ShapeG2X1, ShapeG2X2, ShapeG2X3, ShapeD2X0, ShapeD2X1, ShapeD2X2, ShapeD2X3, ShapeFVCX0, ShapeFVCX1, ShapeFVCX2, ShapeFVCX3, ShapeETAX0, ShapeETAX1, ShapeETAX2, ShapeETAX3, ShapeYX0, ShapeYX1, ShapeYX2, ShapeYX3, ShapeGX0, ShapeGX1, ShapeGX2, ShapeGX3, ShapeDVX0, ShapeDVX1, ShapeDVX2, ShapeDVX3, ECS_SCALINGX0, ECS_SCALINGX1, ECS_SCALINGX2, ECS_SCALINGX3, ECS_BETAX0, ECS_BETAX1, ECS_BETAX2, ECS_BETAX3, ECS_LAMBDAX0, ECS_LAMBDAX1, ECS_LAMBDAX2, ECS_LAMBDAX3, ECS_DCX0, ECS_DCX1, ECS_DCX2, ECS_DCX3, NLTE) static_assert(Index(Line | Jacobian::ArrayOfSpeciesTagVMR |
Particulates ENUMCLASS(Line, char, VMR, Strength, Center, ShapeG0X0, ShapeG0X1, ShapeG0X2, ShapeG0X3, ShapeD0X0, ShapeD0X1, ShapeD0X2, ShapeD0X3, ShapeG2X0, ShapeG2X1, ShapeG2X2, ShapeG2X3, ShapeD2X0, ShapeD2X1, ShapeD2X2, ShapeD2X3, ShapeFVCX0, ShapeFVCX1, ShapeFVCX2, ShapeFVCX3, ShapeETAX0, ShapeETAX1, ShapeETAX2, ShapeETAX3, ShapeYX0, ShapeYX1, ShapeYX2, ShapeYX3, ShapeGX0, ShapeGX1, ShapeGX2, ShapeGX3, ShapeDVX0, ShapeDVX1, ShapeDVX2, ShapeDVX3, ECS_SCALINGX0, ECS_SCALINGX1, ECS_SCALINGX2, ECS_SCALINGX3, ECS_BETAX0, ECS_BETAX1, ECS_BETAX2, ECS_BETAX3, ECS_LAMBDAX0, ECS_LAMBDAX1, ECS_LAMBDAX2, ECS_LAMBDAX3, ECS_DCX0, ECS_DCX1, ECS_DCX2, ECS_DCX3, NLTE) static_assert(Index(Line | Jacobian::ScatteringString |
#define FOR_ANALYTICAL_JACOBIANS_DO | ( | what_to_do | ) |
Definition at line 547 of file jacobian.h.
#define FOR_ANALYTICAL_JACOBIANS_DO2 | ( | what_to_do | ) |
Definition at line 555 of file jacobian.h.
using ArrayOfJacobianTarget = Array<Jacobian::Target> |
Definition at line 321 of file jacobian.h.
Definition at line 544 of file jacobian.h.
using JacobianTarget = Jacobian::Target |
Definition at line 320 of file jacobian.h.
void calcBaselineFit | ( | Vector & | y_baseline, |
const Vector & | x, | ||
const Index & | mblock_index, | ||
const Sparse & | sensor_response, | ||
const ArrayOfIndex & | sensor_response_pol_grid, | ||
const Vector & | sensor_response_f_grid, | ||
const Matrix & | sensor_response_dlos_grid, | ||
const RetrievalQuantity & | rq, | ||
const Index | rq_index, | ||
const ArrayOfArrayOfIndex & | jacobian_indices | ||
) |
Calculate baseline fit.
Computes the baseline fit from a given state vector.
Given a retrieval quantitiy which is either a polynomial or a sine baseline fit this function computes the baseline offset in y_baseline.
[out] | y_baseline | The computed baseline offset. Computed baseline offset are accumulated into this vector, so it must be initialized externally! |
[in] | x | State vector consisten with given retrieval quantity |
[in] | mblock_index | The index of the measurement block. |
[in] | sensor_response | Must be consistent with size of y_baseline. |
[in] | sensor_response_pol_grid | Must be consistent with size of y_baseline. |
[in] | sensor_response_f_grid | Must be consistent with size of y_baseline. |
[in] | sensor_dlos_grid | Must be consistent with size of y_baseline. |
[in] | rq | The poly- or sinefit retrieval quantity |
[in] | rq_index | The index of the retrieval quantity |
[in] | jacobian_indices |
Definition at line 872 of file jacobian.cc.
References a, ARTS_USER_ERROR, c, get_rowindex_for_mblock(), Range::get_start(), RetrievalQuantity::Grids(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), PI, polynomial_basis_func(), Vector::resize(), and w.
Referenced by x2artsSensor().
bool check_retrieval_grids | ( | ArrayOfVector & | grids, |
ostringstream & | os, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Vector & | lat_retr, | ||
const Vector & | lon_retr, | ||
const String & | lat_retr_name, | ||
const String & | lon_retr_name, | ||
const Index & | dim | ||
) |
Check that the retrieval grids are defined for each atmosphere dim.
Use this version for surface variables
This function checks for the given atmosphere dimension that I) the retrieval grids are defined II) and that they are covered by the corresponding atmospheric grid. If not the return is false and an output string is created to print the error to the user. If the grids are ok they are stored in an array and true is returned.
[out] | grids | The array of retrieval grids. |
[in,out] | os | The output string stream. |
[in] | lat_grid | The atmospheric latitude grid |
[in] | lon_grid | The atmospheric longitude grid |
[in] | lat_retr | The latitude retrieval grid. |
[in] | lon_retr | The longitude retrieval grid. |
[in] | lat_retr_name | The control file name for the latitude retrieval grid. |
[in] | lon_retr_name | The control file name for the longitude retrieval grid. |
[in] | dim | The atmosphere dimension |
Definition at line 751 of file jacobian.cc.
References ARTS_ASSERT, is_increasing(), max(), Array< base >::nelem(), and ConstVectorView::nelem().
bool check_retrieval_grids | ( | ArrayOfVector & | grids, |
ostringstream & | os, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Vector & | p_retr, | ||
const Vector & | lat_retr, | ||
const Vector & | lon_retr, | ||
const String & | p_retr_name, | ||
const String & | lat_retr_name, | ||
const String & | lon_retr_name, | ||
const Index & | dim | ||
) |
Check that the retrieval grids are defined for each atmosphere dim.
Use this version for atmospheric fields.
This function checks for the given atmosphere dimension that I) the retrieval grids are defined II) and that they are covered by the corresponding atmospheric grid. If not the return is false and an output string is created to print the error to the user. If the grids are ok they are stored in an array and true is returned.
[out] | grids | The array of retrieval grids. |
[in,out] | os | The output string stream. |
[in] | p_grid | The atmospheric pressure grid |
[in] | lat_grid | The atmospheric latitude grid |
[in] | lon_grid | The atmospheric longitude grid |
[in] | p_retr | The pressure retrieval grid. |
[in] | lat_retr | The latitude retrieval grid. |
[in] | lon_retr | The longitude retrieval grid. |
[in] | p_retr_name | The control file name used for the pressure retrieval grid. |
[in] | lat_retr_name | The control file name for the latitude retrieval grid. |
[in] | lon_retr_name | The control file name for the longitude retrieval grid. |
[in] | dim | The atmosphere dimension |
Definition at line 641 of file jacobian.cc.
References ARTS_ASSERT, is_decreasing(), is_increasing(), Array< base >::nelem(), and ConstVectorView::nelem().
Referenced by jacobianAddAbsSpecies(), jacobianAddMagField(), jacobianAddNLTE(), jacobianAddScatSpecies(), jacobianAddSpecialSpecies(), jacobianAddSurfaceQuantity(), jacobianAddTemperature(), and jacobianAddWind().
void diy_from_path_to_rgrids | ( | Tensor3View | diy_dx, |
const RetrievalQuantity & | jacobian_quantity, | ||
ConstTensor3View | diy_dpath, | ||
const Index & | atmosphere_dim, | ||
const Ppath & | ppath, | ||
ConstVectorView | ppath_p | ||
) |
Maps jacobian data for points along the propagation path, to jacobian retrieval grid data.
[out] | diy_dx | One element of the WSV diy_dx. |
[in] | jacobian_quantity | One element of of the WSV jacobian_quantities. |
[in] | diy_dpath | Jacobians along the propagation path. |
[in] | atmosphere_dim | As the WSV. |
[in] | ppath | As the WSV. |
[in] | ppath_p | The pressure at each ppath point. |
Definition at line 313 of file jacobian.cc.
References ARTS_ASSERT, from_dpath_to_dx(), gp4length1grid(), gridpos(), RetrievalQuantity::Grids(), jacobian_type_extrapol(), joker, Array< base >::nelem(), Ppath::np, p2gridpos(), and Ppath::pos.
Referenced by rtmethods_jacobian_finalisation().
void diy_from_pos_to_rgrids | ( | Tensor3View | diy_dx, |
const RetrievalQuantity & | jacobian_quantity, | ||
ConstMatrixView | diy_dpos, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | rtp_pos | ||
) |
diy_from_pos_to_rgrids
Maps jacobian data for a surface position, to jacobian retrieval grid data.
[out] | diy_dx | One element of the WSV diy_dx. |
[in] | jacobian_quantity | One element of of the WSV jacobian_quantities. |
[in] | diy_dpos | Jacobian for the position itself. |
[in] | atmosphere_dim | As the WSV. |
[in] | rtp_pos | As the WSV. |
Definition at line 475 of file jacobian.cc.
References ARTS_ASSERT, from_dpath_to_dx(), gp4length1grid(), gridpos(), RetrievalQuantity::Grids(), jacobian_type_extrapol(), joker, max(), Array< base >::nelem(), and ConstVectorView::nelem().
Referenced by iySurfaceLambertian(), and iySurfaceRtpropCalc().
Index do_analytical_jacobian | ( | const ArrayOfRetrievalQuantity & | jacobian_quantities | ) |
Checks if analytical calculations are needed at all.
The template argument is either 1 or 2 for checks with the macros FOR_ANALYTICAL_JACOBIANS_DO or FOR_ANALYTICAL_JACOBIANS_DO2, respectively
[in] | jacobian_quantities | As the WSV. |
Definition at line 842 of file jacobian.h.
References FOR_ANALYTICAL_JACOBIANS_DO, FOR_ANALYTICAL_JACOBIANS_DO2, and N.
|
noexcept |
Returns if the array wants a frequency derivative.
[in] | js | As jacobian_quantities WSV |
Definition at line 1175 of file jacobian.cc.
Referenced by abs_xsec_per_speciesAddCIA(), Absorption::PredefinedModel::compute(), propmat_clearskyAddParticles(), and propmat_clearskyAddXsecFit().
|
noexcept |
Returns if the array wants a line center derivative.
[in] | js | As jacobian_quantities WSV |
Definition at line 1167 of file jacobian.cc.
|
noexcept |
Returns if the array wants a magnetic derivative.
[in] | js | As jacobian_quantities WSV |
Definition at line 1179 of file jacobian.cc.
Referenced by propmat_clearskyAddFaraday().
|
noexcept |
Returns if the array wants the temperature derivative.
[in] | js | As jacobian_quantities WSV |
Definition at line 1150 of file jacobian.cc.
Referenced by abs_xsec_per_speciesAddCIA(), Absorption::PredefinedModel::compute(), iyClearsky(), iyEmissionHybrid(), iyEmissionStandard(), propmat_clearskyAddCIA(), propmat_clearskyAddParticles(), and propmat_clearskyAddXsecFit().
|
noexcept |
Returns the required info for VMR Jacobian.
FIXME: The entire existence of this function is a logical error of the programmer...
[in] | js | As jacobian_quantities WSV |
[in] | line_qid | A line identifier |
Definition at line 1154 of file jacobian.cc.
|
noexcept |
Returns if the array wants a wind-based frequency derivative derivative.
[in] | js | As jacobian_quantities WSV |
Definition at line 1171 of file jacobian.cc.
Referenced by propmat_clearskyAddCIA().
void dxdvmrscf | ( | Numeric & | x, |
const String & | unit, | ||
const Numeric & | vmr, | ||
const Numeric & | p, | ||
const Numeric & | t | ||
) |
Scale factor for conversion of derivatives with respect to VMR.
The function finds the factor with which a partial derivative with respect to gas species VMR shall be multiplicated to match the selected (jacobian) unit. The function was implemented for scaling of dpropmat_clearsky_dx but it could also be of use in other contexts.
[out] | x | Scale factor |
[in] | unit | Unit selected. |
[in] | vmr | VMR value. |
[in] | p | Pressure |
[in] | t | Temperature. |
Definition at line 979 of file jacobian.cc.
References ARTS_USER_ERROR, and number_density().
|
noexcept |
Returns the frequency perturbation if it exists.
[in] | js | As jacobian_quantities WSV |
Definition at line 1191 of file jacobian.cc.
Referenced by abs_xsec_per_speciesAddCIA(), propmat_clearskyAddCIA(), and propmat_clearskyAddXsecFit().
ArrayOfIndex get_pointers_for_analytical_species | ( | const ArrayOfRetrievalQuantity & | jacobian_quantities, |
const ArrayOfArrayOfSpeciesTag & | abs_species | ||
) |
Help function for analytical jacobian calculations.
The function determines which terms in jacobian_quantities that are analytical absorption species.
The output Array has the position in abs_species for Jacobian::Line::VMR and Jacobian::Special::ArrayOfSpeciesTagVMR quantities. It has -9999 for Jacobian::Atm::Particulates and for Jacobian::Atm::Electrons. It has -1 for all other types of partial derivatives
[in] | jacobian_quantities | As the WSV. |
[in] | abs_species | As the WSV. |
Definition at line 565 of file jacobian.cc.
References ARTS_USER_ERROR, FOR_ANALYTICAL_JACOBIANS_DO, and Array< base >::nelem().
Referenced by iyClearsky(), iyEmissionHybrid(), iyEmissionStandard(), iyRadarSingleScat(), and iyTransmissionStandard().
ArrayOfIndex get_pointers_for_scat_species | ( | const ArrayOfRetrievalQuantity & | jacobian_quantities, |
const ArrayOfString & | scat_species, | ||
const bool | cloudbox_on | ||
) |
Help function for analytical jacobian calculations.
The function determines which terms in jacobian_quantities that are analytical absorption species.
If the scat species is there, it will have an index pointing to it, otherwise the index will be -1
cloudbox_on must be true or all output is -1
[in] | jacobian_quantities | As the WSV. |
[in] | scat_species | As the WSV. |
[in] | cloudbox_on | As the WSV. |
Definition at line 619 of file jacobian.cc.
References ARTS_USER_ERROR_IF, find_first(), FOR_ANALYTICAL_JACOBIANS_DO, and Array< base >::nelem().
Referenced by iyEmissionHybrid(), iyRadarSingleScat(), and iyTransmissionStandard().
ArrayOfTensor3 get_standard_diy_dpath | ( | const ArrayOfRetrievalQuantity & | jacobian_quantities, |
Index | np, | ||
Index | nf, | ||
Index | ns, | ||
bool | active | ||
) |
Help function for analytical jacobian calculations.
The size of the by-path computations of the Jacobian is set and zeroed
[in] | jacobian_quantities | As the WSV. |
[in] | np | The path grid count |
[in] | nf | The frequency grid count |
[in] | ns | The Stokes grid count |
[in] | active | If true, the middle dimension is np times nf, otherwise it is nf |
Definition at line 597 of file jacobian.cc.
References FOR_ANALYTICAL_JACOBIANS_DO, and Array< base >::nelem().
Referenced by iyClearsky(), iyEmissionHybrid(), iyEmissionStandard(), iyRadarSingleScat(), and iyTransmissionStandard().
ArrayOfTensor3 get_standard_starting_diy_dx | ( | const ArrayOfRetrievalQuantity & | jacobian_quantities, |
Index | np, | ||
Index | nf, | ||
Index | ns, | ||
bool | active | ||
) |
Help function for analytical jacobian calculations.
The size of the computations of the Jacobian is set and zeroed
[in] | jacobian_quantities | As the WSV. |
[in] | np | The path grid count |
[in] | nf | The frequency grid count |
[in] | ns | The Stokes grid count |
[in] | active | If true, the middle dimension is np times nf, otherwise it is nf |
Definition at line 606 of file jacobian.cc.
References FOR_ANALYTICAL_JACOBIANS_DO2, jac_ranges_indices(), and Array< base >::nelem().
Referenced by iyClearsky(), iyEmissionHybrid(), iyEmissionStandard(), iyRadarSingleScat(), and iyTransmissionStandard().
|
noexcept |
Returns if the Retrieval quantity is a derived magnetic parameter.
[in] | t | A retrieval quantity |
Definition at line 1010 of file jacobian.cc.
|
noexcept |
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations.
[in] | t | A retrieval quantity |
Definition at line 1006 of file jacobian.cc.
Referenced by abs_xsec_per_speciesAddCIA(), nlte_sourceFromTemperatureAndSrcCoefPerSpecies(), propmat_clearskyAddFaraday(), and propmat_clearskyAddXsecFit().
|
noexcept |
Returns if the Retrieval quantity is related to the absorption line.
[in] | t | A retrieval quantity |
Definition at line 1085 of file jacobian.cc.
|
noexcept |
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC, Y, G, DV derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Definition at line 1077 of file jacobian.cc.
References is_pressure_broadening_D0(), is_pressure_broadening_D2(), is_pressure_broadening_DV(), is_pressure_broadening_ETA(), is_pressure_broadening_FVC(), is_pressure_broadening_G(), is_pressure_broadening_G0(), is_pressure_broadening_G2(), and is_pressure_broadening_Y().
|
noexcept |
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Definition at line 1070 of file jacobian.cc.
References is_pressure_broadening_D0(), is_pressure_broadening_D2(), is_pressure_broadening_ETA(), is_pressure_broadening_FVC(), is_pressure_broadening_G0(), and is_pressure_broadening_G2().
|
noexcept |
Returns if the Retrieval quantity is a X0 derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Definition at line 1037 of file jacobian.cc.
References VARISLINESHAPEPARAM.
|
noexcept |
Returns if the Retrieval quantity is a X1 derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Definition at line 1045 of file jacobian.cc.
References VARISLINESHAPEPARAM.
|
noexcept |
Returns if the Retrieval quantity is a X2 derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Definition at line 1053 of file jacobian.cc.
References VARISLINESHAPEPARAM.
|
noexcept |
Returns if the Retrieval quantity is a NLTE parameter.
[in] | t | A retrieval quantity |
Definition at line 1014 of file jacobian.cc.
|
noexcept |
Returns if the Retrieval quantity is a D0 derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter(), and is_lineshape_parameter_bar_linemixing().
|
noexcept |
Returns if the Retrieval quantity is a D2 derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter(), and is_lineshape_parameter_bar_linemixing().
|
noexcept |
Returns if the Retrieval quantity is a DV derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter().
|
noexcept |
Returns if the Retrieval quantity is a ETA derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter(), and is_lineshape_parameter_bar_linemixing().
|
noexcept |
Returns if the Retrieval quantity is a FVC derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter(), and is_lineshape_parameter_bar_linemixing().
|
noexcept |
Returns if the Retrieval quantity is a G derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter().
|
noexcept |
Returns if the Retrieval quantity is a G0 derivative.
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter(), and is_lineshape_parameter_bar_linemixing().
|
noexcept |
Returns if the Retrieval quantity is a G0 derivative.
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter(), and is_lineshape_parameter_bar_linemixing().
|
noexcept |
Returns if the Retrieval quantity is a Y derivative.
See LineShape::Model for details on parameter
[in] | t | A retrieval quantity |
Referenced by is_lineshape_parameter().
|
noexcept |
Returns if the Retrieval quantity is a wind parameter in propagation matrix calculations.
[in] | t | A retrieval quantity |
Definition at line 1002 of file jacobian.cc.
Referenced by propmat_clearskyAddCIA().
void jac_ranges_indices | ( | ArrayOfArrayOfIndex & | jis, |
bool & | any_affine, | ||
const ArrayOfRetrievalQuantity & | jqs, | ||
const bool & | before_affine = false |
||
) |
Determines the index range inside x and the Jacobian for each retrieval quantity.
The ranges are given as an ArrayOfArrayOfIndex, where outermost dimension corresponds to retrieval quantity. The inner dimension has throughout size 2, where element 0 is the first index and element 1 is the last index of the range.
[out] | jis | Indices, as described above |
[in] | any_affine | True if at least one quantity has affine transformation. |
[in] | jqs | The WSV jacobian_quantities |
[in] | before_affine | Set to true to get indices without any affine transformation. Default is false. |
Definition at line 46 of file jacobian.cc.
References RetrievalQuantity::HasAffine(), ConstMatrixView::ncols(), RetrievalQuantity::nelem(), Array< base >::nelem(), and RetrievalQuantity::TransformationMatrix().
Referenced by covmat_sxAddBlock(), covmat_sxAddInverseBlock(), get_standard_starting_diy_dx(), jacobianAdjustAndTransform(), jacobianCalcFreqShift(), jacobianCalcFreqStretch(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianCalcPolyfit(), jacobianCalcSinefit(), retrievalDefClose(), transform_jacobian(), transform_x(), transform_x_back(), x2artsAtmAndSurf(), x2artsSensor(), yCalc(), yCalcAppend(), and yRadar().
void jacobian_type_extrapol | ( | ArrayOfGridPos & | gp | ) |
Adopts grid positions to extrapolation used for jacobians.
The standard interpolation scheme applies a linear extrapolation, while for the jacobians the extrapolation can be seen as a "closest" interpolation. That is, for points outisde the covered grid, the value at closest end point is taken. And here extrapolation to +-Inf is allowed.
This function modifies grid positions to jacobaina extrapolation approach. For efficiency, the input grid positions are not asserted at all, and "extrapolation points" are identified simply by a fd outside [0,1].
[in/out] | gp Array of grid positions. |
Definition at line 836 of file jacobian.cc.
References Array< base >::nelem().
Referenced by diy_from_path_to_rgrids(), diy_from_pos_to_rgrids(), get_gp_rq_to_atmgrids(), and SurfaceFlatScalarReflectivity().
|
noexcept |
Returns the magnetic field perturbation if it exists.
[in] | js | As jacobian_quantities WSV |
Definition at line 1199 of file jacobian.cc.
Referenced by propmat_clearskyAddFaraday().
Calculates polynomial basis functions.
The basis function is b(x) = 1 for poly_coeff = 0. For higher coefficients, x^poly_coeff - m, where first the range covered by x* is normalised to [-1,1] and m is selected in such way that sum(b) = 0.
[out] | b | Calculated basis function. |
[in] | x | The grid over which the fit shall be performed. |
[in] | poly_coeff | Polynomial coefficient. |
Definition at line 848 of file jacobian.cc.
References ARTS_ASSERT, b, max(), mean(), min(), ConstVectorView::nelem(), and pow().
Referenced by calcBaselineFit(), jacobianCalcFreqStretch(), jacobianCalcPointingZaInterp(), jacobianCalcPointingZaRecalc(), jacobianCalcPolyfit(), and x2artsSensor().
String propmattype_string | ( | const RetrievalQuantity & | rq | ) |
Returns a string of the retrieval quantity propagation matrix type.
Only use for debugging purpose
[in] | rq | A retrieval quantity |
bool species_iso_match | ( | const RetrievalQuantity & | rq, |
const Species::IsotopeRecord & | ir | ||
) |
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags.
[in] | rq | A retrieval quantity |
[in] | species | An index-mapped species |
[in] | iso | An index-mapped isotopologue |
Definition at line 1141 of file jacobian.cc.
References Species::IsotopeRecord::isotname, Quantum::Number::GlobalState::Isotopologue(), Species::Joker, RetrievalQuantity::QuantumIdentity(), and Species::IsotopeRecord::spec.
bool species_match | ( | const RetrievalQuantity & | rq, |
const ArrayOfSpeciesTag & | ast | ||
) |
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags.
Very slow compared to index input
[in] | rq | A retrieval quantity |
[in] | ast | A list of species tags |
Definition at line 1119 of file jacobian.cc.
References Species::IsotopeRecord::isotname, Quantum::Number::GlobalState::Isotopologue(), Quantum::Number::GlobalState::isotopologue_index, Species::Joker, RetrievalQuantity::QuantumIdentity(), Quantum::Number::GlobalState::Species(), Jacobian::Target::species_array_id, and RetrievalQuantity::Target().
Referenced by abs_xsec_per_speciesAddCIA(), propmat_clearskyAddCIA(), and propmat_clearskyAddXsecFit().
bool species_match | ( | const RetrievalQuantity & | rq, |
const Species::Species | species | ||
) |
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags.
[in] | rq | A retrieval quantity |
[in] | species | An index-mapped species |
Definition at line 1135 of file jacobian.cc.
References RetrievalQuantity::QuantumIdentity(), and Quantum::Number::GlobalState::Species().
bool supports_CIA | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports CIA derivatives.
[in] | js | As jacobian_quantities WSV |
Definition at line 1089 of file jacobian.cc.
Referenced by abs_xsec_per_speciesAddCIA(), and propmat_clearskyAddCIA().
bool supports_continuum | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports continuum derivatives.
[in] | js | As jacobian_quantities WSV |
Definition at line 1097 of file jacobian.cc.
References ARTS_USER_ERROR_IF.
bool supports_faraday | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports Faraday derivatives.
[in] | js | As jacobian_quantities WSV |
bool supports_hitran_xsec | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports HITRAN cross-section derivatives.
[in] | js | As jacobian_quantities WSV |
Definition at line 1093 of file jacobian.cc.
Referenced by propmat_clearskyAddXsecFit().
bool supports_lookup | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports lookup table derivatives.
[in] | js | As jacobian_quantities WSV |
Definition at line 1109 of file jacobian.cc.
References ARTS_USER_ERROR_IF.
bool supports_propmat_clearsky | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports propagation matrix derivatives.
[in] | js | As jacobian_quantities WSV |
Definition at line 1115 of file jacobian.cc.
bool supports_relaxation_matrix | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports relaxation matrix derivatives.
[in] | js | As jacobian_quantities WSV |
Definition at line 1103 of file jacobian.cc.
References ARTS_USER_ERROR_IF.
bool supports_zeeman | ( | const ArrayOfRetrievalQuantity & | js | ) |
Returns if the array supports Zeeman derivatives.
[in] | js | As jacobian_quantities WSV |
|
noexcept |
Returns the temperature perturbation if it exists.
[in] | js | As jacobian_quantities WSV |
Definition at line 1183 of file jacobian.cc.
Referenced by abs_xsec_per_speciesAddCIA(), propmat_clearskyAddCIA(), propmat_clearskyAddParticles(), and propmat_clearskyAddXsecFit().
void transform_jacobian | ( | Matrix & | jacobian, |
const Vector | x, | ||
const ArrayOfRetrievalQuantity & | jqs | ||
) |
Applies both functional and affine transformations.
[in] | jacobian | As the WSV jacobian |
[in] | jqs | As the WSV jacobian_quantities |
Definition at line 91 of file jacobian.cc.
References ARTS_ASSERT, c, RetrievalQuantity::HasAffine(), jac_ranges_indices(), joker, mult(), NAT_LOG_TEN, Array< base >::nelem(), ConstMatrixView::nrows(), pow(), swap(), RetrievalQuantity::TFuncParameters(), transform_x_back(), RetrievalQuantity::TransformationFunc(), and RetrievalQuantity::TransformationMatrix().
Referenced by jacobianAdjustAndTransform().
void transform_x | ( | Vector & | x, |
const ArrayOfRetrievalQuantity & | jqs | ||
) |
Handles transformations of the state vector.
Applies both functional and affine transformations.
[in,out] | x | As the WSV x |
[in] | jqs | As the WSV jacobian_quantities |
Definition at line 156 of file jacobian.cc.
References ARTS_ASSERT, ARTS_USER_ERROR_IF, RetrievalQuantity::HasAffine(), jac_ranges_indices(), mult(), Array< base >::nelem(), RetrievalQuantity::OffsetVector(), swap(), RetrievalQuantity::TFuncParameters(), RetrievalQuantity::TransformationFunc(), RetrievalQuantity::TransformationMatrix(), and transpose().
void transform_x_back | ( | Vector & | x_t, |
const ArrayOfRetrievalQuantity & | jqs, | ||
bool | revert_functional_transforms = true |
||
) |
Handles back-transformations of the state vector.
Applies both functional and affine transformations.
[in] | x | As the WSV x |
[in] | jqs | As the WSV jacobian_quantities |
Definition at line 233 of file jacobian.cc.
References ARTS_ASSERT, RetrievalQuantity::HasAffine(), jac_ranges_indices(), mult(), Array< base >::nelem(), RetrievalQuantity::OffsetVector(), pow(), swap(), RetrievalQuantity::TFuncParameters(), RetrievalQuantity::TransformationFunc(), and RetrievalQuantity::TransformationMatrix().
Referenced by jacobianAdjustAndTransform(), transform_jacobian(), x2artsAtmAndSurf(), and x2artsSensor().
void vmrunitscf | ( | Numeric & | x, |
const String & | unit, | ||
const Numeric & | vmr, | ||
const Numeric & | p, | ||
const Numeric & | t | ||
) |
Scale factor for conversion between gas species units.
The function finds the factor with which the total absorption of a gas species shall be multiplicated to match the selected (jacobian) unit.
[out] | x | Scale factor |
[in] | unit | Unit selected. |
[in] | vmr | VMR value. |
[in] | p | Pressure |
[in] | t | Temperature. |
Definition at line 952 of file jacobian.cc.
References ARTS_USER_ERROR, and number_density().