113 const Index& mblock_index _U_,
128 if (jacobian_quantities.empty())
130 "No retrieval quantities has been added to *jacobian_quantities*.");
132 jacobian_agenda.
check(ws, verbosity);
140 jacobian_quantities.resize(0);
141 jacobian_agenda =
Agenda();
142 jacobian_agenda.
set_name(
"jacobian_agenda");
151 jacobianInit(jacobian_quantities, jacobian_agenda, verbosity);
162 const Index& atmosphere_dim,
167 const Vector& rq_lat_grid,
168 const Vector& rq_lon_grid,
171 const Index& for_species_tag,
177 if (not for_species_tag) {
180 if (test.
nelem() not_eq 1)
181 throw std::runtime_error(
182 "Trying to add a species as a species tag of multiple species.\n" 183 "This is not supported. Please give just a single species instead.\n" 184 "Otherwise consider if you intended for_species_tag to be evaluated true.\n");
192 if (jq[it].MainTag() == ABSSPECIES_MAINTAG &&
193 jq[it].SubSubtag() != PROPMAT_SUBSUBTAG && jq[it].Subtag() == species) {
195 os <<
"The gas species:\n" 196 << species <<
"\nis already included in " 197 <<
"*jacobian_quantities*.";
198 throw runtime_error(os.
str());
199 }
else if (jq[it].MainTag() == ABSSPECIES_MAINTAG &&
203 os <<
"The atmospheric species of:\n" 204 << species <<
"\nis already included in " 205 <<
"*jacobian_quantities*.";
206 throw runtime_error(os.
str());
224 "retrieval pressure grid",
225 "retrieval latitude grid",
226 "retrievallongitude_grid",
228 throw runtime_error(os.
str());
232 if (mode !=
"vmr" && mode !=
"nd" && mode !=
"rel" && mode !=
"rh" &&
235 "The retrieval mode can only be \"vmr\", \"nd\", " 236 "\"rel\", \"rh\" or \"q\".");
238 if ((mode ==
"rh" || mode ==
"q") && species.substr(0, 3) !=
"H2O") {
240 "Retrieval modes \"rh\" and \"q\" can only be applied " 241 "on species starting with H2O.");
246 rq.
MainTag(ABSSPECIES_MAINTAG);
252 if (not for_species_tag) {
263 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
278 for (
Index it = 0; it < jacobian_quantities.
nelem(); it++) {
279 if (jacobian_quantities[it].MainTag() == FREQUENCY_MAINTAG &&
282 os <<
"Fit of frequency shift is already included in\n" 283 <<
"*jacobian_quantities*.";
284 throw runtime_error(os.
str());
289 if (df <= 0)
throw runtime_error(
"The argument *df* must be > 0.");
291 throw runtime_error(
"The argument *df* is not allowed to exceed 1 MHz.");
295 "Frequency shifts and *f_grid* of length 1 can " 297 const Numeric maxdf = f_grid[nf - 1] - f_grid[nf - 2];
300 os <<
"The value of *df* is too big with respect to spacing of " 301 <<
"*f_grid*. The maximum\nallowed value of *df* is the spacing " 302 <<
"between the two last elements of *f_grid*.\n" 303 <<
"This spacing is : " << maxdf / 1e3 <<
" kHz\n" 304 <<
"The value of df is: " << df / 1e3 <<
" kHz";
305 throw runtime_error(os.
str());
311 rq.Subtag(FREQUENCY_SUBTAG_0);
322 jacobian_quantities.push_back(rq);
325 jacobian_agenda.
append(
"jacobianCalcFreqShift",
"");
330 const Index& mblock_index,
333 const Index& stokes_dim,
335 const Matrix& mblock_dlos_grid,
336 const Sparse& sensor_response,
346 for (
Index n = 0;
n < jacobian_quantities.
nelem() && !found;
n++) {
347 if (jacobian_quantities[
n].MainTag() == FREQUENCY_MAINTAG &&
352 jacobian_indices, any_affine, jacobian_quantities,
true);
355 rq = jacobian_quantities[
n];
356 ji = jacobian_indices[
n];
361 "There is no such frequency retrieval quantity defined.\n");
367 throw runtime_error(
"Mismatch in size between *sensor_response* and *yb*.");
370 "Mismatch in size between *sensor_response* and *iyb*.");
379 const Index niyb = nf2 * nlos2 * stokes_dim;
383 const Index porder = 3;
386 Matrix itw(nf2, porder + 1);
387 Vector fg_new = f_grid, iyb2(niyb);
394 for (
Index ilos = 0; ilos < nlos2; ilos++) {
395 const Index row0 = ilos * nf2 * stokes_dim;
397 for (
Index is = 0; is < stokes_dim; is++) {
400 iyb[
Range(row0 + is, nf2, stokes_dim)],
407 mult(dy, sensor_response, iyb2);
417 jacobian(rowind, ji[0]) = dy;
432 for (
Index it = 0; it < jacobian_quantities.
nelem(); it++) {
433 if (jacobian_quantities[it].MainTag() == FREQUENCY_MAINTAG &&
436 os <<
"Fit of frequency stretch is already included in\n" 437 <<
"*jacobian_quantities*.";
438 throw runtime_error(os.
str());
443 if (df <= 0)
throw runtime_error(
"The argument *df* must be > 0.");
445 throw runtime_error(
"The argument *df* is not allowed to exceed 1 MHz.");
447 const Numeric maxdf = f_grid[nf - 1] - f_grid[nf - 2];
450 os <<
"The value of *df* is too big with respect to spacing of " 451 <<
"*f_grid*. The maximum\nallowed value of *df* is the spacing " 452 <<
"between the two last elements of *f_grid*.\n" 453 <<
"This spacing is : " << maxdf / 1e3 <<
" kHz\n" 454 <<
"The value of df is: " << df / 1e3 <<
" kHz";
455 throw runtime_error(os.
str());
461 rq.Subtag(FREQUENCY_SUBTAG_1);
472 jacobian_quantities.push_back(rq);
475 jacobian_agenda.
append(
"jacobianCalcFreqStretch",
"");
481 const Index& mblock_index,
484 const Index& stokes_dim,
486 const Matrix& mblock_dlos_grid,
487 const Sparse& sensor_response,
489 const Vector& sensor_response_f_grid,
490 const Matrix& sensor_response_dlos_grid,
503 for (
Index n = 0;
n < jacobian_quantities.
nelem() && !found;
n++) {
504 if (jacobian_quantities[
n].MainTag() == FREQUENCY_MAINTAG &&
509 jacobian_indices, any_affine, jacobian_quantities,
true);
512 rq = jacobian_quantities[
n];
513 ji = jacobian_indices[
n];
518 "There is no such frequency retrieval quantity defined.\n");
524 throw runtime_error(
"Mismatch in size between *sensor_response* and *yb*.");
527 "Mismatch in size between *sensor_response* and *iyb*.");
536 const Index niyb = nf2 * nlos2 * stokes_dim;
540 const Index porder = 3;
543 Matrix itw(nf2, porder + 1);
544 Vector fg_new = f_grid, iyb2(niyb);
551 for (
Index ilos = 0; ilos < nlos2; ilos++) {
552 const Index row0 = ilos * nf2 * stokes_dim;
554 for (
Index is = 0; is < stokes_dim; is++) {
557 iyb[
Range(row0 + is, nf2, stokes_dim)],
564 mult(dy, sensor_response, iyb2);
575 const Index nf = sensor_response_f_grid.
nelem();
576 const Index npol = sensor_response_pol_grid.
nelem();
577 const Index nlos = sensor_response_dlos_grid.
nrows();
579 for (
Index l = 0; l < nlos; l++) {
580 for (
Index f = 0; f < nf; f++) {
581 const Index row1 = (l * nf + f) * npol;
582 for (
Index p = 0; p < npol; p++) {
583 dy[row1 + p] *= w[f];
592 jacobian(rowind, ji[0]) = dy;
604 const Vector& sensor_time,
605 const Index& poly_order,
612 "The polynomial order has to be positive or -1 for gitter.");
615 for (
Index it = 0; it < jacobian_quantities.
nelem(); it++) {
616 if (jacobian_quantities[it].MainTag() == POINTING_MAINTAG &&
619 os <<
"Fit of zenith angle pointing off-set is already included in\n" 620 <<
"*jacobian_quantities*.";
621 throw runtime_error(os.
str());
626 if (dza <= 0)
throw runtime_error(
"The argument *dza* must be > 0.");
628 throw runtime_error(
"The argument *dza* is not allowed to exceed 0.1 deg.");
631 if (sensor_time.
nelem() != sensor_pos.
nrows()) {
633 os <<
"The WSV *sensor_time* must be defined for every " 634 <<
"measurement block.\n";
635 throw runtime_error(os.
str());
639 if (poly_order > sensor_time.
nelem() - 1) {
641 "The polynomial order can not be >= length of *sensor_time*.");
647 rq.
Subtag(POINTING_SUBTAG_A);
654 Vector grid(0, poly_order + 1, 1);
655 if (poly_order == -1) {
662 if (calcmode ==
"recalc") {
663 rq.
Mode(POINTING_CALCMODE_A);
664 jacobian_agenda.
append(
"jacobianCalcPointingZaRecalc",
"");
665 }
else if (calcmode ==
"interp") {
666 rq.
Mode(POINTING_CALCMODE_B);
667 jacobian_agenda.
append(
"jacobianCalcPointingZaInterp",
"");
670 "Possible choices for *calcmode* are \"recalc\" and \"interp\".");
673 jacobian_quantities.push_back(rq);
679 const Index& mblock_index,
682 const Index& stokes_dim,
685 const Matrix& mblock_dlos_grid,
686 const Sparse& sensor_response,
687 const Vector& sensor_time,
690 if (mblock_dlos_grid.
nrows() < 2)
692 "The method demands that *mblock_dlos_grid* has " 693 "more than one row.");
698 "The method demands that the zenith angles in " 699 "*mblock_dlos_grid* are sorted (increasing or decreasing).");
708 for (
Index n = 0;
n < jacobian_quantities.
nelem() && !found;
n++) {
709 if (jacobian_quantities[
n].MainTag() == POINTING_MAINTAG &&
710 jacobian_quantities[
n].Subtag() == POINTING_SUBTAG_A &&
715 jacobian_indices, any_affine, jacobian_quantities,
true);
718 rq = jacobian_quantities[
n];
719 ji = jacobian_indices[
n];
724 "There is no such pointing retrieval quantity defined.\n");
745 gp1, mblock_dlos_grid(
joker, 0), za1, 1e6);
747 gp2, mblock_dlos_grid(
joker, 0), za2, 1e6);
748 Matrix itw1(nza, 2), itw2(nza, 2);
756 for (
Index iza = 0; iza < nza; iza++) {
757 for (
Index iv = 0; iv < nf; iv++) {
758 for (
Index is = 0; is < stokes_dim; is++) {
759 const Range r(iv * stokes_dim + is, nza, nf * stokes_dim);
760 interp(iyb1[r], itw1, iyb[r], gp1);
761 interp(iyb2[r], itw2, iyb[r], gp2);
769 mult(y1, sensor_response, iyb1);
770 mult(y2, sensor_response, iyb2);
780 const Index it = ji[0];
785 if (rq.
Grids()[0][0] == -1)
787 assert(lg == sensor_los.nrows());
788 assert(rq.
Grids()[0][mblock_index] == -1);
789 jacobian(rowind, it + mblock_index) = dy;
795 for (
Index c = 0; c < lg; c++) {
801 jacobian(row0 +
i, it + c) = w[mblock_index] * dy[
i];
811 const Index& mblock_index,
814 const Index& atmosphere_dim,
816 const Index& cloudbox_on,
817 const Index& stokes_dim,
821 const Matrix& transmitter_pos,
822 const Matrix& mblock_dlos_grid,
823 const Sparse& sensor_response,
824 const Vector& sensor_time,
826 const Agenda& iy_main_agenda,
827 const Agenda& geo_pos_agenda,
837 for (
Index n = 0;
n < jacobian_quantities.
nelem() && !found;
n++) {
838 if (jacobian_quantities[
n].MainTag() == POINTING_MAINTAG &&
839 jacobian_quantities[
n].Subtag() == POINTING_SUBTAG_A &&
844 jacobian_indices, any_affine, jacobian_quantities,
true);
847 rq = jacobian_quantities[
n];
848 ji = jacobian_indices[
n];
853 "There is no such pointing retrieval quantity defined.\n");
895 mult(dy, sensor_response, iyb2);
905 const Index it = ji[0];
910 if (rq.
Grids()[0][0] == -1)
912 assert(lg == sensor_los.
nrows());
913 assert(rq.
Grids()[0][mblock_index] == -1);
914 jacobian(rowind, it + mblock_index) = dy;
920 for (
Index c = 0; c < lg; c++) {
926 jacobian(row0 +
i, it + c) = w[mblock_index] * dy[
i];
941 const Matrix& sensor_response_dlos_grid,
943 const Index& poly_order,
944 const Index& no_pol_variation,
945 const Index& no_los_variation,
946 const Index& no_mblock_variation,
950 throw runtime_error(
"The polynomial order has to be >= 0.");
956 os <<
"Polynomial baseline fit is already included in\n" 957 <<
"*jacobian_quantities*.";
958 throw runtime_error(os.
str());
972 if (no_pol_variation)
975 grids[1] =
Vector(0, sensor_response_pol_grid.
nelem(), 1);
976 if (no_los_variation)
979 grids[2] =
Vector(0, sensor_response_dlos_grid.
nrows(), 1);
980 if (no_mblock_variation)
994 for (
Index i = 0;
i <= poly_order;
i++) {
996 sstr <<
"Coefficient " <<
i;
997 rq.Subtag(sstr.
str());
1007 jacobian_agenda.
append(
"jacobianCalcPolyfit", i);
1013 const Index& mblock_index,
1016 const Sparse& sensor_response,
1018 const Vector& sensor_response_f_grid,
1019 const Matrix& sensor_response_dlos_grid,
1021 const Index& poly_coeff,
1029 sstr <<
"Coefficient " << poly_coeff;
1030 for (iq = 0; iq < jacobian_quantities.
nelem() && !found; iq++) {
1031 if (jacobian_quantities[iq].MainTag() == POLYFIT_MAINTAG &&
1032 jacobian_quantities[iq].Subtag() == sstr.
str()) {
1038 throw runtime_error(
1039 "There is no Polyfit jacobian defined, in general " 1040 "or for the selected polynomial coefficient.\n");
1045 const Index nf = sensor_response_f_grid.
nelem();
1046 const Index npol = sensor_response_pol_grid.
nelem();
1047 const Index nlos = sensor_response_dlos_grid.
nrows();
1069 Index col4 = jacobian_indices[iq][0];
1072 col4 += mblock_index * n2 * n1;
1075 for (
Index l = 0; l < nlos; l++) {
1076 const Index row3 = row4 + l * nf * npol;
1077 const Index col3 = col4 + l * n1;
1079 for (
Index f = 0; f < nf; f++) {
1080 const Index row2 = row3 + f * npol;
1082 for (
Index p = 0; p < npol; p++) {
1088 jacobian(row2 + p, col1) = w[f];
1102 const Index& atmosphere_dim,
1107 const Vector& rq_lat_grid,
1108 const Vector& rq_lon_grid,
1118 if (jq[it].MainTag() == SCATSPECIES_MAINTAG && jq[it].Subtag() == species &&
1119 jq[it].SubSubtag() == quantity) {
1121 os <<
"The combintaion of\n scattering species: " << species
1122 <<
"\n retrieval quantity: " << quantity
1123 <<
"\nis already included in *jacobian_quantities*.";
1124 throw runtime_error(os.
str());
1141 "retrieval pressure grid",
1142 "retrieval latitude grid",
1143 "retrievallongitude_grid",
1145 throw runtime_error(os.
str());
1150 rq.
MainTag(SCATSPECIES_MAINTAG);
1152 rq.SubSubtag(quantity);
1159 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1171 const Matrix& sensor_response_dlos_grid,
1172 const Matrix& sensor_pos,
1173 const Vector& period_lengths,
1174 const Index& no_pol_variation,
1175 const Index& no_los_variation,
1176 const Index& no_mblock_variation,
1181 if (np == 0)
throw runtime_error(
"No sinusoidal periods has benn given.");
1187 os <<
"Polynomial baseline fit is already included in\n" 1188 <<
"*jacobian_quantities*.";
1189 throw runtime_error(os.
str());
1203 if (no_pol_variation)
1206 grids[1] =
Vector(0, sensor_response_pol_grid.
nelem(), 1);
1207 if (no_los_variation)
1210 grids[2] =
Vector(0, sensor_response_dlos_grid.
nrows(), 1);
1211 if (no_mblock_variation)
1227 sstr <<
"Period " <<
i;
1228 rq.Subtag(sstr.
str());
1231 grids[0] =
Vector(2, period_lengths[i]);
1238 jacobian_agenda.
append(
"jacobianCalcSinefit", i);
1244 const Index& mblock_index,
1247 const Sparse& sensor_response,
1249 const Vector& sensor_response_f_grid,
1250 const Matrix& sensor_response_dlos_grid,
1252 const Index& period_index,
1260 sstr <<
"Period " << period_index;
1261 for (iq = 0; iq < jacobian_quantities.
nelem() && !found; iq++) {
1262 if (jacobian_quantities[iq].MainTag() == SINEFIT_MAINTAG &&
1263 jacobian_quantities[iq].Subtag() == sstr.
str()) {
1269 throw runtime_error(
1270 "There is no Sinefit jacobian defined, in general " 1271 "or for the selected period length.\n");
1276 const Index nf = sensor_response_f_grid.
nelem();
1277 const Index npol = sensor_response_pol_grid.
nelem();
1278 const Index nlos = sensor_response_dlos_grid.
nrows();
1287 for (
Index f = 0; f < nf; f++) {
1288 Numeric a = (sensor_response_f_grid[f] - sensor_response_f_grid[0]) * 2 *
1307 Index col4 = jacobian_indices[iq][0];
1310 col4 += mblock_index * n2 * n1 * 2;
1313 for (
Index l = 0; l < nlos; l++) {
1314 const Index row3 = row4 + l * nf * npol;
1315 const Index col3 = col4 + l * n1 * 2;
1317 for (
Index f = 0; f < nf; f++) {
1318 const Index row2 = row3 + f * npol;
1320 for (
Index p = 0; p < npol; p++) {
1326 jacobian(row2 + p, col1) = s[f];
1327 jacobian(row2 + p, col1 + 1) = c[f];
1341 const Index& atmosphere_dim,
1344 const Vector& rq_lat_grid,
1345 const Vector& rq_lon_grid,
1353 if (jq[it].MainTag() == SURFACE_MAINTAG && jq[it].Subtag() == quantity) {
1355 os << quantity <<
" is already included as a surface variable " 1356 <<
"in *jacobian_quantities*.";
1357 throw runtime_error(os.
str());
1372 "retrieval latitude grid",
1373 "retrievallongitude_grid",
1375 throw runtime_error(os.
str());
1381 rq.Subtag(quantity);
1389 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1400 const Index& atmosphere_dim,
1405 const Vector& rq_lat_grid,
1406 const Vector& rq_lon_grid,
1416 os <<
"Temperature is already included in *jacobian_quantities*.";
1417 throw runtime_error(os.
str());
1434 "retrieval pressure grid",
1435 "retrieval latitude grid",
1436 "retrievallongitude_grid",
1438 throw runtime_error(os.
str());
1445 }
else if (hse ==
"off") {
1449 os <<
"The keyword for hydrostatic equilibrium can only be set to\n" 1450 <<
"\"on\" or \"off\"\n";
1451 throw runtime_error(os.
str());
1456 rq.
MainTag(TEMPERATURE_MAINTAG);
1460 rq.Perturbation(0.1);
1462 rq.SubSubtag(PROPMAT_SUBSUBTAG);
1468 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1479 const Index& atmosphere_dim,
1484 const Vector& rq_lat_grid,
1485 const Vector& rq_lon_grid,
1494 if (jq[it].MainTag() == WIND_MAINTAG && jq[it].Subtag() == component) {
1496 os <<
"The wind component:\n" 1497 << component <<
"\nis already included " 1498 <<
"in *jacobian_quantities*.";
1499 throw runtime_error(os.
str());
1516 "retrieval pressure grid",
1517 "retrieval latitude grid",
1518 "retrievallongitude_grid",
1520 throw runtime_error(os.
str());
1526 if (component ==
"u")
1528 else if (component ==
"v")
1530 else if (component ==
"w")
1532 else if (component ==
"strength")
1535 throw std::runtime_error(
1536 "The selection for *component* can only be \"u\", \"v\", \"w\" or \"strength\".");
1538 rq.MainTag(WIND_MAINTAG);
1539 rq.Subtag(component);
1542 rq.SubSubtag(PROPMAT_SUBSUBTAG);
1543 rq.Perturbation(dfrequency);
1548 out3 <<
" Calculations done by propagation matrix expression.\n";
1549 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1560 const Index& atmosphere_dim,
1565 const Vector& rq_lat_grid,
1566 const Vector& rq_lon_grid,
1575 if (jq[it].MainTag() == MAGFIELD_MAINTAG && jq[it].Subtag() == component) {
1577 os <<
"The magnetic field component:\n" 1578 << component <<
"\nis already " 1579 <<
"included in *jacobian_quantities*.";
1580 throw runtime_error(os.
str());
1597 "retrieval pressure grid",
1598 "retrieval latitude grid",
1599 "retrievallongitude_grid",
1601 throw runtime_error(os.
str());
1606 if (component ==
"u")
1608 else if (component ==
"v")
1610 else if (component ==
"w")
1612 else if (component ==
"strength")
1615 throw runtime_error(
1616 "The selection for *component* can only be \"u\", \"v\", \"w\", or \"strength\".");
1618 rq.MainTag(MAGFIELD_MAINTAG);
1619 rq.Subtag(component);
1623 rq.SubSubtag(PROPMAT_SUBSUBTAG);
1624 rq.Perturbation(dB);
1630 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1644 const String& coefficient,
1649 throw std::runtime_error(
"Identity has to identify a line");
1653 out3 <<
"Attempting to create RT tag for " << line_identity <<
" " << variable
1654 <<
" " << coefficient <<
" for ";
1655 if (species not_eq LineShape::self_broadening and
1656 species not_eq LineShape::bath_broadening)
1659 out3 << species <<
"\n";
1663 rq.
MainTag(CATALOGPARAMETER_MAINTAG);
1674 if (
q.HasSameInternalsAs(rq))
1675 throw std::runtime_error(
"Error with copies of the quantities");
1679 out3 <<
"Creation was successful!\n";
1680 jacobian_agenda.
append(
"jacobianCalcDoNothing",
1694 if (not(line_identities.
nelem() or species.
nelem() or variables.
nelem() or
1695 coefficients.
nelem()))
1696 throw std::runtime_error(
"Must have at least 1-long lists for all GINs");
1699 if (variables[0] ==
"ALL")
1705 if (coefficients[0] ==
"ALL")
1708 coeffs = coefficients;
1710 for (
auto& l : line_identities)
1711 for (
auto& s : species)
1712 for (
auto& v : vars)
1713 for (
auto& c : coeffs)
1715 ws, jq, jacobian_agenda, l, s, v, c, verbosity);
1723 const String& catalog_parameter,
1729 if (jq[it].MainTag() == CATALOGPARAMETER_MAINTAG &&
1730 jq[it].QuantumIdentity() == catalog_identity &&
1731 jq[it].Mode() == catalog_parameter) {
1733 os <<
"The catalog identifier:\n" 1734 << catalog_identity <<
"\nis already included in " 1735 <<
"*jacobian_quantities*.";
1736 throw std::runtime_error(os.
str());
1744 if (LINESTRENGTH_MODE == catalog_parameter)
1746 else if (LINECENTER_MODE == catalog_parameter)
1750 os <<
"You have selected:\n" 1751 << catalog_parameter
1752 <<
"\nas your catalog parameter. This is not supported.\n" 1753 <<
"Please see user guide for supported parameters.\n";
1754 throw std::runtime_error(os.
str());
1757 rq.MainTag(CATALOGPARAMETER_MAINTAG);
1758 rq.Mode(catalog_parameter);
1759 rq.QuantumIdentity(catalog_identity);
1761 rq.SubSubtag(PROPMAT_SUBSUBTAG);
1767 out3 <<
" Calculations done by propagation matrix expressions.\n";
1769 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1782 out2 <<
" Adding " << catalog_identities.
nelem() * catalog_parameters.
nelem()
1783 <<
" expression(s) to the Jacobian calculations.\n";
1785 for (
auto& qi : catalog_identities)
1786 for (
auto& param : catalog_parameters)
1788 ws, jq, jacobian_agenda, qi, param, verbosity);
1799 const Index& atmosphere_dim,
1804 const Vector& rq_lat_grid,
1805 const Vector& rq_lon_grid,
1813 if (jq[it].MainTag() == NLTE_MAINTAG and
1814 jq[it].QuantumIdentity() == energy_level_identity) {
1816 os <<
"The NLTE identifier:\n" 1817 << energy_level_identity <<
"\nis already included in " 1818 <<
"*jacobian_quantities*.";
1819 throw std::runtime_error(os.
str());
1836 "retrieval pressure grid",
1837 "retrieval latitude grid",
1838 "retrievallongitude_grid",
1840 throw runtime_error(os.
str());
1847 rq.QuantumIdentity(energy_level_identity);
1848 rq.Perturbation(dx);
1851 rq.SubSubtag(PROPMAT_SUBSUBTAG);
1856 out3 <<
" Calculations done by propagation matrix expressions.\n";
1858 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1864 const Index& atmosphere_dim,
1869 const Vector& rq_lat_grid,
1870 const Vector& rq_lon_grid,
1874 for (
const auto& qi : energy_level_identities)
1894 const Index& atmosphere_dim,
1899 const Vector& rq_lat_grid,
1900 const Vector& rq_lon_grid,
1919 "retrieval pressure grid",
1920 "retrieval latitude grid",
1921 "retrievallongitude_grid",
1923 throw runtime_error(os.
str());
1930 rq.SubSubtag(PROPMAT_SUBSUBTAG);
1933 if (species ==
"electrons") {
1937 os <<
"Electrons are already included in *jacobian_quantities*.";
1938 throw std::runtime_error(os.
str());
1941 rq.MainTag(ELECTRONS_MAINTAG);
1943 }
else if (species ==
"particulates") {
1947 os <<
"Particulates are already included in *jacobian_quantities*.";
1948 throw std::runtime_error(os.
str());
1951 rq.MainTag(PARTICULATES_MAINTAG);
1955 os <<
"Unknown special species jacobian: \"" << species
1956 <<
"\"\nPlease see *jacobianAddSpecialSpecies* for viable options.";
1957 throw std::runtime_error(os.
str());
1963 jacobian_agenda.
append(
"jacobianCalcDoNothing",
TokVal());
1978 if (jacobian.
empty()) {
1986 bool vars_init =
false;
1991 if (jacobian_quantities[
q].MainTag() == ABSSPECIES_MAINTAG &&
1992 jacobian_quantities[
q].Mode() ==
"rel") {
2000 for (
Index i = jis0[
q][0];
i <= jis0[
q][1];
i++) {
2014 const Matrix& transformation_matrix,
2015 const Vector& offset_vector,
2020 "Jacobian quantities is empty, so there is nothing to add the " 2021 "transformation to.");
2026 if (!(nelem == transformation_matrix.
nrows())) {
2028 "Dimension of transformation matrix incompatible with retrieval grids.");
2030 if (!(nelem == offset_vector.
nelem())) {
2032 "Dimension of offset vector incompatible with retrieval grids.");
2035 jqs.back().SetTransformationMatrix(
transpose(transformation_matrix));
2036 jqs.back().SetOffsetVector(offset_vector);
2041 const String& transformation_func,
2047 throw runtime_error(
2048 "Jacobian quantities is empty, so there is nothing to add the " 2049 "transformation to.");
2051 if (transformation_func ==
"none") {
2052 jqs.back().SetTransformationFunc(
"");
2058 if (transformation_func ==
"atanh") {
2060 throw runtime_error(
2061 "For option atanh, the GIN *z_max* must be set and be > z_min.");
2065 }
else if (transformation_func ==
"log" || transformation_func ==
"log10") {
2070 os <<
"Valid options for *transformation_func* are:\n" 2071 <<
"\"none\", \"log\", \"log10\" and \"atanh\"\n" 2072 <<
"But found: \"" << transformation_func <<
"\"";
2073 throw runtime_error(os.
str());
2076 jqs.back().SetTransformationFunc(transformation_func);
2077 jqs.back().SetTFuncParameters(pars);
2086 const Index& atmosphere_dim,
2090 const Tensor3& original_field,
2091 const Vector& p_ret_grid,
2092 const Vector& lat_ret_grid,
2093 const Vector& lon_ret_grid,
2094 const Index& pert_index,
2109 ret_grids[0] = p_ret_grid;
2110 if (atmosphere_dim>1){
2111 ret_grids[1] = lat_ret_grid;
2112 if (atmosphere_dim>2){
2113 ret_grids[2] = lon_ret_grid;
2119 Index n_p, n_lat, n_lon;
2134 throw runtime_error(
"Bad *pert_index*. It is negative.");
2136 const Index n_tot = n_p * n_lat * n_lon;
2137 if (pert_index >= n_tot){
2138 throw runtime_error(
"Bad *pert_index*. It is too high with respect " 2139 "to length of retrieval grids.");
2144 if (pert_mode ==
"absolute" ){
2146 x[pert_index] = pert_size;
2148 else if (pert_mode ==
"relative" ){
2150 x[pert_index] += pert_size;
2153 throw runtime_error(
"Bad *pert_mode*. Allowed choices are: " 2154 """absolute"" and ""relative"".");
2158 Tensor3 x3d(n_p, n_lat, n_lon), pert(n_p, n_lat, n_lon);
2163 if (&perturbed_field != &original_field) {
2164 perturbed_field = original_field;
2168 if (pert_mode ==
"absolute" ){
2169 perturbed_field += pert;
2172 perturbed_field *= pert;
2178 const Index& atmosphere_dim,
2182 const Tensor3& original_field,
2183 const Index& pert_index,
2189 const Index n_lat = atmosphere_dim<2 ? 1 : lat_grid.
nelem();
2190 const Index n_lon = atmosphere_dim<3 ? 1 : lon_grid.
nelem();
2201 throw runtime_error(
"Bad *pert_index*. It is negative.");
2203 if (pert_index >= n_p * n_lat * n_lon){
2204 throw runtime_error(
"Bad *pert_index*. It is too high with respect " 2205 "to length of atmospheric grids.");
2209 Index tot_index = pert_index;
2210 const Index lon_index = atmosphere_dim<3 ? 0 : tot_index / (n_lat * n_p);
2211 tot_index -= lon_index * n_lat * n_p;
2212 const Index lat_index = atmosphere_dim<2 ? 0 : tot_index / n_p;
2213 tot_index -= lat_index * n_p;
2214 const Index p_index = tot_index;
2217 if (&perturbed_field != &original_field) {
2218 perturbed_field = original_field;
2222 if (pert_mode ==
"absolute" ){
2223 perturbed_field(p_index,
2224 atmosphere_dim>1 ? lat_index : 0,
2225 atmosphere_dim>2 ? lon_index : 0) += pert_size;
2227 else if (pert_mode ==
"relative"){
2228 perturbed_field(p_index,
2229 atmosphere_dim>1 ? lat_index : 0,
2230 atmosphere_dim>2 ? lon_index : 0) *= 1 + pert_size;
2233 throw runtime_error(
"Bad *pert_mode*. Allowed choices are: " 2234 """absolute"" and ""relative"".");
2240 const Index& atmosphere_dim,
2246 const Index n_lat = atmosphere_dim<2 ? 1 : lat_grid.
nelem();
2247 const Index n_lon = atmosphere_dim<3 ? 1 : lon_grid.
nelem();
2249 n = n_p * n_lat * n_lon;
2259 if( y_pert.
nelem() !=
n ){
2260 throw runtime_error(
"Inconsistency in length of *y_pert* and *y*.");
2264 jacobian /= pert_size;
2276 if( ybatch[0].
nelem() != n )
2277 throw runtime_error(
"Inconsistency in length of y and ybatch[0].");
2281 jacobian(
joker,
i) = ybatch[
i];
2284 jacobian /= pert_size;
2289 const Index& atmosphere_dim,
2294 const String& particle_type,
2295 const Vector& p_ret_grid,
2296 const Vector& lat_ret_grid,
2297 const Vector& lon_ret_grid,
2298 const Index& pert_index,
2306 os <<
"Could not find " << particle_type <<
" in *particle_bulkprop_names*.\n";
2307 throw std::runtime_error(os.
str());
2310 Tensor3 original_field, perturbed_field;
2330 const Index& atmosphere_dim,
2335 const String& particle_type,
2336 const Index& pert_index,
2344 os <<
"Could not find " << particle_type <<
" in *particle_bulkprop_names*.\n";
2345 throw std::runtime_error(os.
str());
2348 Tensor3 original_field, perturbed_field;
2365 const Index& atmosphere_dim,
2371 const Vector& p_ret_grid,
2372 const Vector& lat_ret_grid,
2373 const Vector& lon_ret_grid,
2374 const Index& pert_index,
2388 os <<
"Could not find " << species <<
" in *abs_species*.\n";
2389 throw std::runtime_error(os.
str());
2392 Tensor3 original_field, perturbed_field;
2412 const Index& atmosphere_dim,
2418 const Index& pert_index,
2432 os <<
"Could not find " << species <<
" in *abs_species*.\n";
2433 throw std::runtime_error(os.
str());
2436 Tensor3 original_field, perturbed_field;
const String FREQUENCY_MAINTAG
const String SCATSPECIES_MAINTAG
INDEX Index
The type to use for all integer numbers and indices.
const String ELECTRONS_MAINTAG
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.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
void jacobianClose(Workspace &ws, Index &jacobian_do, Agenda &jacobian_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianClose.
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_grid, const Sparse &sensor_response, const Vector &sensor_time, const String &iy_unit, const Agenda &iy_main_agenda, const Agenda &geo_pos_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianCalcPointingZaRecalc.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
const String LINEMIXINGYEXPONENT_MODE
void jacobianSetFuncTransformation(ArrayOfRetrievalQuantity &jqs, const String &transformation_func, const Numeric &z_min, const Numeric &z_max, const Verbosity &)
WORKSPACE METHOD: jacobianSetFuncTransformation.
const String LINESTRENGTH_MODE
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.
const String POINTING_CALCMODE_B
Index nelem() const
Number of elements.
void Isotopologue(Index iso)
Set the Isotopologue.
const QuantumIdentifier & QuantumIdentity() const
Returns the identity of this Jacobian.
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.
const String FOREIGNPRESSURESHIFT_MODE
void jacobianAddFreqShift(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqShift.
const Index & Analytical() const
Returns the analytical tag.
bool empty() const
Returns true if variable size is zero.
QuantumIdentifier::QType Index LowerQuantumNumbers Species
const String PROPMAT_SUBSUBTAG
void check(Workspace &ws, const Verbosity &verbosity)
Checks consistency of an agenda.
Declarations having to do with the four output streams.
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.
Routines for setting up the jacobian.
Index Species() const
Molecular species index.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
const String WATERBROADENING_MODE
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.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
void jacobianAddFreqStretch(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqStretch.
const String & SubSubtag() const
Returns the sub-sub-tag.
const String POINTING_SUBTAG_A
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
const String ABSSPECIES_MAINTAG
const String LINEMIXINGY_MODE
Index ncols() const
Returns the number of columns.
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
cmplx FADDEEVA() w(cmplx z, double relerr)
void jacobianAddBasicCatalogParameter(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const QuantumIdentifier &catalog_identity, const String &catalog_parameter, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameter.
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.
ArrayOfString AllLineShapeCoeffs()
All available line shape coefficients.
void transform_jacobian(Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs)
Applies both functional and affine transformations.
void jacobianSetAffineTransformation(ArrayOfRetrievalQuantity &jqs, const Matrix &transformation_matrix, const Vector &offset_vector, const Verbosity &)
WORKSPACE METHOD: jacobianSetAffineTransformation.
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.
constexpr Index get_start() const
Returns the start index of the range.
const String LINEMIXINGG_MODE
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 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 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 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 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_grid, const Sparse &sensor_response, const Vector &sensor_time, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &)
Index nelem() const
Returns the number of elements.
Array< Vector > ArrayOfVector
An array of vectors.
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.
const String FOREIGNBROADENINGEXPONENT_MODE
const String SURFACE_MAINTAG
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.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
JacPropMatType
List of Jacobian properties for analytical line shape related derivatives.
const String MAGFIELD_MAINTAG
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. ...
const String SINEFIT_MAINTAG
const String POINTING_CALCMODE_A
The global header file for ARTS.
const String LINEMIXINGG0_MODE
void reshape(Tensor3View X, ConstVectorView x)
reshape
const String SELFBROADENING_MODE
void IntegrationOn()
Sets the integration flag to true.
const String CATALOGPARAMETER_MAINTAG
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.
_CS_string_type str() const
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, ConstVectorView f_grid, ConstMatrixView sensor_pos, ConstMatrixView sensor_los, ConstMatrixView transmitter_pos, ConstMatrixView mblock_dlos_grid, const String &iy_unit, const Agenda &iy_main_agenda, const Agenda &geo_pos_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.
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_grid, const Sparse &sensor_response, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &)
WORKSPACE METHOD: jacobianCalcFreqShift.
const String & Mode() const
Returns the mode.
void Species(Index sp)
Set the Species.
const String PRESSUREBROADENINGGAMMA_MODE
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.
const String FREQUENCY_SUBTAG_0
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_grid, 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 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.
Index nrows() const
Returns the number of rows.
QuantumIdentifier::QType Isotopologue
A tag group can consist of the sum of several of these.
const String & MainTag() const
Returns the main tag.
const String LINEMIXINGDF_MODE
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
Class to identify and match lines by their quantum numbers.
const String POINTING_MAINTAG
const String LINEMIXINGGEXPONENT_MODE
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 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.
NUMERIC Numeric
The type to use for all floating point numbers.
const String WATERBROADENINGEXPONENT_MODE
const String LINEMIXINGY1_MODE
Declarations required for the calculation of absorption coefficients.
const String SELFPRESSURESHIFT_MODE
void gridpos_poly(ArrayOfGridPosPoly &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac)
The maximum difference from 1 that we allow for a sum check.
Array< String > ArrayOfString
An array of Strings.
void PropType(const JacPropMatType t)
Sets the propagation matrix derivative type.
ArrayOfString AllLineShapeVars()
All available line shape variables.
void jacobianFromTwoY(Matrix &jacobian, const Vector &y_pert, const Vector &y, const Numeric &pert_size, const Verbosity &)
WORKSPACE METHOD: jacobianFromTwoY.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
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 FLUX_MAINTAG
This can be used to make arrays out of anything.
const String LINEMIXINGDFEXPONENT_MODE
constexpr QType Type() const
Header file for interpolation_poly.cc.
const String PARTICULATES_MAINTAG
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
void set_name(const String &nname)
Set agenda name.
void jacobianAddBasicCatalogParameters(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfQuantumIdentifier &catalog_identities, const ArrayOfString &catalog_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameters.
void resize(Index n)
Resize function.
const String LINEMIXINGY0_MODE
Array< ArrayOfIndex > ArrayOfArrayOfIndex
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.
const String POLYFIT_MAINTAG
Range get_rowindex_for_mblock(const Sparse &sensor_response, const Index &mblock_index)
Returns the "range" of y corresponding to a measurement block.
void jacobianFromYbatch(Matrix &jacobian, const ArrayOfVector &ybatch, const Vector &y, const Numeric &pert_size, const Verbosity &)
WORKSPACE METHOD: jacobianFromYbatch.
Index nelem(const Lines &l)
Number of lines.
Workspace methods and template functions for supergeneric XML IO.
const String SELFBROADENINGEXPONENT_MODE
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
void jacobianAdjustAndTransform(Matrix &jacobian, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &x, const Verbosity &)
WORKSPACE METHOD: jacobianAdjustAndTransform.
const String LINEMIXINGDF0_MODE
const String LINEMIXINGG1_MODE
const String LINECENTER_MODE
const String WATERPRESSURESHIFT_MODE
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
void jacobianOff(Index &jacobian_do, Agenda &jacobian_agenda, ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianOff.
const String FREQUENCY_SUBTAG_1
const String TEMPERATURE_MAINTAG
String SpeciesNameMain() const
Name of main species.
const String & Subtag() const
Returns the sub-tag.
Internal cloudbox functions.
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 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.
const String LINEMIXINGDF1_MODE
JacPropMatType select_derivativeLineShape(const String &var, const String &coeff)
Select the derivative that will be used in Jacobian calculations — also checks validity of var and c...
void jacobianCalcDoNothing(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Verbosity &)
WORKSPACE METHOD: jacobianCalcDoNothing.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
const String WIND_MAINTAG
void transform_x_back(Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms)
Handles back-transformations of the state vector.
const String FOREIGNBROADENING_MODE
This stores arbitrary token values and remembers the type.
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 SetAll()
Set to All identifier.
const Numeric & Perturbation() const
Returns the size of perturbation.
This file contains declerations of functions of physical character.
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.
Index nrows() const
Returns the number of rows.
void jacobianInit(ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Verbosity &)
WORKSPACE METHOD: jacobianInit.
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.
Declaration of functions in rte.cc.
void append(const String &methodname, const TokVal &keywordvalue)
Appends methods to an agenda.
void resize(Index r, Index c)
Resize function.
const String NLTE_MAINTAG