73 if (jacobian_quantities.empty())
75 "No retrieval quantities has been added to *jacobian_quantities*.");
77 jacobian_agenda.
check(ws_in, verbosity);
86 jacobian_quantities.resize(0);
87 jacobian_agenda =
Agenda{ws};
88 jacobian_agenda.
set_name(
"jacobian_agenda");
98 jacobianInit(ws, jacobian_quantities, jacobian_agenda, verbosity);
109 const Index& atmosphere_dim,
114 const Vector& rq_lat_grid,
115 const Vector& rq_lon_grid,
118 const Index& for_species_tag,
124 if (not for_species_tag) {
126 if (test.
nelem() not_eq 1)
127 throw std::runtime_error(
128 "Trying to add a species as a species tag of multiple species.\n"
129 "This is not supported. Please give just a single species instead.\n"
130 "Otherwise consider if you intended for_species_tag to be evaluated true.\n");
136 ARTS_USER_ERROR_IF (jq[it] == Jacobian::Special::ArrayOfSpeciesTagVMR && jq[it].Subtag() == species,
137 "The gas species:\n", species,
"\nis already included in *jacobian_quantities*.")
139 "The atmospheric species of:\n", species,
"\nis already included in *jacobian_quantities*\n"
156 "retrieval pressure grid",
157 "retrieval latitude grid",
158 "retrievallongitude_grid",
160 throw runtime_error(os.str());
164 if (mode !=
"vmr" && mode !=
"nd" && mode !=
"rel" && mode !=
"rh" &&
167 "The retrieval mode can only be \"vmr\", \"nd\", "
168 "\"rel\", \"rh\" or \"q\".");
170 if ((mode ==
"rh" || mode ==
"q") && species.substr(0, 3) !=
"H2O") {
172 "Retrieval modes \"rh\" and \"q\" can only be applied "
173 "on species starting with H2O.");
181 if (for_species_tag == 0) {
192 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
207 for (
Index it = 0; it < jacobian_quantities.
nelem(); it++) {
208 if (jacobian_quantities[it] == Jacobian::Sensor::FrequencyShift) {
210 os <<
"Fit of frequency shift is already included in\n"
211 <<
"*jacobian_quantities*.";
212 throw runtime_error(os.str());
217 if (df <= 0)
throw runtime_error(
"The argument *df* must be > 0.");
219 throw runtime_error(
"The argument *df* is not allowed to exceed 1 MHz.");
223 "Frequency shifts and *f_grid* of length 1 can "
225 const Numeric maxdf = f_grid[nf - 1] - f_grid[nf - 2];
228 os <<
"The value of *df* is too big with respect to spacing of "
229 <<
"*f_grid*. The maximum\nallowed value of *df* is the spacing "
230 <<
"between the two last elements of *f_grid*.\n"
231 <<
"This spacing is : " << maxdf / 1e3 <<
" kHz\n"
232 <<
"The value of df is: " << df / 1e3 <<
" kHz";
233 throw runtime_error(os.str());
248 jacobian_quantities.push_back(rq);
251 jacobian_agenda.
append(
"jacobianCalcFreqShift",
"");
256 const Index& mblock_index,
259 const Index& stokes_dim,
261 const Matrix& mblock_dlos,
262 const Sparse& sensor_response,
272 for (
Index n = 0; n < jacobian_quantities.
nelem() && !found; n++) {
273 if (jacobian_quantities[n] == Jacobian::Sensor::FrequencyShift) {
277 jacobian_indices, any_affine, jacobian_quantities,
true);
280 rq = jacobian_quantities[n];
281 ji = jacobian_indices[n];
286 "There is no such frequency retrieval quantity defined.\n");
292 throw runtime_error(
"Mismatch in size between *sensor_response* and *yb*.");
295 "Mismatch in size between *sensor_response* and *iyb*.");
304 const Index niyb = nf2 * nlos2 * stokes_dim;
308 constexpr Index porder = 3;
310 Vector fg_new = f_grid, iyb2(niyb);
313 const auto lag = Interpolation::FixedLagrangeVector<porder>(fg_new, f_grid);
317 for (
Index ilos = 0; ilos < nlos2; ilos++) {
318 const Index row0 = ilos * nf2 * stokes_dim;
320 for (
Index is = 0; is < stokes_dim; is++) {
321 iyb2[
Range(row0 + is, nf2, stokes_dim)] = reinterp(iyb[
Range(row0 + is, nf2, stokes_dim)], itw, lag);
327 mult(dy, sensor_response, iyb2);
329 for (
Index i = 0; i < n1y; i++) {
337 jacobian(rowind, ji[0]) = dy;
352 for (
Index it = 0; it < jacobian_quantities.
nelem(); it++) {
353 if (jacobian_quantities[it] == Jacobian::Sensor::FrequencyStretch) {
355 os <<
"Fit of frequency stretch is already included in\n"
356 <<
"*jacobian_quantities*.";
357 throw runtime_error(os.str());
362 if (df <= 0)
throw runtime_error(
"The argument *df* must be > 0.");
364 throw runtime_error(
"The argument *df* is not allowed to exceed 1 MHz.");
366 const Numeric maxdf = f_grid[nf - 1] - f_grid[nf - 2];
369 os <<
"The value of *df* is too big with respect to spacing of "
370 <<
"*f_grid*. The maximum\nallowed value of *df* is the spacing "
371 <<
"between the two last elements of *f_grid*.\n"
372 <<
"This spacing is : " << maxdf / 1e3 <<
" kHz\n"
373 <<
"The value of df is: " << df / 1e3 <<
" kHz";
374 throw runtime_error(os.str());
389 jacobian_quantities.push_back(rq);
392 jacobian_agenda.
append(
"jacobianCalcFreqStretch",
"");
398 const Index& mblock_index,
401 const Index& stokes_dim,
403 const Matrix& mblock_dlos,
404 const Sparse& sensor_response,
406 const Vector& sensor_response_f_grid,
407 const Matrix& sensor_response_dlos_grid,
420 for (
Index n = 0; n < jacobian_quantities.
nelem() && !found; n++) {
421 if (jacobian_quantities[n] == Jacobian::Sensor::FrequencyStretch) {
425 jacobian_indices, any_affine, jacobian_quantities,
true);
428 rq = jacobian_quantities[n];
429 ji = jacobian_indices[n];
434 "There is no such frequency retrieval quantity defined.\n");
440 throw runtime_error(
"Mismatch in size between *sensor_response* and *yb*.");
443 "Mismatch in size between *sensor_response* and *iyb*.");
452 const Index niyb = nf2 * nlos2 * stokes_dim;
456 constexpr Index porder = 3;
458 Vector fg_new = f_grid, iyb2(niyb);
462 const auto lag = Interpolation::FixedLagrangeVector<porder>(fg_new, f_grid);
466 for (
Index ilos = 0; ilos < nlos2; ilos++) {
467 const Index row0 = ilos * nf2 * stokes_dim;
469 for (
Index is = 0; is < stokes_dim; is++) {
470 iyb2[
Range(row0 + is, nf2, stokes_dim)] = reinterp(iyb[
Range(row0 + is, nf2, stokes_dim)], itw, lag);
476 mult(dy, sensor_response, iyb2);
478 for (
Index i = 0; i < n1y; i++) {
487 const Index nf = sensor_response_f_grid.
nelem();
488 const Index npol = sensor_response_pol_grid.
nelem();
489 const Index nlos = sensor_response_dlos_grid.
nrows();
491 for (
Index l = 0; l < nlos; l++) {
492 for (
Index f = 0; f < nf; f++) {
493 const Index row1 = (l * nf + f) * npol;
494 for (
Index p = 0; p < npol; p++) {
495 dy[row1 + p] *=
w[f];
504 jacobian(rowind, ji[0]) = dy;
517 const Index& poly_order,
524 "The polynomial order has to be positive or -1 for gitter.");
527 for (
Index it = 0; it < jacobian_quantities.
nelem(); it++) {
528 if (jacobian_quantities[it].Target().isPointing()) {
530 os <<
"Fit of zenith angle pointing off-set is already included in\n"
531 <<
"*jacobian_quantities*.";
532 throw runtime_error(os.str());
537 if (dza <= 0)
throw runtime_error(
"The argument *dza* must be > 0.");
539 throw runtime_error(
"The argument *dza* is not allowed to exceed 0.1 deg.");
542 if (sensor_time.
nelem() != sensor_pos.
nrows()) {
544 os <<
"The WSV *sensor_time* must be defined for every "
545 <<
"measurement block.\n";
546 throw runtime_error(os.str());
550 if (poly_order > sensor_time.
nelem() - 1) {
552 "The polynomial order can not be >= length of *sensor_time*.");
557 if (calcmode ==
"recalc") {
559 jacobian_agenda.
append(
"jacobianCalcPointingZaRecalc",
"");
560 }
else if (calcmode ==
"interp") {
562 jacobian_agenda.
append(
"jacobianCalcPointingZaInterp",
"");
565 R
"(Possible choices for *calcmode* are "recalc" and "interp".)");
571 Vector grid(0, poly_order + 1, 1);
572 if (poly_order == -1) {
580 jacobian_quantities.push_back(rq);
586 const Index& mblock_index,
589 const Index& stokes_dim,
592 const Matrix& mblock_dlos,
593 const Sparse& sensor_response,
597 if (mblock_dlos.
nrows() < 2)
599 "The method demands that *mblock_dlos* has "
600 "more than one row.");
605 "The method demands that the zenith angles in "
606 "*mblock_dlos* are sorted (increasing or decreasing).");
615 for (
Index n = 0; n < jacobian_quantities.
nelem() && !found; n++) {
616 if (jacobian_quantities[n] == Jacobian::Sensor::PointingZenithInterp) {
620 jacobian_indices, any_affine, jacobian_quantities,
true);
623 rq = jacobian_quantities[n];
624 ji = jacobian_indices[n];
629 "There is no such pointing retrieval quantity defined.\n");
650 gp1, mblock_dlos(
joker, 0), za1, 1e6);
652 gp2, mblock_dlos(
joker, 0), za2, 1e6);
653 Matrix itw1(nza, 2), itw2(nza, 2);
661 for (
Index iza = 0; iza < nza; iza++) {
662 for (
Index iv = 0; iv < nf; iv++) {
663 for (
Index is = 0; is < stokes_dim; is++) {
664 const Range r(iv * stokes_dim + is, nza, nf * stokes_dim);
665 interp(iyb1[r], itw1, iyb[r], gp1);
666 interp(iyb2[r], itw2, iyb[r], gp2);
674 mult(y1, sensor_response, iyb1);
675 mult(y2, sensor_response, iyb2);
677 for (
Index i = 0; i < n1y; i++) {
685 const Index it = ji[0];
690 if (rq.
Grids()[0][0] == -1)
694 jacobian(rowind, it + mblock_index) = dy;
705 for (
Index i = 0; i < n1y; i++) {
706 jacobian(row0 + i, it +
c) =
w[mblock_index] * dy[i];
716 const Index& mblock_index,
719 const Index& atmosphere_dim,
721 const Index& cloudbox_on,
722 const Index& stokes_dim,
726 const Matrix& transmitter_pos,
727 const Matrix& mblock_dlos,
728 const Sparse& sensor_response,
731 const Agenda& iy_main_agenda,
741 for (
Index n = 0; n < jacobian_quantities.
nelem() && !found; n++) {
742 if (jacobian_quantities[n] == Jacobian::Sensor::PointingZenithRecalc) {
746 jacobian_indices, any_affine, jacobian_quantities,
true);
749 rq = jacobian_quantities[n];
750 ji = jacobian_indices[n];
755 "There is no such pointing retrieval quantity defined.\n");
796 mult(dy, sensor_response, iyb2);
798 for (
Index i = 0; i < n1y; i++) {
806 const Index it = ji[0];
811 if (rq.
Grids()[0][0] == -1)
815 jacobian(rowind, it + mblock_index) = dy;
826 for (
Index i = 0; i < n1y; i++) {
827 jacobian(row0 + i, it +
c) =
w[mblock_index] * dy[i];
842 const Matrix& sensor_response_dlos_grid,
844 const Index& poly_order,
845 const Index& no_pol_variation,
846 const Index& no_los_variation,
847 const Index& no_mblock_variation,
851 throw runtime_error(
"The polynomial order has to be >= 0.");
855 if (jq[it] == Jacobian::Sensor::Polyfit) {
857 os <<
"Polynomial baseline fit is already included in\n"
858 <<
"*jacobian_quantities*.";
859 throw runtime_error(os.str());
873 if (no_pol_variation)
876 grids[1] =
Vector(0, sensor_response_pol_grid.
nelem(), 1);
877 if (no_los_variation)
880 grids[2] =
Vector(0, sensor_response_dlos_grid.
nrows(), 1);
881 if (no_mblock_variation)
894 for (
Index i = 0; i <= poly_order; i++) {
896 sstr <<
"Coefficient " << i;
907 jacobian_agenda.
append(
"jacobianCalcPolyfit", i);
913 const Index& mblock_index,
916 const Sparse& sensor_response,
918 const Vector& sensor_response_f_grid,
919 const Matrix& sensor_response_dlos_grid,
921 const Index& poly_coeff,
929 sstr <<
"Coefficient " << poly_coeff;
930 for (iq = 0; iq < jacobian_quantities.
nelem() && !found; iq++) {
931 if (jacobian_quantities[iq] == Jacobian::Sensor::Polyfit &&
932 jacobian_quantities[iq].Subtag() == sstr.str()) {
939 "There is no Polyfit jacobian defined, in general "
940 "or for the selected polynomial coefficient.\n");
945 const Index nf = sensor_response_f_grid.
nelem();
946 const Index npol = sensor_response_pol_grid.
nelem();
947 const Index nlos = sensor_response_dlos_grid.
nrows();
969 Index col4 = jacobian_indices[iq][0];
972 col4 += mblock_index * n2 * n1;
975 for (
Index l = 0; l < nlos; l++) {
976 const Index row3 = row4 + l * nf * npol;
977 const Index col3 = col4 + l * n1;
979 for (
Index f = 0; f < nf; f++) {
980 const Index row2 = row3 + f * npol;
982 for (
Index p = 0; p < npol; p++) {
988 jacobian(row2 + p, col1) =
w[f];
1002 const Index& atmosphere_dim,
1007 const Vector& rq_lat_grid,
1008 const Vector& rq_lon_grid,
1018 if (jq[it] == Jacobian::Special::ScatteringString && jq[it].Subtag() == species &&
1019 jq[it].SubSubtag() == quantity) {
1021 os <<
"The combintaion of\n scattering species: " << species
1022 <<
"\n retrieval quantity: " << quantity
1023 <<
"\nis already included in *jacobian_quantities*.";
1024 throw runtime_error(os.str());
1041 "retrieval pressure grid",
1042 "retrieval latitude grid",
1043 "retrievallongitude_grid",
1045 throw runtime_error(os.str());
1058 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1070 const Matrix& sensor_response_dlos_grid,
1071 const Matrix& sensor_pos,
1072 const Vector& period_lengths,
1073 const Index& no_pol_variation,
1074 const Index& no_los_variation,
1075 const Index& no_mblock_variation,
1080 if (np == 0)
throw runtime_error(
"No sinusoidal periods has benn given.");
1084 if (jq[it] == Jacobian::Sensor::Sinefit) {
1086 os <<
"Polynomial baseline fit is already included in\n"
1087 <<
"*jacobian_quantities*.";
1088 throw runtime_error(os.str());
1102 if (no_pol_variation)
1105 grids[1] =
Vector(0, sensor_response_pol_grid.
nelem(), 1);
1106 if (no_los_variation)
1109 grids[2] =
Vector(0, sensor_response_dlos_grid.
nrows(), 1);
1110 if (no_mblock_variation)
1123 for (
Index i = 0; i < np; i++) {
1125 sstr <<
"Period " << i;
1129 grids[0] =
Vector(2, period_lengths[i]);
1136 jacobian_agenda.
append(
"jacobianCalcSinefit", i);
1142 const Index& mblock_index,
1145 const Sparse& sensor_response,
1147 const Vector& sensor_response_f_grid,
1148 const Matrix& sensor_response_dlos_grid,
1150 const Index& period_index,
1158 sstr <<
"Period " << period_index;
1159 for (iq = 0; iq < jacobian_quantities.
nelem() && !found; iq++) {
1160 if (jacobian_quantities[iq] == Jacobian::Sensor::Sinefit &&
1161 jacobian_quantities[iq].Subtag() == sstr.str()) {
1167 throw runtime_error(
1168 "There is no Sinefit jacobian defined, in general "
1169 "or for the selected period length.\n");
1174 const Index nf = sensor_response_f_grid.
nelem();
1175 const Index npol = sensor_response_pol_grid.
nelem();
1176 const Index nlos = sensor_response_dlos_grid.
nrows();
1185 for (
Index f = 0; f < nf; f++) {
1186 Numeric a = (sensor_response_f_grid[f] - sensor_response_f_grid[0]) *
1205 Index col4 = jacobian_indices[iq][0];
1208 col4 += mblock_index * n2 * n1 * 2;
1211 for (
Index l = 0; l < nlos; l++) {
1212 const Index row3 = row4 + l * nf * npol;
1213 const Index col3 = col4 + l * n1 * 2;
1215 for (
Index f = 0; f < nf; f++) {
1216 const Index row2 = row3 + f * npol;
1218 for (
Index p = 0; p < npol; p++) {
1224 jacobian(row2 + p, col1) = s[f];
1225 jacobian(row2 + p, col1 + 1) =
c[f];
1239 const Index& atmosphere_dim,
1242 const Vector& rq_lat_grid,
1243 const Vector& rq_lon_grid,
1251 if (jq[it] == Jacobian::Special::SurfaceString && jq[it].Subtag() == quantity) {
1253 os << quantity <<
" is already included as a surface variable "
1254 <<
"in *jacobian_quantities*.";
1255 throw runtime_error(os.str());
1270 "retrieval latitude grid",
1271 "retrievallongitude_grid",
1273 throw runtime_error(os.str());
1286 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1297 const Index& atmosphere_dim,
1302 const Vector& rq_lat_grid,
1303 const Vector& rq_lon_grid,
1311 if (jq[it] == Jacobian::Atm::Temperature) {
1313 os <<
"Temperature is already included in *jacobian_quantities*.";
1314 throw runtime_error(os.str());
1331 "retrieval pressure grid",
1332 "retrieval latitude grid",
1333 "retrievallongitude_grid",
1335 throw runtime_error(os.str());
1342 }
else if (hse ==
"off") {
1346 os <<
"The keyword for hydrostatic equilibrium can only be set to\n"
1347 <<
"\"on\" or \"off\"\n";
1348 throw runtime_error(os.str());
1361 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1372 const Index& atmosphere_dim,
1377 const Vector& rq_lat_grid,
1378 const Vector& rq_lon_grid,
1386 const auto opt = Options::toWindMagJacobianOrThrow(component);
1389 case Options::WindMagJacobian::u:
1392 case Options::WindMagJacobian::v:
1395 case Options::WindMagJacobian::w:
1398 case Options::WindMagJacobian::strength:
1401 case Options::WindMagJacobian::FINAL:
1402 ARTS_ASSERT(
false,
"This error should be caught earlier")
1408 "The wind component:\n", component,
"\n"
1409 "is already included in *jacobian_quantities*.")
1425 "retrieval pressure grid",
1426 "retrieval latitude grid",
1427 "retrievallongitude_grid",
1429 throw runtime_error(os.str());
1439 out3 <<
" Calculations done by propagation matrix expression.\n";
1440 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1451 const Index& atmosphere_dim,
1456 const Vector& rq_lat_grid,
1457 const Vector& rq_lon_grid,
1465 const auto opt = Options::toWindMagJacobianOrThrow(component);
1468 case Options::WindMagJacobian::u:
1471 case Options::WindMagJacobian::v:
1474 case Options::WindMagJacobian::w:
1477 case Options::WindMagJacobian::strength:
1480 case Options::WindMagJacobian::FINAL:
1481 ARTS_ASSERT(
false,
"This error should be caught earlier")
1487 "The magnetic component:\n", component,
"\n"
1488 "is already included in *jacobian_quantities*.")
1504 "retrieval pressure grid",
1505 "retrieval latitude grid",
1506 "retrievallongitude_grid",
1508 throw runtime_error(os.str());
1518 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1532 const String& coefficient,
1538 out3 <<
"Attempting to create RT tag for " << line_identity <<
" " << variable
1539 <<
" " << coefficient <<
" for ";
1558 if (q.HasSameInternalsAs(rq))
1559 throw std::runtime_error(
"Error with copies of the quantities");
1563 out3 <<
"Creation was successful!\n";
1564 jacobian_agenda.
append(
"jacobianCalcDoNothing",
1578 if (not(line_identities.
nelem() or species.
nelem() or variables.
nelem() or
1579 coefficients.
nelem()))
1580 throw std::runtime_error(
"Must have at least 1-long lists for all GINs");
1583 if (variables[0] ==
"ALL")
1589 if (coefficients[0] ==
"ALL")
1590 coeffs =
ArrayOfString(Options::enumstrs::LineShapeCoeffNames);
1592 coeffs = coefficients;
1594 for (
auto& l : line_identities)
1595 for (
auto& s : species)
1596 for (
auto&
v : vars)
1597 for (
auto&
c : coeffs)
1599 ws, jq, jacobian_agenda, l, s,
v,
c, verbosity);
1607 const String& catalog_parameter,
1612 const auto opt = Options::toBasicCatParamJacobianOrThrow(catalog_parameter);
1615 case Options::BasicCatParamJacobian::LineCenter:
1618 case Options::BasicCatParamJacobian::LineStrength:
1621 case Options::BasicCatParamJacobian::FINAL:
1622 ARTS_ASSERT(
false,
"This error should be caught earlier")
1628 "The catalog identifier:\n",
1629 catalog_identity,
" for ID: ", catalog_identity,
"\n"
1630 "is already included in jacobian_quantities*.")
1638 out3 <<
" Calculations done by propagation matrix expressions.\n";
1640 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1653 out2 <<
" Adding " << catalog_identities.
nelem() * catalog_parameters.
nelem()
1654 <<
" expression(s) to the Jacobian calculations.\n";
1656 for (
auto& qi : catalog_identities)
1657 for (
auto& param : catalog_parameters)
1659 ws, jq, jacobian_agenda, qi, param, verbosity);
1670 const Index& atmosphere_dim,
1675 const Vector& rq_lat_grid,
1676 const Vector& rq_lon_grid,
1684 if (jq[it] == Jacobian::Line::NLTE and
1685 jq[it].QuantumIdentity() == energy_level_identity) {
1687 os <<
"The NLTE identifier:\n"
1688 << energy_level_identity <<
"\nis already included in "
1689 <<
"*jacobian_quantities*.";
1690 throw std::runtime_error(os.str());
1707 "retrieval pressure grid",
1708 "retrieval latitude grid",
1709 "retrievallongitude_grid",
1711 throw runtime_error(os.str());
1723 out3 <<
" Calculations done by propagation matrix expressions.\n";
1725 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1731 const Index& atmosphere_dim,
1736 const Vector& rq_lat_grid,
1737 const Vector& rq_lon_grid,
1741 for (
const auto& qi : energy_level_identities)
1761 const Index& atmosphere_dim,
1766 const Vector& rq_lat_grid,
1767 const Vector& rq_lon_grid,
1786 "retrieval pressure grid",
1787 "retrieval latitude grid",
1788 "retrievallongitude_grid",
1790 throw runtime_error(os.str());
1798 if (species ==
"electrons") {
1800 if (jq[it] == Jacobian::Atm::Electrons) {
1802 os <<
"Electrons are already included in *jacobian_quantities*.";
1803 throw std::runtime_error(os.str());
1808 }
else if (species ==
"particulates") {
1810 if (jq[it] == Jacobian::Atm::Particulates) {
1812 os <<
"Particulates are already included in *jacobian_quantities*.";
1813 throw std::runtime_error(os.str());
1820 os <<
"Unknown special species jacobian: \"" << species
1821 <<
"\"\nPlease see *jacobianAddSpecialSpecies* for viable options.";
1822 throw std::runtime_error(os.str());
1828 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1843 if (jacobian.
empty()) {
1851 bool vars_init =
false;
1855 for (
Index q = 0; q < jacobian_quantities.
nelem(); q++) {
1856 if (jacobian_quantities[q].Target().isSpeciesVMR() &&
1857 jacobian_quantities[q].Mode() ==
"rel") {
1865 for (
Index i = jis0[q][0]; i <= jis0[q][1]; i++) {
1867 jacobian(
joker, i) /= x[i];
1879 const Matrix& transformation_matrix,
1880 const Vector& offset_vector,
1885 "Jacobian quantities is empty, so there is nothing to add the "
1886 "transformation to.");
1891 if (!(nelem == transformation_matrix.
nrows())) {
1893 "Dimension of transformation matrix incompatible with retrieval grids.");
1895 if (!(nelem == offset_vector.
nelem())) {
1897 "Dimension of offset vector incompatible with retrieval grids.");
1900 jqs.back().SetTransformationMatrix(
transpose(transformation_matrix));
1901 jqs.back().SetOffsetVector(offset_vector);
1906 const String& transformation_func,
1912 throw runtime_error(
1913 "Jacobian quantities is empty, so there is nothing to add the "
1914 "transformation to.");
1916 if (transformation_func ==
"none") {
1917 jqs.back().SetTransformationFunc(
"");
1923 if (transformation_func ==
"atanh") {
1925 throw runtime_error(
1926 "For option atanh, the GIN *z_max* must be set and be > z_min.");
1930 }
else if (transformation_func ==
"log" || transformation_func ==
"log10") {
1935 os <<
"Valid options for *transformation_func* are:\n"
1936 <<
"\"none\", \"log\", \"log10\" and \"atanh\"\n"
1937 <<
"But found: \"" << transformation_func <<
"\"";
1938 throw runtime_error(os.str());
1941 jqs.back().SetTransformationFunc(transformation_func);
1942 jqs.back().SetTFuncParameters(pars);
1951 const Index& atmosphere_dim,
1955 const Tensor3& original_field,
1956 const Vector& p_ret_grid,
1957 const Vector& lat_ret_grid,
1958 const Vector& lon_ret_grid,
1959 const Index& pert_index,
1974 ret_grids[0] = p_ret_grid;
1975 if (atmosphere_dim>1){
1976 ret_grids[1] = lat_ret_grid;
1977 if (atmosphere_dim>2){
1978 ret_grids[2] = lon_ret_grid;
1984 Index n_p, n_lat, n_lon;
1999 throw runtime_error(
"Bad *pert_index*. It is negative.");
2001 const Index n_tot = n_p * n_lat * n_lon;
2002 if (pert_index >= n_tot){
2003 throw runtime_error(
"Bad *pert_index*. It is too high with respect "
2004 "to length of retrieval grids.");
2009 if (pert_mode ==
"absolute" ){
2011 x[pert_index] = pert_size;
2013 else if (pert_mode ==
"relative" ){
2015 x[pert_index] += pert_size;
2018 throw runtime_error(
"Bad *pert_mode*. Allowed choices are: "
2019 """absolute"" and ""relative"".");
2023 Tensor3 x3d(n_p, n_lat, n_lon), pert(n_p, n_lat, n_lon);
2028 if (&perturbed_field != &original_field) {
2029 perturbed_field = original_field;
2033 if (pert_mode ==
"absolute" ){
2034 perturbed_field += pert;
2037 perturbed_field *= pert;
2043 const Index& atmosphere_dim,
2047 const Tensor3& original_field,
2048 const Index& pert_index,
2054 const Index n_lat = atmosphere_dim<2 ? 1 : lat_grid.
nelem();
2055 const Index n_lon = atmosphere_dim<3 ? 1 : lon_grid.
nelem();
2066 throw runtime_error(
"Bad *pert_index*. It is negative.");
2068 if (pert_index >= n_p * n_lat * n_lon){
2069 throw runtime_error(
"Bad *pert_index*. It is too high with respect "
2070 "to length of atmospheric grids.");
2074 Index tot_index = pert_index;
2075 const Index lon_index = atmosphere_dim<3 ? 0 : tot_index / (n_lat * n_p);
2076 tot_index -= lon_index * n_lat * n_p;
2077 const Index lat_index = atmosphere_dim<2 ? 0 : tot_index / n_p;
2078 tot_index -= lat_index * n_p;
2079 const Index p_index = tot_index;
2082 if (&perturbed_field != &original_field) {
2083 perturbed_field = original_field;
2087 if (pert_mode ==
"absolute" ){
2088 perturbed_field(p_index,
2089 atmosphere_dim>1 ? lat_index : 0,
2090 atmosphere_dim>2 ? lon_index : 0) += pert_size;
2092 else if (pert_mode ==
"relative"){
2093 perturbed_field(p_index,
2094 atmosphere_dim>1 ? lat_index : 0,
2095 atmosphere_dim>2 ? lon_index : 0) *= 1 + pert_size;
2098 throw runtime_error(
"Bad *pert_mode*. Allowed choices are: "
2099 """absolute"" and ""relative"".");
2105 const Index& atmosphere_dim,
2111 const Index n_lat = atmosphere_dim<2 ? 1 : lat_grid.
nelem();
2112 const Index n_lon = atmosphere_dim<3 ? 1 : lon_grid.
nelem();
2114 n = n_p * n_lat * n_lon;
2124 if( y_pert.
nelem() != n ){
2125 throw runtime_error(
"Inconsistency in length of *y_pert* and *y*.");
2129 jacobian /= pert_size;
2141 if( ybatch[0].nelem() != n )
2142 throw runtime_error(
"Inconsistency in length of y and ybatch[0].");
2145 for (
Index i=0; i<l; i++) {
2146 jacobian(
joker,i) = ybatch[i];
2147 jacobian(
joker,i) -= y;
2149 jacobian /= pert_size;
2154 const Index& atmosphere_dim,
2159 const String& particle_type,
2160 const Vector& p_ret_grid,
2161 const Vector& lat_ret_grid,
2162 const Vector& lon_ret_grid,
2163 const Index& pert_index,
2171 os <<
"Could not find " << particle_type <<
" in *particle_bulkprop_names*.\n";
2172 throw std::runtime_error(os.str());
2175 Tensor3 original_field, perturbed_field;
2195 const Index& atmosphere_dim,
2200 const String& particle_type,
2201 const Index& pert_index,
2209 os <<
"Could not find " << particle_type <<
" in *particle_bulkprop_names*.\n";
2210 throw std::runtime_error(os.str());
2213 Tensor3 original_field, perturbed_field;
2230 const Index& atmosphere_dim,
2236 const Vector& p_ret_grid,
2237 const Vector& lat_ret_grid,
2238 const Vector& lon_ret_grid,
2239 const Index& pert_index,
2245 for (
Index i = 0; i < abs_species.
nelem(); i++) {
2253 os <<
"Could not find " << species <<
" in *abs_species*.\n";
2254 throw std::runtime_error(os.str());
2257 Tensor3 original_field, perturbed_field;
2277 const Index& atmosphere_dim,
2283 const Index& pert_index,
2289 for (
Index i = 0; i < abs_species.
nelem(); i++) {
2297 os <<
"Could not find " << species <<
" in *abs_species*.\n";
2298 throw std::runtime_error(os.str());
2301 Tensor3 original_field, perturbed_field;
Declarations required for the calculation of absorption coefficients.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
base max(const Array< base > &x)
Max function.
Array< ArrayOfIndex > ArrayOfArrayOfIndex
The global header file for ARTS.
Vector time_vector(const ArrayOfTime ×)
Converts from each Time to seconds and returns as Vector.
void append(const String &methodname, const TokVal &keywordvalue)
Appends methods to an agenda.
void check(Workspace &ws_in, const Verbosity &verbosity)
Checks consistency of an agenda.
void set_name(const String &nname)
Set agenda name.
This can be used to make arrays out of anything.
Index nelem() const ARTS_NOEXCEPT
bool empty() const noexcept
Index nrows() const noexcept
Index nelem() const noexcept
Returns the number of elements.
void resize(Index r, Index c)
Resize function.
constexpr Index get_start() const noexcept
Returns the start index of the range.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
const String & Mode() const
Returns the mode.
Jacobian::Target & Target()
Get the Jacobian Target.
const String & SubSubtag() const
Returns the sub-sub-tag.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
const String & Subtag() const
Returns the sub-tag.
void resize(Index n)
Resize function.
Internal cloudbox functions.
void mult(MatrixView C, ConstMatrixView A, const Block &B)
#define ARTS_ASSERT(condition,...)
#define ARTS_USER_ERROR_IF(condition,...)
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
void transform_jacobian(Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs)
Applies both functional and affine transformations.
void transform_x_back(Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms)
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.
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.
Routines for setting up the jacobian.
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
Jacobian::Line select_derivativeLineShape(const String &var, const String &coeff)
Return the derivative type based on string input.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
void jacobianAdjustAndTransform(Matrix &jacobian, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &x, const Verbosity &)
WORKSPACE METHOD: jacobianAdjustAndTransform.
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 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.
void jacobianCalcFreqStretch(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Index &stokes_dim, const Vector &f_grid, const Matrix &mblock_dlos, const Sparse &sensor_response, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &)
WORKSPACE METHOD: jacobianCalcFreqStretch.
void jacobianClose(Workspace &ws_in, Index &jacobian_do, Agenda &jacobian_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianClose.
void vmr_fieldPerturb(Tensor4 &vmr_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const String &species, const Vector &p_ret_grid, const Vector &lat_ret_grid, const Vector &lon_ret_grid, const Index &pert_index, const Numeric &pert_size, const String &pert_mode, const Verbosity &verbosity)
WORKSPACE METHOD: vmr_fieldPerturb.
void jacobianCalcPolyfit(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Sparse &sensor_response, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &poly_coeff, const Verbosity &)
WORKSPACE METHOD: jacobianCalcPolyfit.
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 jacobianCalcPointingZaRecalc(Workspace &ws, Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const Matrix &sensor_pos, const Matrix &sensor_los, const Matrix &transmitter_pos, const Matrix &mblock_dlos, const Sparse &sensor_response, const ArrayOfTime &sensor_time, const String &iy_unit, const Agenda &iy_main_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianCalcPointingZaRecalc.
void jacobianFromTwoY(Matrix &jacobian, const Vector &y_pert, const Vector &y, const Numeric &pert_size, const Verbosity &)
WORKSPACE METHOD: jacobianFromTwoY.
void AtmFieldPerturb(Tensor3 &perturbed_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &original_field, const Vector &p_ret_grid, const Vector &lat_ret_grid, const Vector &lon_ret_grid, const Index &pert_index, const Numeric &pert_size, const String &pert_mode, const Verbosity &)
WORKSPACE METHOD: AtmFieldPerturb.
void jacobianFromYbatch(Matrix &jacobian, const ArrayOfVector &ybatch, const Vector &y, const Numeric &pert_size, const Verbosity &)
WORKSPACE METHOD: jacobianFromYbatch.
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 jacobianAddShapeCatalogParameter(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const QuantumIdentifier &line_identity, const String &species, const String &variable, const String &coefficient, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddShapeCatalogParameter.
void jacobianInit(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Verbosity &)
WORKSPACE METHOD: jacobianInit.
void jacobianAddFreqStretch(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqStretch.
void jacobianAddPointingZa(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Matrix &sensor_pos, const ArrayOfTime &sensor_time, const Index &poly_order, const String &calcmode, const Numeric &dza, const Verbosity &)
WORKSPACE METHOD: jacobianAddPointingZa.
void particle_bulkprop_fieldPerturb(Tensor4 &particle_bulkprop_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfString &particle_bulkprop_names, const String &particle_type, const Vector &p_ret_grid, const Vector &lat_ret_grid, const Vector &lon_ret_grid, const Index &pert_index, const Numeric &pert_size, const String &pert_mode, const Verbosity &verbosity)
WORKSPACE METHOD: particle_bulkprop_fieldPerturb.
void jacobianAddNLTEs(Workspace &ws, 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 ArrayOfQuantumIdentifier &energy_level_identities, const Numeric &dx, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddNLTEs.
void vmr_fieldPerturbAtmGrids(Tensor4 &vmr_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const String &species, const Index &pert_index, const Numeric &pert_size, const String &pert_mode, const Verbosity &verbosity)
WORKSPACE METHOD: vmr_fieldPerturbAtmGrids.
void jacobianSetAffineTransformation(ArrayOfRetrievalQuantity &jqs, const Matrix &transformation_matrix, const Vector &offset_vector, const Verbosity &)
WORKSPACE METHOD: jacobianSetAffineTransformation.
void jacobianAddNLTE(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 QuantumIdentifier &energy_level_identity, const Numeric &dx, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddNLTE.
void IndexNumberOfAtmosphericPoints(Index &n, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Verbosity &)
WORKSPACE METHOD: IndexNumberOfAtmosphericPoints.
void jacobianCalcPointingZaInterp(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Index &stokes_dim, const Vector &f_grid, const Matrix &DEBUG_ONLY(sensor_los), const Matrix &mblock_dlos, const Sparse &sensor_response, const ArrayOfTime &sensor_time, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &)
void jacobianCalcDoNothing(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Verbosity &)
WORKSPACE METHOD: jacobianCalcDoNothing.
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.
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.
void particle_bulkprop_fieldPerturbAtmGrids(Tensor4 &particle_bulkprop_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfString &particle_bulkprop_names, const String &particle_type, const Index &pert_index, const Numeric &pert_size, const String &pert_mode, const Verbosity &verbosity)
WORKSPACE METHOD: particle_bulkprop_fieldPerturbAtmGrids.
void jacobianCalcFreqShift(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Index &stokes_dim, const Vector &f_grid, const Matrix &mblock_dlos, const Sparse &sensor_response, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &)
WORKSPACE METHOD: jacobianCalcFreqShift.
void jacobianAddBasicCatalogParameter(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const QuantumIdentifier &catalog_identity, const String &catalog_parameter, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameter.
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.
void jacobianAddShapeCatalogParameters(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfQuantumIdentifier &line_identities, const ArrayOfString &species, const ArrayOfString &variables, const ArrayOfString &coefficients, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddShapeCatalogParameters.
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.
void jacobianAddFreqShift(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqShift.
void AtmFieldPerturbAtmGrids(Tensor3 &perturbed_field, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &original_field, const Index &pert_index, const Numeric &pert_size, const String &pert_mode, const Verbosity &)
WORKSPACE METHOD: AtmFieldPerturbAtmGrids.
void jacobianSetFuncTransformation(ArrayOfRetrievalQuantity &jqs, const String &transformation_func, const Numeric &z_min, const Numeric &z_max, const Verbosity &)
WORKSPACE METHOD: jacobianSetFuncTransformation.
void jacobianAddBasicCatalogParameters(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfQuantumIdentifier &catalog_identities, const ArrayOfString &catalog_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameters.
void jacobianOff(Workspace &ws, Index &jacobian_do, Agenda &jacobian_agenda, ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianOff.
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.
void jacobianCalcSinefit(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Sparse &sensor_response, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &period_index, const Verbosity &)
WORKSPACE METHOD: jacobianCalcSinefit.
Workspace methods and template functions for supergeneric XML IO.
void reshape(Tensor3View X, ConstVectorView x)
reshape
Array< Vector > ArrayOfVector
An array of vectors.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
Declarations having to do with the four output streams.
Array< String > ArrayOfString
An array of Strings.
constexpr Numeric two_pi
Two times pi.
constexpr std::string_view bath_broadening
Name for bath broadening in printing and reading user input.
constexpr std::string_view self_broadening
Name for self broadening in printing and reading user input.
This file contains declerations of functions of physical character.
Quantum::Number::GlobalState QuantumIdentifier
void iyb_calc(Workspace &ws, Vector &iyb, ArrayOfVector &iyb_aux, ArrayOfMatrix &diyb_dx, Matrix &geo_pos_matrix, const Index &mblock_index, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const ConstVectorView &f_grid, const ConstMatrixView &sensor_pos, const ConstMatrixView &sensor_los, const ConstMatrixView &transmitter_pos, const ConstMatrixView &mblock_dlos, const String &iy_unit, const Agenda &iy_main_agenda, const Index &j_analytical_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfIndex &jacobian_indices, const ArrayOfString &iy_aux_vars, const Verbosity &verbosity)
Performs calculations for one measurement block, on iy-level.
Range get_rowindex_for_mblock(const Sparse &sensor_response, const Index &mblock_index)
Returns the "range" of y corresponding to a measurement block.
Declaration of functions in rte.cc.
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.
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.
Holds all information required for individual partial derivatives.
Numeric perturbation
Perturbations for methods where theoretical computations are impossible or plain slow.
bool sameTargetType(const Target &other) const noexcept
Species::Species species_id
Species ID for line parameters.
A logical struct for global quantum numbers with species identifiers.
Species::Species Species() const noexcept
Index nrows() const
Returns the number of rows.
Index ncols() const
Returns the number of columns.