Go to the documentation of this file.
14 const Index grid_dimensions,
21 for (
Index j = 0; j < grid_dimensions; ++j) {
26 if ((n_gps == extent) && (n_gps ==
covmat_block.ncols())) {
27 std::shared_ptr<Sparse> mat = make_shared<Sparse>(
covmat_block);
29 Block(range, range, std::make_pair(rq_index, rq_index), mat));
32 os <<
"The matrix in covmat_block was expected to have dimensions ["
33 << n_gps <<
", " << n_gps <<
"] but found to have dimensions ["
35 throw runtime_error(os.str());
43 Block(range, range, std::make_pair(rq_index, rq_index), mat));
46 os <<
"The matrix in covmat_inv_block was expected to have dimensions ["
47 << n_gps <<
", " << n_gps <<
"] but found to have dimensions ["
49 throw runtime_error(os.str());
61 std::shared_ptr<Matrix> mat = make_shared<Matrix>(1, 1);
62 mat->operator()(0, 0) =
var;
64 mat = make_shared<Matrix>(1, 1);
65 mat->operator()(0, 0) = 1.0 /
var;
67 Block(range, range, std::make_pair(i, i), mat));
79 throw runtime_error(
"Pressures below 0.01 Pa are not accedpted.");
84 z_grid[i] = 16e3 * (5.0 - log10(
p_grid[i]));
92 if (z_grid[i] > 120e3) {
93 throw runtime_error(
"Altitudes above 120 km are not accepted.");
98 p_grid[i] =
pow(10.0, 5.0 - z_grid[i] / 16e3);
106 template <
typename MatrixType>
113 matrix.insert_elements(
114 row_indices.
nelem(), row_indices, column_indices, elements);
124 assert(row_indices.
nelem() == column_indices.
nelem());
125 assert(column_indices.
nelem() == elements.
nelem());
129 for (
Index i = 0; i < elements.
nelem(); ++i) {
130 matrix(row_indices[i], column_indices[i]) = elements[i];
134 template <
typename MatrixType>
141 "Cannot pass empty vector of variances to covmat_blockSetDiagonal");
148 Vector elements(n), elements_inv(n);
149 for (
Index i = 0; i < n; ++i) {
151 elements[i] = vars[i];
152 elements_inv[i] = 1.0 / vars[i];
168 template <
typename MatrixType>
178 Vector elements, elements_inv;
180 if (n != sigma.
nelem()) {
181 throw runtime_error(
"Size of grid incompatible with given variances.");
184 elements =
Vector(row_indices.size());
185 for (
size_t i = 0; i < row_indices.size(); ++i) {
186 Numeric dz =
abs(grid[row_indices[i]] - grid[column_indices[i]]);
188 sigma[row_indices[i]] * sigma[column_indices[i]] * exp(-dz / lc);
196 elements =
Vector(3 * n - 2);
200 Numeric c1 = -alpha / (1.0 - alpha * alpha);
201 Numeric c2 = 1.0 / (1.0 - alpha * alpha);
203 for (
Index i = 0; i < n; ++i) {
206 column_indices.push_back(i - 1);
207 row_indices.push_back(i);
208 elements[i * 3 - 1] = c1;
209 elements[i * 3 - 1] /= (sigma[i] * sigma[i - 1]);
213 column_indices.push_back(i);
214 row_indices.push_back(i);
215 if (i == 0 || i == n - 1) {
216 elements[i * 3] = c2;
218 elements[i * 3] = c2 * (1.0 + alpha * alpha);
220 elements[i * 3] /= (sigma[i] * sigma[i]);
224 column_indices.push_back(i + 1);
225 row_indices.push_back(i);
226 elements[i * 3 + 1] = c1;
227 elements[i * 3 + 1] /= (sigma[i] * sigma[i + 1]);
231 insert_elements(block_inv, n, n, row_indices, column_indices, elements);
250 template <
typename MatrixType>
262 Vector sigma1_copy(sigma1), lc1_copy(lc1);
264 assert((sigma1.
nelem() == m) || (sigma1.
nelem() == 1));
265 if (sigma1.
nelem() == 1) {
271 assert((lc1.
nelem() == m) || (lc1.
nelem() == 1));
272 if (lc1.
nelem() == 1) {
279 Vector sigma2_copy(sigma2), lc2_copy(lc2);
281 assert((sigma2.
nelem() == n) || (sigma2.
nelem() == 1));
282 if (sigma2.
nelem() == 1) {
288 assert((lc2.
nelem() == n) || (lc2.
nelem() == 1));
289 if (lc2.
nelem() == 1) {
296 cls_view_1(lc1_copy);
298 cls_view_2(lc2_copy);
302 grid_view_2 = grid_view_1;
303 sigma_view_2 = sigma_view_1;
304 cls_view_2 = cls_view_1;
309 Numeric d =
abs(grid_view_1[i] - grid_view_2[j]);
310 Numeric cl = 0.5 * (cls_view_1[i] + cls_view_2[j]);
311 return 1.0 - (1.0 - exp(-1.0)) * (d / cl);
315 Numeric d =
abs(grid_view_1[i] - grid_view_2[j]);
316 Numeric cl = 0.5 * (cls_view_1[i] + cls_view_2[j]);
321 Numeric d =
abs(grid_view_1[i] - grid_view_2[j]);
322 Numeric cl = 0.5 * (cls_view_1[i] + cls_view_2[j]);
331 row_indices.reserve(n * m);
332 column_indices.reserve(n * m);
336 if (fname ==
"exp") {
338 }
else if (fname ==
"lin") {
340 }
else if (fname ==
"gau") {
344 os << fname <<
" is not a known function name. Supported names"
345 <<
"are: exp, lin, gau.";
346 std::runtime_error(os.str());
349 for (
Index i = 0; i < m; ++i) {
350 for (
Index j = 0; j < n; ++j) {
353 row_indices.push_back(i);
354 column_indices.push_back(j);
359 Vector elements(row_indices.size());
360 for (
size_t i = 0; i < row_indices.size(); ++i) {
361 Index ii = row_indices[i];
362 Index jj = column_indices[i];
363 elements[i] = sigma_view_1[ii] * sigma_view_2[jj] * f(ii, jj);
396 template <
typename MatrixType>
402 Index m = block.nrows();
403 Index n = block.ncols();
406 if ((ii < 0) && (jj < 0)) {
412 throw std::runtime_error(
413 "The block must be on or above the diagonal, "
414 " i.e. *i* <= *j*.");
419 if ((ii >= ndiagblocks)) {
420 if (ii > ndiagblocks) {
422 throw std::runtime_error(
423 "Off-diagonal block can only be added to rows that already "
424 "have a block on the diagonal.");
426 throw std::runtime_error(
427 "Diagonal block must be added row-by-row starting in the "
428 " upper left of the matrix.");
434 throw std::runtime_error(
"Block already present in covariance matrix.");
439 throw std::runtime_error(
"Diagonal blocks must be square.");
443 std::shared_ptr<MatrixType> mat = std::make_shared<MatrixType>(block);
444 covmat_se.add_correlation(
Block(range, range, std::make_pair(ii, ii), mat));
449 throw std::runtime_error(
450 "Trying to add an off-diagonal block that"
451 " lacks corresponding diagonal block in the "
458 throw std::runtime_error(
459 "Trying to add an off-diagonal block that"
460 " lacks corresponding diagonal block in the "
466 throw std::runtime_error(
467 "The off-diagonal block is inconsistent "
468 "with the corresponding diagonal blocks.");
471 std::shared_ptr<MatrixType> mat = std::make_shared<MatrixType>(block);
473 Block(row_range, column_range, std::make_pair(ii, jj), mat));
489 template <
typename MatrixType>
496 if ((ii < 0) && (jj < 0)) {
501 Index m = inv_block.nrows();
502 Index n = inv_block.ncols();
507 throw std::runtime_error(
508 "Cannot add inverse block to the covariance "
509 " without corresponding non-inverse block.");
512 if ((m != inv_block.nrows()) || (n != inv_block.ncols())) {
513 throw std::runtime_error(
514 "Dimensions of block are inconsistent with "
515 " non-inverse block.");
521 std::shared_ptr<MatrixType> mat = std::make_shared<MatrixType>(inv_block);
523 Block(row_range, column_range, std::make_pair(ii, jj), mat));
538 template <
typename MatrixType>
540 Index m = block.nrows();
541 Index n = block.ncols();
544 throw std::runtime_error(
"Covariance matrix must be sqare!");
548 IndexPair indices = std::make_pair(0, 0);
550 std::shared_ptr<MatrixType> mat_ptr = std::make_shared<MatrixType>(block);
560 template <
typename MatrixType>
579 template <
typename MatrixType>
598 template <
typename MatrixType>
606 if ((ii < 0) && (jj < 0)) {
609 if ((ii >= jq.
nelem()) || (jj >= jq.
nelem())) {
611 "*covmat_sx* already contains more or as many diagonal"
612 " blocks as there are retrieval quantities.");
614 }
else if ((ii >= jq.
nelem()) || (jj >= jq.
nelem())) {
616 "The block indices must either be both -1 (default) or\n"
617 "non-negative and smaller than the number of retrieval \n"
619 }
else if (ii > jj) {
621 "Only blocks above the diagonal can be set, hence"
622 "*i* must be less than or equal to *j*.");
625 Index m = block.nrows();
626 Index n = block.ncols();
629 if (jq[ii].HasAffine()) {
630 jq_m = jq[ii].TransformationMatrix().ncols();
633 if (jq[jj].HasAffine()) {
634 jq_n = jq[jj].TransformationMatrix().ncols();
637 if ((m != jq_m) || (n != jq_n)) {
639 os <<
"The covariance block for retrieval quantities " << ii <<
" and "
640 << jj <<
" was expected to have dimensions [" << jq_m <<
", " << jq_n
641 <<
"] but found to have dimensions "
642 <<
"[" << m <<
", " << n <<
"].";
644 throw runtime_error(os.str());
650 Index row_start = ji[ii][0];
651 Index row_extent = ji[ii][1] - ji[ii][0] + 1;
652 Range row_range(row_start, row_extent);
654 Index col_start = ji[jj][0];
655 Index col_extent = ji[jj][1] - ji[jj][0] + 1;
656 Range col_range(col_start, col_extent);
658 std::shared_ptr<MatrixType> mat = make_shared<MatrixType>(block);
660 Block(row_range, col_range, std::make_pair(ii, jj), mat));
677 template <
typename MatrixType>
685 if ((ii < 0) && (jj < 0)) {
688 }
else if ((ii >= jq.
nelem()) || (jj >= jq.
nelem())) {
690 "The block indices must either be both -1 (default) or\n"
691 "non-negative and smaller than the number of retrieval \n"
693 }
else if (ii > jj) {
695 "Only blocks above the diagonal can be set, hence"
696 "*i* must be less than or equal to *j*.");
699 Index m = block_inv.nrows();
700 Index n = block_inv.ncols();
703 if (jq[ii].HasAffine()) {
704 jq_m = jq[ii].TransformationMatrix().ncols();
708 if (jq[jj].HasAffine()) {
709 jq_n = jq[jj].TransformationMatrix().ncols();
712 if (!((m == jq_m) && (n == jq_n))) {
714 os <<
"The dimensions of the covariance block ( " << m;
715 os <<
" x " << n <<
" )"
716 <<
" with the dimensionality of ";
717 os <<
" retrieval quantity " << ii <<
" and " << jj <<
", respectively.";
719 throw runtime_error(os.str());
724 "To add the inverse of a block the non-inverse"
725 " block must be added first.");
731 Index row_start = ji[ii][0];
732 Index row_extent = ji[ii][1] - ji[ii][0] + 1;
733 Range row_range(row_start, row_extent);
735 Index col_start = ji[jj][0];
736 Index col_extent = ji[jj][1] - ji[jj][0] + 1;
737 Range col_range(col_start, col_extent);
739 std::shared_ptr<MatrixType> mat = make_shared<MatrixType>(block_inv);
741 Block(row_range, col_range, std::make_pair(ii, jj), mat));
763 x_norm[i] =
sqrt(x_norm[i]);
782 const Vector& rq_lat_grid,
783 const Vector& rq_lon_grid,
786 const Index& for_species_tag,
853 const String& catalog_parameter,
900 const Vector& rq_lat_grid,
901 const Vector& rq_lon_grid,
934 const Index& poly_order,
964 const Index& poly_order,
965 const Index& no_pol_variation,
966 const Index& no_los_variation,
967 const Index& no_mblock_variation,
981 for (
Index i = 0; i <= poly_order; ++i) {
1002 const Vector& rq_lat_grid,
1003 const Vector& rq_lon_grid,
1037 const Vector& period_lengths,
1038 const Index& no_pol_variation,
1039 const Index& no_los_variation,
1040 const Index& no_mblock_variation,
1052 no_mblock_variation,
1054 for (
Index i = 0; i < period_lengths.
nelem(); ++i) {
1075 const Vector& rq_lat_grid,
1076 const Vector& rq_lon_grid,
1110 const Vector& rq_lat_grid,
1111 const Vector& rq_lon_grid,
1147 const Vector& rq_lat_grid,
1148 const Vector& rq_lon_grid,
1180 const Vector& rq_lat_grid,
1181 const Vector& rq_lon_grid,
1217 if (!
covmat_sx.has_diagonal_blocks(ji_t)) {
1218 std::ostringstream os;
1219 os <<
"*covmat_sx* does not contain a diagonal block for each retrieval"
1220 " quantity in the Jacobian.\n";
1221 os <<
" Fails test (!covmat_sx.has_diagonal_blocks(ji_t)) for ji_t " << ji_t
1223 throw runtime_error(os.str());
1226 throw runtime_error(
1227 "The blocks in *covmat_sx* are not consistent with the retrieval"
1228 " quantities in the Jacobian.");
1240 const Index& initialize_jacobian,
1242 if (initialize_jacobian == 1) {
1261 for (
Index i = 0; i < n_so; ++i) {
1266 for (
Index i = 0; i < n_ss; ++i) {
void covmat_sxAddBlock(CovarianceMatrix &covmat_sx, const ArrayOfRetrievalQuantity &jq, const MatrixType &block, const Index &i, const Index &j, const Verbosity &)
Index atmosphere_dim(Workspace &ws) noexcept
void retrievalAddMagField(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Sparse &covmat_block, const Sparse &covmat_inv_block, 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 &component, const Numeric &dB, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddMagField.
Matrix covmat_ss(Workspace &ws) noexcept
Matrix sensor_response_dlos_grid(Workspace &ws) noexcept
void retrievalAddPolyfit(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Sparse &covmat_block, const Sparse &covmat_inv_block, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Matrix &sensor_pos, const Index &poly_order, const Index &no_pol_variation, const Index &no_los_variation, const Index &no_mblock_variation, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddPolyfit.
Class to identify and match lines by their quantum numbers.
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
void covmat1DMarkov(MatrixType &block, MatrixType &block_inv, const Vector &grid, const Vector &sigma, const Numeric &lc, const Numeric &, const Verbosity &)
void retrievalAddSpecialSpecies(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Sparse &covmat_block, const Sparse &covmat_inv_block, 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 Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddSpecialSpecies.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
void jacobianAddBasicCatalogParameters(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfQuantumIdentifier &catalog_identities, const ArrayOfString &catalog_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameters.
void covmat_seAddInverseBlock(CovarianceMatrix &covmat_se, const MatrixType &inv_block, const Index &i, const Index &j, const Verbosity &)
Vector lat_grid(Workspace &ws) noexcept
Range get_column_range() const
void retrievalAddTemperature(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Sparse &covmat_block, const Sparse &covmat_inv_block, 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 Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddTemperature.
void retrievalDefInit(CovarianceMatrix &covmat_se, CovarianceMatrix &covmat_sx, Sparse &covmat_block, Sparse &covmat_inv_block, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Index &initialize_jacobian, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalDefInit.
Verbosity verbosity(Workspace &ws) noexcept
void covmat_sxSet(CovarianceMatrix &covmat, const MatrixType &block, const Verbosity &)
Index jacobian_do(Workspace &ws) noexcept
void retrievalAddSinefit(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Sparse &covmat_block, const Sparse &covmat_inv_block, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Matrix &sensor_pos, const Vector &period_lengths, const Index &no_pol_variation, const Index &no_los_variation, const Index &no_mblock_variation, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddSinefit.
invlib::Matrix< ArtsCovarianceMatrixWrapper > CovarianceMatrix
invlib wrapper type for ARTS the ARTS covariance class.
void PFromZSimple(Vector &p_grid, const Vector &z_grid, const Verbosity &)
WORKSPACE METHOD: PFromZSimple.
void insert_elements(MatrixType &matrix, Index, Index, const ArrayOfIndex &row_indices, const ArrayOfIndex &column_indices, const Vector &elements)
void add_scalar_variance(CovarianceMatrix &covmat, ArrayOfRetrievalQuantity &jacobian_quantities, Numeric var)
void jacobianAddSpecialSpecies(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, 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 Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddSpecialSpecies.
Header files of CovarianceMatrix class.
Numeric sqrt(const Rational r)
Square root.
void retrievalErrorsExtract(Vector &retrieval_eo, Vector &retrieval_ss, const Matrix &covmat_so, const Matrix &covmat_ss, const Verbosity &)
WORKSPACE METHOD: retrievalErrorsExtract.
This can be used to make arrays out of anything.
Numeric pow(const Rational base, Numeric exp)
Power of.
Matrix covmat_so(Workspace &ws) noexcept
void retrievalAddWind(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Sparse &covmat_block, const Sparse &covmat_inv_block, 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 &component, const Numeric &dfrequency, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddWind.
void retrievalAddPointingZa(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Sparse &covmat_block, const Sparse &covmat_inv_block, const Matrix &sensor_pos, const Vector &sensor_time, const Index &poly_order, const String &calcmode, const Numeric &dza, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddPointingZa.
void covmat1D(MatrixType &block, const Vector &grid1, const Vector &grid2, const Vector &sigma1, const Vector &sigma2, const Vector &lc1, const Vector &lc2, const Numeric &co, const String &fname, const Verbosity &)
Vector retrieval_eo(Workspace &ws) noexcept
void retrievalAddCatalogParameters(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Sparse &covmat_block, const Sparse &covmat_inv_block, const ArrayOfQuantumIdentifier &catalog_identities, const ArrayOfString &catalog_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddCatalogParameters.
void retrievalAddFreqStretch(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Sparse &covmat_block, const Sparse &covmat_inv_block, const Numeric &df, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddFreqStretch.
Vector sensor_time(Workspace &ws) noexcept
Index nelem() const
Returns the number of elements.
void add_correlation_inverse(Block c)
Add block inverse to covariance matrix.
Range get_row_range() const
Vector p_grid(Workspace &ws) noexcept
void ZFromPSimple(Vector &z_grid, const Vector &p_grid, const Verbosity &)
WORKSPACE METHOD: ZFromPSimple.
Sparse covmat_block(Workspace &ws) noexcept
void retrievalAddSurfaceQuantity(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Sparse &covmat_block, const Sparse &covmat_inv_block, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &quantity, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddSurfaceQuantity.
Routines for setting up the jacobian.
void jacobianAddFreqShift(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqShift.
NUMERIC Numeric
The type to use for all floating point numbers.
void add_correlation(Block c)
Add block to covariance matrix.
void jacobianAddSinefit(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Matrix &sensor_pos, const Vector &period_lengths, const Index &no_pol_variation, const Index &no_los_variation, const Index &no_mblock_variation, const Verbosity &)
WORKSPACE METHOD: jacobianAddSinefit.
CovarianceMatrix covmat_sx(Workspace &ws) noexcept
void covmat_sxAddInverseBlock(CovarianceMatrix &covmat_sx, const ArrayOfRetrievalQuantity &jq, const MatrixType &block_inv, const Index &i, const Index &j, const Verbosity &)
void jacobianClose(Workspace &ws, Index &jacobian_do, Agenda &jacobian_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianClose.
void var(VectorView var, const Vector &y, const ArrayOfVector &ys, const Index start=0, const Index end=-1)
Compute the variance of the ranged ys.
void jacobianInit(ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Verbosity &)
WORKSPACE METHOD: jacobianInit.
CovarianceMatrix covmat_se(Workspace &ws) noexcept
Vector f_grid(Workspace &ws) noexcept
Matrix sensor_pos(Workspace &ws) noexcept
Eigen::Matrix< Numeric, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixType
void jacobianAddPointingZa(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Matrix &sensor_pos, const Vector &sensor_time, const Index &poly_order, const String &calcmode, const Numeric &dza, const Verbosity &)
WORKSPACE METHOD: jacobianAddPointingZa.
void resize(Index r, Index c)
Resize function.
std::pair< Index, Index > IndexPair
Vector lon_grid(Workspace &ws) noexcept
void jacobianAddFreqStretch(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqStretch.
void jacobianAddAbsSpecies(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, 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 &mode, const Index &for_species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddAbsSpecies.
constexpr Index get_extent() const
Returns the extent of the range.
void setCovarianceMatrix(CovarianceMatrix &covmat, const MatrixType &block)
void jacobianAddTemperature(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, 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 Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddTemperature.
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
void jacobianAddBasicCatalogParameter(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const QuantumIdentifier &catalog_identity, const String &catalog_parameter, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameter.
ArrayOfIndex sensor_response_pol_grid(Workspace &ws) noexcept
void jacobianAddSurfaceQuantity(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &quantity, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddSurfaceQuantity.
void retrievalAddFreqShift(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Sparse &covmat_block, const Sparse &covmat_inv_block, const Vector &f_grid, const Numeric &df, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddFreqShift.
void check_and_add_block(CovarianceMatrix &covmat, const RetrievalQuantity &jq, const Index rq_index, const Index grid_dimensions, const Sparse &covmat_block, const Sparse &covmat_inv_block)
constexpr Rational start(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the lowest M for a polarization type of this transition.
void retrievalDefClose(Workspace &ws, Index &jacobian_do, Agenda &jacobian_agenda, Index &retrieval_checked, const CovarianceMatrix &covmat_sx, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalDefClose.
void retrievalAddAbsSpecies(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Sparse &covmat_block, const Sparse &covmat_inv_block, 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 &mode, const Index &for_species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddAbsSpecies.
bool empty() const
Returns true if variable size is zero.
void jacobianAddWind(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, 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 &component, const Numeric &dfrequency, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddWind.
void retrievalAddCatalogParameter(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const QuantumIdentifier &catalog_identity, const String &catalog_parameter, const Numeric &var, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddCatalogParameter.
void jacobianAddMagField(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, 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 &component, const Numeric &dB, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddMagField.
void jacobianAddScatSpecies(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, 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 &quantity, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddScatSpecies.
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
void covmat_sxExtractSqrtDiagonal(Vector &x_norm, const CovarianceMatrix &covmat_sx, const Verbosity &)
WORKSPACE METHOD: covmat_sxExtractSqrtDiagonal.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Index retrieval_checked(Workspace &ws) noexcept
Vector retrieval_ss(Workspace &ws) noexcept
void retrievalAddScatSpecies(Workspace &ws, CovarianceMatrix &covmat_sx, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Sparse &covmat_block, const Sparse &covmat_inv_block, 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 &quantity, const Verbosity &verbosity)
WORKSPACE METHOD: retrievalAddScatSpecies.
Agenda jacobian_agenda(Workspace &ws) noexcept
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.
A constant view of a Vector.
Index nelem() const
Number of elements.
void jacobianAddPolyfit(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Matrix &sensor_pos, const Index &poly_order, const Index &no_pol_variation, const Index &no_los_variation, const Index &no_mblock_variation, const Verbosity &)
WORKSPACE METHOD: jacobianAddPolyfit.
Sparse covmat_inv_block(Workspace &ws) noexcept
void covmatDiagonal(MatrixType &block, MatrixType &block_inv, const Vector &vars, const Verbosity &)
void covmat_seAddBlock(CovarianceMatrix &covmat_se, const MatrixType &block, const Index &i, const Index &j, const Verbosity &)
void covmat_seSet(CovarianceMatrix &covmat, const MatrixType &block, const Verbosity &)