Go to the documentation of this file.
76 const String& bulkprop_name,
81 if (bulkprop_name ==
"ALL") {
93 os <<
"Could not find " << bulkprop_name
94 <<
" in particle_bulkprop_names.\n";
95 throw std::runtime_error(os.str());
110 if (species ==
"ALL") {
122 os <<
"Could not find " << species <<
" in abs_species.\n";
123 throw std::runtime_error(os.str());
140 if (ijq < -1)
throw runtime_error(
"Argument *ijq* must be >= -1.");
143 os <<
"Argument *ijq* is too high.\n"
144 <<
"You have selected index: " << ijq <<
"\n"
145 <<
"but the number of quantities is only: " << nq <<
"\n"
146 <<
"(Note that zero-based indexing is used)\n";
147 throw runtime_error(os.str());
157 Index ifirst = 0, ilast =
x.nelem() - 1;
163 if (!std::isinf(limit_low)) {
164 for (
Index i = ifirst; i <= ilast; i++) {
165 if (
x[i] < limit_low)
x[i] = limit_low;
168 if (!std::isinf(limit_high)) {
169 for (
Index i = ifirst; i <= ilast; i++) {
170 if (
x[i] > limit_high)
x[i] = limit_high;
206 "The atmospheric fields must be flagged to have "
207 "passed a consistency check (atmfields_checked=1).");
210 "The atmospheric geometry must be flagged to have "
211 "passed a consistency check (atmgeom_checked=1).");
214 "The cloudbox must be flagged to have "
215 "passed a consistency check (cloudbox_checked=1).");
227 xa.resize(ji[nq - 1][1] + 1);
232 const Index np = ji[
q][1] - ji[
q][0] + 1;
290 for (
Index i3 = 0; i3 < vmr_x.
ncols(); i3++) {
291 for (
Index i2 = 0; i2 < vmr_x.
nrows(); i2++) {
310 for (
Index i3 = 0; i3 < vmr_x.
ncols(); i3++) {
311 for (
Index i2 = 0; i2 < vmr_x.
nrows(); i2++) {
313 xa[ji[
q][0] + i] = vmr_x(i1, i2, i3) *
315 water_p_eq(i1, i2, i3);
325 for (
Index i3 = 0; i3 < vmr_x.
ncols(); i3++) {
326 for (
Index i2 = 0; i2 < vmr_x.
nrows(); i2++) {
332 xa[ji[
q][0] + i] = r / (1 + r);
348 "One jacobian quantity belongs to the "
349 "scattering species category, but *particle_bulkprop_field* "
355 "Mismatch in size between "
356 "*particle_bulkprop_field* and *particle_bulkprop_names*.");
363 os <<
"Jacobian quantity with index " <<
q <<
" covers a "
364 <<
"scattering species, and the field quantity is set to \""
366 <<
"could not found in *particle_bulkprop_names*.";
367 throw runtime_error(os.str());
447 mag_x(i, j, k) = std::hypot(
448 std::hypot(mag_u(i, j, k), mag_u(i, j, k)),
459 throw runtime_error(
"Unsupported magnetism type");
489 "One jacobian quantity belongs to the "
490 "surface category, but *surface_props_data* is empty.");
497 os <<
"Jacobian quantity with index " <<
q <<
" covers a "
498 <<
"surface property, and the field Subtag is set to \""
500 <<
"could not found in *surface_props_names*.";
501 throw runtime_error(os.str());
531 os <<
"Found a retrieval quantity that is not yet handled by\n"
533 throw runtime_error(os.str());
572 "The atmospheric fields must be flagged to have "
573 "passed a consistency check (atmfields_checked=1).");
576 "The atmospheric geometry must be flagged to have "
577 "passed a consistency check (atmgeom_checked=1).");
580 "The cloudbox must be flagged to have "
581 "passed a consistency check (cloudbox_checked=1).");
598 if (x_t.
nelem() != ji[nq - 1][1] + 1)
600 "Length of *x* does not match length implied by "
601 "*jacobian_quantities*.");
609 const Index np = ji[
q][1] - ji[
q][0] + 1;
618 Index n_p, n_lat, n_lon;
632 Tensor3 t_x(n_p, n_lat, n_lon);
650 Index n_p, n_lat, n_lon;
663 Tensor3 t3_x(n_p, n_lat, n_lon);
681 x_field(i1, i2, i3) /
694 x_field(i1, i2, i3) * water_p_eq(i1, i2, i3) /
p_grid[i1];
706 const Numeric r = x_field(i1, i2, i3) / (1 - x_field(i1, i2, i3));
724 "One jacobian quantity belongs to the "
725 "scattering species category, but *particle_bulkprop_field* "
731 "Mismatch in size between "
732 "*particle_bulkprop_field* and *particle_bulkprop_field*.");
739 os <<
"Jacobian quantity with index " <<
q <<
" covers a "
740 <<
"scattering species, and the field quantity is set to \""
742 <<
"could not found in *particle_bulkprop_names*.";
743 throw runtime_error(os.str());
749 Index n_p, n_lat, n_lon;
762 Tensor3 pbfield_x(n_p, n_lat, n_lon);
777 Index n_p, n_lat, n_lon;
791 Tensor3 wind_x(n_p, n_lat, n_lon);
816 Index n_p, n_lat, n_lon;
830 Tensor3 mag_x(n_p, n_lat, n_lon);
846 for (
Index i = 0; i < n_p; i++) {
847 for (
Index j = 0; j < n_lat; j++) {
848 for (
Index k = 0; k < n_lon; k++) {
861 throw runtime_error(
"Unsupported magnetism type");
874 "One jacobian quantity belongs to the "
875 "surface category, but *surface_props_data* is empty.");
882 os <<
"Jacobian quantity with index " <<
q <<
" covers a "
883 <<
"surface property, and the field Subtag is set to \""
885 <<
"could not found in *surface_props_names*.";
886 throw runtime_error(os.str());
902 Matrix surf_x(n_lat, n_lon);
934 "The sensor response must be flagged to have "
935 "passed a consistency check (sensor_checked=1).");
952 if (x_t.
nelem() != ji[nq - 1][1] + 1)
954 "Length of *x* does not match length implied by "
955 "*jacobian_quantities*.");
961 bool do_sensor =
false;
966 const Index np = ji[
q][1] - ji[
q][0] + 1;
973 os <<
"Only pointing off-sets treated by *jacobianAddPointingZa* "
974 <<
"are so far handled.";
975 throw runtime_error(os.str());
981 "Mismatch between pointing jacobian and *sensor_los* found.");
983 for (
Index i = 0; i < np; i++) {
991 "Sizes of *sensor_los* and *sensor_time* do not match.");
993 for (
Index c = 0; c < np; c++) {
995 for (
Index i = 0; i <
w.nelem(); i++) {
1007 if (x_t[ji[
q][0]] != 0) {
1013 if (x_t[ji[
q][0]] != 0) {
1017 for (
Index i = 0; i <
w.nelem(); i++) {
1078 throw runtime_error(
"Retrievals of spectroscopic variables not yet handled.");
1099 const Numeric& max_start_cost,
1101 const Index& max_iter,
1103 const Vector& lm_ga_settings,
1104 const Index& clear_matrices,
1105 const Index& display_progress,
1109 const Index m =
y.nelem();
1137 if (method ==
"ml" || method ==
"lm" || method ==
"ml_cg" ||
1138 method ==
"lm_cg") {
1146 if (
x.nelem() != n) {
1154 if (
yf.nelem() == 0) {
1159 if (
yf.nelem() not_eq
y.nelem()) {
1160 std::ostringstream os;
1161 os <<
"Mismatch between simulated y and input y.\n";
1162 os <<
"Input y is size " <<
y.nelem() <<
" but simulated y is "
1163 <<
yf.nelem() <<
"\n";
1164 os <<
"Use your frequency grid vector and your sensor response matrix to match simulations with measurements.\n";
1165 throw std::runtime_error(os.str());
1171 if (method ==
"ml" || method ==
"lm" || display_progress ||
1172 max_start_cost > 0) {
1181 cost_start =
dx * sdx + dy * sdy;
1182 cost_start /=
static_cast<Numeric>(m);
1187 if (max_start_cost > 0 && cost_start > max_start_cost) {
1191 if (display_progress) {
1192 cout <<
"\n No OEM inversion, too high start cost:\n"
1193 <<
" Set limit : " << max_start_cost << endl
1194 <<
" Found value : " << cost_start << endl
1200 bool apply_norm =
false;
1202 if (x_norm.
nelem() == n) {
1205 T.diagonal() = x_norm;
1206 for (
Index i = 0; i < n; i++) {
1207 T(i, i) = x_norm[i];
1222 int oem_verbosity =
static_cast<int>(display_progress);
1224 int return_code = 0;
1227 if (method ==
"li") {
1233 }
else if (method ==
"li_m") {
1239 }
else if (method ==
"li_cg") {
1240 oem::CG cg(T, apply_norm, 1e-10, 0);
1245 }
else if (method ==
"li_cg_m") {
1246 oem::CG cg(T, apply_norm, 1e-10, 0);
1251 }
else if (method ==
"gn") {
1253 oem::GN gn(stop_dx, (
unsigned int)max_iter, s);
1257 }
else if (method ==
"gn_m") {
1259 oem::GN gn(stop_dx, (
unsigned int)max_iter, s);
1263 }
else if (method ==
"gn_cg") {
1264 oem::CG cg(T, apply_norm, 1e-10, 0);
1265 oem::GN_CG gn(stop_dx, (
unsigned int)max_iter, cg);
1269 }
else if (method ==
"gn_cg_m") {
1270 oem::CG cg(T, apply_norm, 1e-10, 0);
1271 oem::GN_CG gn(stop_dx, (
unsigned int)max_iter, cg);
1275 }
else if ((method ==
"lm") || (method ==
"ml")) {
1281 std::make_pair(0, 0),
1282 make_shared<Sparse>(diagonal)));
1286 lm.set_tolerance(stop_dx);
1287 lm.set_maximum_iterations((
unsigned int)max_iter);
1288 lm.set_lambda(lm_ga_settings[0]);
1289 lm.set_lambda_decrease(lm_ga_settings[1]);
1290 lm.set_lambda_increase(lm_ga_settings[2]);
1291 lm.set_lambda_maximum(lm_ga_settings[3]);
1292 lm.set_lambda_threshold(lm_ga_settings[4]);
1293 lm.set_lambda_constraint(lm_ga_settings[5]);
1298 if (lm.get_lambda() > lm.get_lambda_maximum()) {
1301 }
else if ((method ==
"lm_cg") || (method ==
"ml_cg")) {
1302 oem::CG cg(T, apply_norm, 1e-10, 0);
1308 std::make_pair(0, 0),
1309 make_shared<Sparse>(diagonal)));
1312 lm.set_maximum_iterations((
unsigned int)max_iter);
1313 lm.set_lambda(lm_ga_settings[0]);
1314 lm.set_lambda_decrease(lm_ga_settings[1]);
1315 lm.set_lambda_increase(lm_ga_settings[2]);
1316 lm.set_lambda_threshold(lm_ga_settings[3]);
1317 lm.set_lambda_maximum(lm_ga_settings[4]);
1322 if (lm.get_lambda() > lm.get_lambda_maximum()) {
1330 }
catch (
const std::exception& e) {
1337 for (
auto& s : sv) {
1338 std::stringstream ss{s};
1340 while (std::getline(ss, t)) {
1341 errors.push_back(t.c_str());
1349 yf = aw.get_measurement_vector();
1352 if (clear_matrices) {
1357 Matrix tmp1(n, m), tmp2(n, n), tmp3(n, n);
1375 if ((m == 0) || (n == 0)) {
1376 throw runtime_error(
1377 "The gain matrix *dxdy* is required to compute the observation error covariance matrix.");
1380 throw runtime_error(
1381 "The covariance matrix covmat_se has invalid dimensions.");
1395 Matrix tmp1(n, n), tmp2(n, n);
1398 throw runtime_error(
1399 "The averaging kernel matrix *dxdy* is required to compute the smoothing error covariance matrix.");
1402 throw runtime_error(
1403 "The covariance matrix *covmat_sx* invalid dimensions.");
1429 if ((m == 0) || (n == 0))
1430 throw runtime_error(
"The Jacobian matrix is empty.");
1431 if ((
dxdy.nrows() != n) || (
dxdy.ncols() != m)) {
1433 os <<
"Matrices have inconsistent sizes.\n"
1434 <<
" Size of gain matrix: " <<
dxdy.nrows() <<
" x " <<
dxdy.ncols()
1436 <<
" Size of Jacobian: " <<
jacobian.nrows() <<
" x "
1438 throw runtime_error(os.str());
1451 throw runtime_error(
1452 "WSM is not available because ARTS was compiled without "
1460 throw runtime_error(
1461 "WSM is not available because ARTS was compiled without "
1469 throw runtime_error(
1470 "WSM is not available because ARTS was compiled without "
1499 throw runtime_error(
1500 "WSM is not available because ARTS was compiled without "
1505 #if defined(OEM_SUPPORT) && 0
1507 #include "agenda_wrapper_mpi.h"
1522 MPI_Initialized(&initialized);
1524 MPI_Init(
nullptr,
nullptr);
1529 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
1530 MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
1533 int mblock_range = nmblock / nprocs;
1534 int mblock_start = mblock_range * rank;
1535 int remainder = nmblock %
std::max(mblock_range, nprocs);
1541 if (rank < remainder) {
1543 mblock_start += rank;
1545 mblock_start += remainder;
1549 Range range =
Range(mblock_start, mblock_range);
1583 const Numeric& max_start_cost,
1585 const Index& max_iter,
1587 const Vector& lm_ga_settings,
1588 const Index& clear_matrices,
1589 const Index& display_progress,
1593 const Index m =
y.nelem();
1636 if (method ==
"ml" || method ==
"lm") {
1646 if (method ==
"ml" || method ==
"lm" || display_progress ||
1647 max_start_cost > 0) {
1650 cost_start = dot(dy, SeInvMPI * dy);
1655 if (max_start_cost > 0 && cost_start > max_start_cost) {
1659 if (display_progress) {
1660 cout <<
"\n No OEM inversion, too high start cost:\n"
1661 <<
" Set limit : " << max_start_cost << endl
1662 <<
" Found value : " << cost_start << endl
1673 OEMVector xa_oem(
xa), y_oem(
y), x_oem;
1676 OEM_PS_PS_MPI<AgendaWrapperMPI>
oem(aw, xa_oem, SaInvMPI, SeInvMPI);
1679 int return_value = 99;
1681 if (method ==
"li") {
1683 oem::GN_CG gn(stop_dx, (
unsigned int)max_iter, cg);
1685 x_oem, y_oem, gn, 2 * (int)display_progress);
1686 }
else if (method ==
"gn") {
1688 oem::GN_CG gn(stop_dx, (
unsigned int)max_iter, cg);
1690 x_oem, y_oem, gn, 2 * (int)display_progress);
1691 }
else if ((method ==
"lm") || (method ==
"ml")) {
1693 LM_CG_MPI lm(SaInvMPI, cg);
1695 lm.set_tolerance(stop_dx);
1696 lm.set_maximum_iterations((
unsigned int)max_iter);
1697 lm.set_lambda(lm_ga_settings[0]);
1698 lm.set_lambda_decrease(lm_ga_settings[1]);
1699 lm.set_lambda_increase(lm_ga_settings[2]);
1700 lm.set_lambda_threshold(lm_ga_settings[3]);
1701 lm.set_lambda_maximum(lm_ga_settings[4]);
1703 return_value =
oem.compute<oem::LM_CG_MPI, invlib::MPILog>(
1704 x_oem, y_oem, lm, 2 * (int)display_progress);
1750 throw runtime_error(
1751 "You have to compile ARTS with OEM support "
1752 " and enable MPI to use OEM_MPI.");
1755 #endif // OEM_SUPPORT && ENABLE_MPI
Index atmosphere_dim(Workspace &ws) noexcept
Tensor3 wind_v_field(Workspace &ws) noexcept
const String SCATSPECIES_MAINTAG
Matrix covmat_ss(Workspace &ws) noexcept
Agenda sensor_response_agenda(Workspace &ws) noexcept
Matrix sensor_response_dlos_grid(Workspace &ws) noexcept
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.
Index atmgeom_checked(Workspace &ws) noexcept
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Complex w(Complex z) noexcept
The Faddeeva function.
void id_mat(MatrixView I)
Identity Matrix.
Sparse sensor_response(Workspace &ws) noexcept
Matrix dxdy(Workspace &ws) noexcept
const String SINEFIT_MAINTAG
Interface to ARTS inversion_iterate_agenda.
void regrid_atmfield_by_gp(Tensor3 &field_new, const Index &atmosphere_dim, ConstTensor3View field_old, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regrids an atmospheric field, for precalculated grid positions.
Vector lat_grid(Workspace &ws) noexcept
void surface_props_check(const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &surface_props_data, const ArrayOfString &surface_props_names)
Peforms basic checks of surface_props_data and surface_props_names
void inv(MatrixView Ainv, ConstMatrixView A)
Matrix Inverse.
invlib::Matrix< ArtsMatrix > Matrix
invlib wrapper type for ARTS matrices.
Vector y_baseline(Workspace &ws) noexcept
void avkCalc(Matrix &, const Matrix &, const Matrix &, const Verbosity &)
WORKSPACE METHOD: avkCalc.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
invlib::Matrix< invlib::MPIMatrix< invlib::Timer< ArtsCovarianceMatrixWrapper > >> MPICovarianceMatrix
MPI-distributed covariance matrix type.
Vector xa(Workspace &ws) noexcept
Tensor3 wind_u_field(Workspace &ws) noexcept
Vector y(Workspace &ws) noexcept
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
void OEM_checks(Workspace &ws, Vector &x, Vector &yf, Matrix &jacobian, const Agenda &inversion_iterate_agenda, const Vector &xa, const CovarianceMatrix &covmat_sx, const Vector &y, const CovarianceMatrix &covmat_se, const ArrayOfRetrievalQuantity &jacobian_quantities, const String &method, const Vector &x_norm, const Index &max_iter, const Numeric &stop_dx, const Vector &lm_ga_settings, const Index &clear_matrices, const Index &display_progress)
Error checking for OEM method.
void regrid_atmsurf_by_gp_oem(Matrix &field_new, const Index &atmosphere_dim, ConstMatrixView field_old, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regridding of surface field OEM-type.
Tensor3 mag_w_field(Workspace &ws) noexcept
QuantumIdentifier::QType Index LowerQuantumNumbers Species
void covmat_ssCalc(Matrix &, const Matrix &, const CovarianceMatrix &, const Verbosity &)
WORKSPACE METHOD: covmat_ssCalc.
const String FREQUENCY_SUBTAG_0
invlib::Matrix< ArtsCovarianceMatrixWrapper > CovarianceMatrix
invlib wrapper type for ARTS the ARTS covariance class.
Agenda inversion_iterate_agenda(Workspace &ws) noexcept
This file contains the definition of Array.
const String FREQUENCY_SUBTAG_1
Index npages() const
Returns the number of pages.
void transform_x_back(Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms)
Handles back-transformations of the state vector.
ArrayOfString particle_bulkprop_names(Workspace &ws) noexcept
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.
void get_gp_atmgrids_to_rq(ArrayOfGridPos &gp_p, ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, const RetrievalQuantity &rq, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric fields to retrieval grids.
invlib::GaussNewton< Numeric, Std > GN
OEM Gauss-Newton optimization using normed ARTS QR solver.
A tag group can consist of the sum of several of these.
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.
void flat(VectorView x, ConstMatrixView X)
flat
Numeric number_density(const Numeric &p, const Numeric &t)
number_density
Matrix covmat_so(Workspace &ws) noexcept
const String POINTING_SUBTAG_A
Vector sensor_response_f(Workspace &ws) noexcept
void x2artsSpectroscopy(const Verbosity &)
WORKSPACE METHOD: x2artsSpectroscopy.
invlib::GaussNewton< Numeric, CG > GN_CG
Gauss-Newton (GN) optimization using normed CG solver.
void inversion_iterate_agendaExecute(Workspace &ws, Vector &yf, Matrix &jacobian, const Vector &x, const Index jacobian_do, const Index inversion_iteration_counter, const Agenda &input_agenda)
void transform_x(Vector &x, const ArrayOfRetrievalQuantity &jqs)
Handles transformations of the state vector.
const String MAGFIELD_MAINTAG
const String WIND_MAINTAG
void reshape(Tensor3View X, ConstVectorView x)
reshape
Vector sensor_time(Workspace &ws) noexcept
Vector lm_ga_history(Workspace &ws) noexcept
invlib::MAP< ForwardModel, Matrix, CovarianceMatrix, CovarianceMatrix, Vector, Formulation::MFORM > OEM_MFORM
OEM m form.
Index nelem() const
Returns the number of elements.
void add_correlation_inverse(Block c)
Add block inverse to covariance matrix.
Tensor4 vmr_field(Workspace &ws) noexcept
This file contains declerations of functions of physical character.
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
const String POINTING_MAINTAG
Index atmfields_checked(Workspace &ws) noexcept
Vector p_grid(Workspace &ws) noexcept
Tensor3 surface_props_data(Workspace &ws) noexcept
Routines for setting up the jacobian.
NUMERIC Numeric
The type to use for all floating point numbers.
void xClip(Vector &x, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &ijq, const Numeric &limit_low, const Numeric &limit_high, const Verbosity &)
WORKSPACE METHOD: xClip.
std::vector< std::string > handle_nested_exception(const E &e, int level=0)
Handle exception encountered within invlib.
Vector yf(Workspace &ws) noexcept
Defines the ARTS interface to the invlib library.
CovarianceMatrix covmat_sx(Workspace &ws) noexcept
Vector f_backend(Workspace &ws) noexcept
CovarianceMatrix covmat_se(Workspace &ws) noexcept
Matrix sensor_pos(Workspace &ws) noexcept
Vector sensor_response_f_grid(Workspace &ws) noexcept
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.
const String POLYFIT_MAINTAG
void sensor_response_agendaExecute(Workspace &ws, Sparse &sensor_response, Vector &sensor_response_f, Vector &sensor_response_f_grid, ArrayOfIndex &sensor_response_pol, ArrayOfIndex &sensor_response_pol_grid, Matrix &sensor_response_dlos, Matrix &sensor_response_dlos_grid, Matrix &mblock_dlos_grid, const Vector &f_backend, const Agenda &input_agenda)
void mult_inv(MatrixView C, ConstMatrixView A, const CovarianceMatrix &B)
Index nrows() const
Returns the number of rows.
Vector lon_grid(Workspace &ws) noexcept
void Tensor4Clip(Tensor4 &x, const Index &iq, const Numeric &limit_low, const Numeric &limit_high)
Clip Tensor4.
Vector diagonal() const
Diagonal elements as vector.
void water_p_eq_agendaExecute(Workspace &ws, Tensor3 &water_p_eq_field, const Tensor3 &t_field, const Agenda &input_agenda)
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
Matrix mblock_dlos_grid(Workspace &ws) noexcept
ArrayOfIndex sensor_response_pol(Workspace &ws) noexcept
ArrayOfIndex sensor_response_pol_grid(Workspace &ws) noexcept
Vector oem_diagnostics(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
Tensor4 particle_bulkprop_field(Workspace &ws) noexcept
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 &)
Declaration of functions in rte.cc.
Tensor3 mag_v_field(Workspace &ws) noexcept
Tensor3 t_field(Workspace &ws) noexcept
A constant view of a Tensor3.
invlib::MAP< ForwardModel, Matrix, CovarianceMatrix, CovarianceMatrix, Vector, Formulation::STANDARD, invlib::Rodgers531 > OEM_STANDARD
OEM standard form.
void add_inv(MatrixView A, const CovarianceMatrix &B)
invlib::LevenbergMarquardt< Numeric, CovarianceMatrix, CG > LM_CG
Levenberg-Marquardt (LM) optimization using normed CG solver.
Header file for special_interp.cc.
Interface for distributed ARTS forward model.
const String TEMPERATURE_MAINTAG
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.
Tensor3 wind_w_field(Workspace &ws) noexcept
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.
Matrix avk(Workspace &ws) noexcept
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 &)
Index sensor_checked(Workspace &ws) noexcept
void MatrixFromCovarianceMatrix(Matrix &out, const CovarianceMatrix &in, const Verbosity &verbosity)
WORKSPACE METHOD: MatrixFromCovarianceMatrix.
Matrix jacobian(Workspace &ws) noexcept
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
void covmat_soCalc(Matrix &, const Matrix &, const CovarianceMatrix &, const Verbosity &)
WORKSPACE METHOD: covmat_soCalc.
Matrix sensor_response_dlos(Workspace &ws) noexcept
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
void get_gp_rq_to_atmgrids(ArrayOfGridPos &gp_p, ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, Index &n_p, Index &n_lat, Index &n_lon, const ArrayOfVector &ret_grids, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric fields to retrieval grids.
Tensor3 mag_u_field(Workspace &ws) noexcept
invlib::LevenbergMarquardt< Numeric, CovarianceMatrix, Std > LM
Levenberg-Marquardt (LM) optimization using normed ARTS QR solver.
Header file for helper functions for OpenMP.
const String SURFACE_MAINTAG
void get_gp_atmsurf_to_rq(ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, const RetrievalQuantity &rq, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric surfaces to retrieval grids.
void jac_ranges_indices(ArrayOfArrayOfIndex &jis, bool &any_affine, const ArrayOfRetrievalQuantity &jqs, const bool &before_affine)
Determines the index range inside x and the Jacobian for each retrieval quantity.
Agenda water_p_eq_agenda(Workspace &ws) noexcept
Index nelem() const
Number of elements.
Matrix sensor_los(Workspace &ws) noexcept
Index cloudbox_checked(Workspace &ws) noexcept
void regrid_atmfield_by_gp_oem(Tensor3 &field_new, const Index &atmosphere_dim, ConstTensor3View field_old, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regridding of atmospheric field OEM-type.
const String FREQUENCY_MAINTAG
invlib::Vector< invlib::MPIVector< invlib::Timer< ArtsVector > >> MPIVector
MPI-distributed vector type.
const String ABSSPECIES_MAINTAG
The global header file for ARTS.
Index cloudbox_on(Workspace &ws) noexcept
Optimal estimation method for MPI-distributed retrieval.
ArrayOfString surface_props_names(Workspace &ws) noexcept