52 return os <<
"\n Main tag = " << ot.
MainTag()
53 <<
"\n Sub tag = " << ot.
Subtag()
54 <<
"\n Mode = " << ot.
Mode()
61 const bool& before_affine) {
62 jis.resize(jqs.
nelem());
71 jis[
i][0] = jis[
i - 1][1] + 1;
76 jis[
i][1] = jis[
i][0] + jq.
nelem() - 1;
88 jis[
i][0] = jis[
i - 1][1] + 1;
97 jis[
i][1] = jis[
i][0] + jq.
nelem() - 1;
122 }
else if (tfun ==
"log") {
123 for (
Index c = jis[
i][0]; c <= jis[
i][1]; ++c) {
124 jacobian(
joker, c) *= exp(x_t[c]);
126 }
else if (tfun ==
"log10") {
127 for (
Index c = jis[
i][0]; c <= jis[
i][1]; ++c) {
130 }
else if (tfun ==
"atanh") {
132 for (
Index c = jis[
i][0]; c <= jis[
i][1]; ++c) {
133 jacobian(
joker, c) *=
134 2 * (pars[1] - pars[0]) /
pow(exp(-x_t[c]) + exp(x_t[c]), 2.0);
146 Matrix jacobian_t(jacobian.
nrows(), jis_t.back()[1] + 1);
150 Index col_start = jis[
i][0];
151 Index col_extent = jis[
i][1] - jis[
i][0] + 1;
152 Range col_range(col_start, col_extent);
153 Index col_start_t = jis_t[
i][0];
154 Index col_extent_t = jis_t[
i][1] - jis_t[
i][0] + 1;
155 Range col_range_t(col_start_t, col_extent_t);
158 jacobian(
joker, col_range),
161 jacobian_t(
joker, col_range_t) = jacobian(
joker, col_range);
164 swap(jacobian_t, jacobian);
182 }
else if (tfun ==
"log") {
184 for (
Index r = jis[
i][0];
r <= jis[
i][1]; ++
r) {
185 if (x[
r] <= pars[0]) {
187 os <<
"log-transformation selected for retrieval quantity with\n" 188 <<
"index " <<
i <<
" (0-based), but at least one value <= z_min\n" 189 <<
"found for this quantity. This is not allowed.";
190 throw std::runtime_error(os.
str());
192 x[
r] = log(x[
r] - pars[0]);
194 }
else if (tfun ==
"log10") {
196 for (
Index r = jis[
i][0];
r <= jis[
i][1]; ++
r) {
199 os <<
"log10-transformation selected for retrieval quantity with\n" 200 <<
"index " <<
i <<
" (0-based), but at least one value <= z_min\n" 201 <<
"found for this quantity. This is not allowed.";
202 throw std::runtime_error(os.
str());
204 x[
r] = log10(x[
r] - pars[0]);
206 }
else if (tfun ==
"atanh") {
208 for (
Index r = jis[
i][0];
r <= jis[
i][1]; ++
r) {
209 if (x[
r] <= pars[0]) {
211 os <<
"atanh-transformation selected for retrieval quantity with\n" 212 <<
"index " <<
i <<
" (0-based), but at least one value <= z_min\n" 213 <<
"found for this quantity. This is not allowed.";
214 throw std::runtime_error(os.
str());
216 if (x[
r] >= pars[1]) {
218 os <<
"atanh-transformation selected for retrieval quantity with\n" 219 <<
"index " <<
i <<
" (0-based), but at least one value is\n" 220 <<
">= z_max. This is not allowed.";
221 throw std::runtime_error(os.
str());
223 x[
r] = atanh(2 * (x[
r] - pars[0]) / (pars[1] - pars[0]) - 1);
235 Vector x_t(jis_t.back()[1] + 1);
239 Index col_start = jis[
i][0];
240 Index col_extent = jis[
i][1] - jis[
i][0] + 1;
241 Range col_range(col_start, col_extent);
242 Index col_start_t = jis_t[
i][0];
243 Index col_extent_t = jis_t[
i][1] - jis_t[
i][0] + 1;
244 Range col_range_t(col_start_t, col_extent_t);
250 x_t[col_range_t] = x[col_range];
259 bool revert_functional_transforms) {
272 Vector x(jis.back()[1] + 1);
276 Index col_start = jis[
i][0];
277 Index col_extent = jis[
i][1] - jis[
i][0] + 1;
278 Range col_range(col_start, col_extent);
279 Index col_start_t = jis_t[
i][0];
280 Index col_extent_t = jis_t[
i][1] - jis_t[
i][0] + 1;
281 Range col_range_t(col_start_t, col_extent_t);
286 x[col_range] = x_t[col_range_t];
292 if (revert_functional_transforms) {
300 }
else if (tfun ==
"log") {
302 for (
Index r = jis[
i][0];
r <= jis[
i][1]; ++
r) {
303 x_t[
r] = pars[0] + exp(x_t[
r]);
305 }
else if (tfun ==
"log10") {
307 for (
Index r = jis[
i][0];
r <= jis[
i][1]; ++
r) {
308 x_t[
r] = pars[0] +
pow(10.0, x_t[
r]);
310 }
else if (tfun ==
"atanh") {
312 for (
Index r = jis[
i][0];
r <= jis[
i][1]; ++
r) {
313 x_t[
r] = pars[0] + ((pars[1] - pars[0]) / 2) * (1 + tanh(x_t[
r]));
330 for (
Index irow = 0; irow < diy_dx.
nrows(); irow++) {
331 for (
Index icol = 0; icol < diy_dx.
ncols(); icol++) {
332 diy_dx(irow, icol) += w * diy_dq(irow, icol);
340 const Index& atmosphere_dim,
351 assert(jacobian_quantity.
Grids().
nelem() == atmosphere_dim);
355 const Numeric extpolfac = 1.0e99;
363 p2gridpos(gp_p, jacobian_quantity.
Grids()[0], ppath_p, extpolfac);
372 if (atmosphere_dim > 1) {
373 gp_lat.resize(ppath.
np);
377 jacobian_quantity.
Grids()[1],
388 if (atmosphere_dim > 2) {
389 gp_lon.resize(ppath.
np);
390 if (jacobian_quantity.
Grids()[2].
nelem() > 1) {
392 jacobian_quantity.
Grids()[2],
402 if (atmosphere_dim == 1) {
403 for (
Index ip = 0; ip < ppath.
np; ip++) {
404 if (gp_p[ip].fd[1] > 0) {
409 if (gp_p[ip].fd[0] > 0) {
418 else if (atmosphere_dim == 2) {
419 for (
Index ip = 0; ip < ppath.
np; ip++) {
420 Index ix = nr1 * gp_lat[ip].idx + gp_p[ip].idx;
422 if (gp_lat[ip].fd[1] > 0 && gp_p[ip].fd[1] > 0)
425 gp_lat[ip].fd[1] * gp_p[ip].fd[1]);
427 if (gp_lat[ip].fd[1] > 0 && gp_p[ip].fd[0] > 0)
430 gp_lat[ip].fd[1] * gp_p[ip].fd[0]);
432 if (gp_lat[ip].fd[0] > 0 && gp_p[ip].fd[1] > 0)
435 gp_lat[ip].fd[0] * gp_p[ip].fd[1]);
437 if (gp_lat[ip].fd[0] > 0 && gp_p[ip].fd[0] > 0)
440 gp_lat[ip].fd[0] * gp_p[ip].fd[0]);
445 else if (atmosphere_dim == 3) {
446 for (
Index ip = 0; ip < ppath.
np; ip++) {
448 nr2 * nr1 * gp_lon[ip].idx + nr1 * gp_lat[ip].idx + gp_p[ip].idx;
450 if (gp_lon[ip].fd[1] > 0 && gp_lat[ip].fd[1] > 0 && gp_p[ip].fd[1] > 0)
454 gp_lon[ip].fd[1] * gp_lat[ip].fd[1] * gp_p[ip].fd[1]);
456 if (gp_lon[ip].fd[1] > 0 && gp_lat[ip].fd[1] > 0 && gp_p[ip].fd[0] > 0)
460 gp_lon[ip].fd[1] * gp_lat[ip].fd[1] * gp_p[ip].fd[0]);
462 if (gp_lon[ip].fd[1] > 0 && gp_lat[ip].fd[0] > 0 && gp_p[ip].fd[1] > 0)
466 gp_lon[ip].fd[1] * gp_lat[ip].fd[0] * gp_p[ip].fd[1]);
468 if (gp_lon[ip].fd[1] > 0 && gp_lat[ip].fd[0] > 0 && gp_p[ip].fd[0] > 0)
472 gp_lon[ip].fd[1] * gp_lat[ip].fd[0] * gp_p[ip].fd[0]);
478 if (gp_lon[ip].fd[0] > 0 && gp_lat[ip].fd[1] > 0 && gp_p[ip].fd[1] > 0)
482 gp_lon[ip].fd[0] * gp_lat[ip].fd[1] * gp_p[ip].fd[1]);
484 if (gp_lon[ip].fd[0] > 0 && gp_lat[ip].fd[1] > 0 && gp_p[ip].fd[0] > 0)
488 gp_lon[ip].fd[0] * gp_lat[ip].fd[1] * gp_p[ip].fd[0]);
490 if (gp_lon[ip].fd[0] > 0 && gp_lat[ip].fd[0] > 0 && gp_p[ip].fd[1] > 0)
494 gp_lon[ip].fd[0] * gp_lat[ip].fd[0] * gp_p[ip].fd[1]);
496 if (gp_lon[ip].fd[0] > 0 && gp_lat[ip].fd[0] > 0 && gp_p[ip].fd[0] > 0)
500 gp_lon[ip].fd[0] * gp_lat[ip].fd[0] * gp_p[ip].fd[0]);
509 const Index& atmosphere_dim,
513 assert(rtp_pos.
nelem() == atmosphere_dim);
517 const Numeric extpolfac = 1.0e99;
520 if (atmosphere_dim == 1) {
533 jacobian_quantity.
Grids()[0],
544 if (atmosphere_dim > 2) {
546 if (jacobian_quantity.
Grids()[1].
nelem() > 1) {
548 jacobian_quantity.
Grids()[1],
558 if (atmosphere_dim == 2) {
559 if (gp_lat[0].fd[1] > 0) {
564 if (gp_lat[0].fd[0] > 0) {
572 Index ix = nr1 * gp_lon[0].idx + gp_lat[0].idx;
574 if (gp_lon[0].fd[1] > 0 && gp_lat[0].fd[1] > 0)
577 gp_lon[0].fd[1] * gp_lat[0].fd[1]);
579 if (gp_lon[0].fd[1] > 0 && gp_lat[0].fd[0] > 0)
582 gp_lon[0].fd[1] * gp_lat[0].fd[0]);
584 if (gp_lon[0].fd[0] > 0 && gp_lat[0].fd[1] > 0)
587 gp_lon[0].fd[0] * gp_lat[0].fd[1]);
589 if (gp_lon[0].fd[0] > 0 && gp_lat[0].fd[0] > 0)
592 gp_lon[0].fd[0] * gp_lat[0].fd[0]);
604 const Index& cloudbox_on,
608 if (jacobian_quantities[iq].MainTag() == TEMPERATURE_MAINTAG &&
609 jacobian_quantities[iq].SubSubtag() == PROPMAT_SUBSUBTAG) {
613 if (jacobian_quantities[iq].MainTag() == ABSSPECIES_MAINTAG) {
614 if (jacobian_quantities[iq].SubSubtag() == PROPMAT_SUBSUBTAG) {
615 bool test_available =
false;
616 for (
Index ii = 0; ii < abs_species.
nelem(); ii++) {
617 if (abs_species[ii][0].
Species() ==
619 test_available =
true;
620 abs_species_i[iq] = ii;
624 if (!test_available) {
626 os <<
"Could not find " << jacobian_quantities[iq].Subtag()
627 <<
" in species of abs_species.\n";
628 throw std::runtime_error(os.
str());
633 abs_species_i[iq] =
chk_contains(
"abs_species", abs_species, atag);
635 }
else if (jacobian_quantities[iq].MainTag() == PARTICULATES_MAINTAG ||
636 jacobian_quantities[iq].MainTag() == ELECTRONS_MAINTAG) {
637 abs_species_i[iq] = -9999;
638 }
else { abs_species_i[iq] = -1; }
641 jacobian_quantities[iq].MainTag() == SCATSPECIES_MAINTAG) {
643 find_first(scat_species, jacobian_quantities[iq].Subtag());
644 if (scat_species_i[iq] < 0) {
646 os <<
"Jacobian quantity with index " << iq <<
" refers to\n" 647 <<
" " << jacobian_quantities[iq].Subtag()
648 <<
"\nbut this species could not be found in *scat_species*.";
649 throw runtime_error(os.
str());
651 }
else { scat_species_i[iq] = -1; }
653 if (jacobian_quantities[iq].MainTag() == WIND_MAINTAG &&
656 char c = jacobian_quantities[iq].Subtag()[0];
664 else if (test == (
Index(
's') - 116))
668 if (jacobian_quantities[iq].MainTag() == MAGFIELD_MAINTAG &&
669 jacobian_quantities[iq].SubSubtag() == PROPMAT_SUBSUBTAG) {
671 char c = jacobian_quantities[iq].Subtag()[0];
679 else if (test == (
Index(
's') - 116))
698 const String& p_retr_name,
699 const String& lat_retr_name,
700 const String& lon_retr_name,
702 assert(grids.
nelem() == dim);
704 if (p_retr.
nelem() == 0) {
705 os <<
"The grid vector *" << p_retr_name <<
"* is empty," 706 <<
" at least one pressure level\n" 707 <<
"should be specified.";
710 os <<
"The pressure grid vector *" << p_retr_name <<
"* is not a\n" 711 <<
"strictly decreasing vector, which is required.";
714 if (p_grid[0] not_eq p_retr[0]) {
715 os <<
"Mismatching 1-long grids for " << p_retr_name;
721 }
else if (log(p_retr[0]) > 1.5 * log(p_grid[0]) - 0.5 * log(p_grid[1]) ||
722 log(p_retr[p_retr.
nelem() - 1]) <
723 1.5 * log(p_grid[p_grid.
nelem() - 1]) -
724 0.5 * log(p_grid[p_grid.
nelem() - 2])) {
725 os <<
"The grid vector *" << p_retr_name <<
"* is not covered by the\n" 726 <<
"corresponding atmospheric grid.";
735 if (lat_retr.
nelem() == 0) {
736 os <<
"The grid vector *" << lat_retr_name <<
"* is empty," 737 <<
" at least one latitude\n" 738 <<
"should be specified for a 2D/3D atmosphere.";
741 os <<
"The latitude grid vector *" << lat_retr_name <<
"* is not a\n" 742 <<
"strictly increasing vector, which is required.";
744 }
else if (lat_grid.
nelem() == 1 and lat_grid.
nelem() == lat_retr.
nelem()) {
745 if (lat_grid[0] not_eq lat_retr[0]) {
746 os <<
"Mismatching 1-long grids for " << lat_retr_name;
752 }
else if (lat_retr[0] < 1.5 * lat_grid[0] - 0.5 * lat_grid[1] ||
753 lat_retr[lat_retr.
nelem() - 1] >
754 1.5 * lat_grid[lat_grid.
nelem() - 1] -
755 0.5 * lat_grid[lat_grid.
nelem() - 2]) {
756 os <<
"The grid vector *" << lat_retr_name <<
"* is not covered by the\n" 757 <<
"corresponding atmospheric grid.";
765 if (lon_retr.
nelem() == 0) {
766 os <<
"The grid vector *" << lon_retr_name <<
"* is empty," 767 <<
" at least one longitude\n" 768 <<
"should be specified for a 3D atmosphere.";
771 os <<
"The longitude grid vector *" << lon_retr_name <<
"* is not a\n" 772 <<
"strictly increasing vector, which is required.";
774 }
else if (lon_grid.
nelem() == 1 and
776 if (lon_grid[0] not_eq lon_retr[0]) {
777 os <<
"Mismatching 1-long grids for " << lon_retr_name;
783 }
else if (lon_retr[0] < 1.5 * lon_grid[0] - 0.5 * lon_grid[1] ||
784 lon_retr[lon_retr.
nelem() - 1] >
785 1.5 * lon_grid[lon_grid.
nelem() - 1] -
786 0.5 * lon_grid[lon_grid.
nelem() - 2]) {
787 os <<
"The grid vector *" << lon_retr_name
788 <<
"* is not covered by the\n" 789 <<
"corresponding atmospheric grid.";
806 const String& lat_retr_name,
807 const String& lon_retr_name,
819 if (lat_retr.
nelem() == 0) {
820 os <<
"The grid vector *" << lat_retr_name <<
"* is empty," 821 <<
" at least one latitude\n" 822 <<
"should be specified for a 2D/3D atmosphere.";
825 os <<
"The latitude grid vector *" << lat_retr_name <<
"* is not a\n" 826 <<
"strictly increasing vector, which is required.";
828 }
else if (lat_grid.
nelem() == 1 and lat_grid.
nelem() == lat_retr.
nelem()) {
829 if (lat_grid[0] not_eq lat_retr[0]) {
830 os <<
"Mismatching 1-long grids for " << lat_retr_name;
836 }
else if (lat_retr[0] < 1.5 * lat_grid[0] - 0.5 * lat_grid[1] ||
837 lat_retr[lat_retr.
nelem() - 1] >
838 1.5 * lat_grid[lat_grid.
nelem() - 1] -
839 0.5 * lat_grid[lat_grid.
nelem() - 2]) {
840 os <<
"The grid vector *" << lat_retr_name <<
"* is not covered by the\n" 841 <<
"corresponding atmospheric grid.";
850 if (lon_retr.
nelem() == 0) {
851 os <<
"The grid vector *" << lon_retr_name <<
"* is empty," 852 <<
" at least one longitude\n" 853 <<
"should be specified for a 3D atmosphere.";
856 os <<
"The longitude grid vector *" << lon_retr_name <<
"* is not a\n" 857 <<
"strictly increasing vector, which is required.";
859 }
else if (lon_grid.
nelem() == 1 and
861 if (lon_grid[0] not_eq lon_retr[0]) {
862 os <<
"Mismatching 1-long grids for " << lon_retr_name;
868 }
else if (lon_retr[0] < 1.5 * lon_grid[0] - 0.5 * lon_grid[1] ||
869 lon_retr[lon_retr.
nelem() - 1] >
870 1.5 * lon_grid[lon_grid.
nelem() - 1] -
871 0.5 * lon_grid[lon_grid.
nelem() - 2]) {
872 os <<
"The grid vector *" << lon_retr_name
873 <<
"* is not covered by the\n" 874 <<
"corresponding atmospheric grid.";
887 if (gp[
i].fd[0] < 0) {
890 }
else if (gp[
i].fd[0] > 1) {
899 const Index& poly_coeff) {
902 assert(l > poly_coeff);
906 if (poly_coeff == 0) {
913 b[
i] = (x[
i] - xmin) / dx - 1.0;
914 b[
i] =
pow(b[
i],
int(poly_coeff));
923 const Index& mblock_index,
924 const Sparse& sensor_response,
926 const Vector& sensor_response_f_grid,
927 const Matrix& sensor_response_dlos_grid,
929 const Index rq_index,
931 bool is_sine_fit =
false;
938 "Retrieval quantity is neither a polynomial or a sine " 944 const Index nf = sensor_response_f_grid.
nelem();
945 const Index npol = sensor_response_pol_grid.
nelem();
946 const Index nlos = sensor_response_dlos_grid.
nrows();
954 for (
Index f = 0; f < nf; f++) {
955 Numeric a = (sensor_response_f_grid[f] - sensor_response_f_grid[0]) * 2 *
963 w, sensor_response_f_grid, static_cast<Index>(poly_coeff));
973 Index col4 = jacobian_indices[rq_index][0];
976 col4 += mblock_index * n2 * n1;
979 for (
Index l = 0; l < nlos; l++) {
980 const Index row3 = row4 + l * nf * npol;
981 const Index col3 = col4 + l * n1 * (is_sine_fit ? 2 : 1);
983 for (
Index f = 0; f < nf; f++) {
984 const Index row2 = row3 + f * npol;
986 for (
Index p = 0; p < npol; p++) {
992 y_baseline[row2 + p] += x[col1] * s[f] + x[col1 + 1] * c[f];
994 y_baseline[row2 + p] += w[f] * x[col1];
1006 if (unit ==
"rel" || unit ==
"logrel") {
1008 }
else if (unit ==
"vmr") {
1014 }
else if (unit ==
"nd") {
1022 os <<
"Allowed options for gas species jacobians are " 1023 "\"rel\", \"vmr\" and \"nd\".\nYou have selected: " 1024 << unit << std::endl;
1025 throw std::runtime_error(os.
str());
1034 if (unit ==
"rel" || unit ==
"logrel") {
1036 }
else if (unit ==
"vmr") {
1038 }
else if (unit ==
"nd") {
1042 os <<
"Allowed options for gas species jacobians are " 1043 "\"rel\", \"vmr\" and \"nd\".\nYou have selected: " 1044 << unit << std::endl;
1045 throw std::runtime_error(os.
str());
1058 const Index stokes_dim,
1059 const bool transmission_only) {
1075 Vector a(stokes_dim), b(stokes_dim);
1079 if (not transmission_only) {
1083 mult(diy1, cumulative_transmission, a);
1087 if (not transmission_only) {
1091 mult(b, cumulative_transmission, a);
1101 pos.reserve(js.
nelem());
1108 const Index i) noexcept {
1110 for (
Index k = 0; k <=
i; k++)
1137 #define ISLINESHAPETYPE(X) \ 1138 bool is_pressure_broadening_##X(const RetrievalQuantity& t) noexcept { \ 1139 return t == JacPropMatType::LineShape##X##X0 or \ 1140 t == JacPropMatType::LineShape##X##X1 or \ 1141 t == JacPropMatType::LineShape##X##X2; \ 1152 #undef ISLINESHAPETYPE 1154 #define VARISLINESHAPEPARAM(X, Y) (t == JacPropMatType::LineShape##X##Y) 1178 #undef VARISLINESHAPEPARAM 1209 if (std::any_of(js.cbegin(), js.cend(), [](
auto& j){
return is_line_parameter(j);}))
1210 throw std::runtime_error(
"Line specific parameters are not supported while using continuum tags.\nWe do not track what lines are in the continuum.\n");
1219 if (std::any_of(js.cbegin(), js.cend(), [](
auto& j){
return is_line_parameter(j);}))
1220 throw std::runtime_error(
"Line specific parameters are not supported while\n using the relaxation matrix line mixing routine.\n We do not yet track individual lines in the relaxation matrix calculations.\n");
1225 if (std::any_of(js.cbegin(), js.cend(), [](
auto& j){
return is_line_parameter(j);}))
1226 throw std::runtime_error(
"Line specific parameters are not supported while using Lookup table.\nWe do not track lines in the Lookup.\n");
1232 throw std::runtime_error(
"This method does not yet support Zeeman-style magnetic Jacobian calculations.\n Please use u, v, and w Jacobians instead.\n");
1246 for (
const auto& s : ast) {
1256 if (ast not_eq test)
1269 const Index species,
1285 auto p = std::find_if(js.cbegin(), js.cend(), [&line_qid](
auto& j){
return j ==
JacPropMatType::VMR and j.QuantumIdentity().In(line_qid);});
1286 if (p not_eq js.cend())
1287 return {
true, p -> QuantumIdentity()};
1289 return {
false, line_qid};
1306 if (p not_eq js.cend())
1307 return p -> Perturbation();
1314 if (p not_eq js.cend())
1315 return p -> Perturbation();
1322 if (p not_eq js.cend())
1323 return p -> Perturbation();
1329 #define lineshapevariable(X1, X2) \ 1330 JacPropMatType::LineShape##X1##X2 : return "Line-Shape: " #X1 " " #X2 1335 return "Electrons-VMR";
1337 return "Particulate-VMR";
1339 return "Temperature";
1341 return "Magnetic-Strength";
1343 return "Magnetic-u";
1345 return "Magnetic-v";
1347 return "Magnetic-w";
1349 return "Wind-Strength";
1359 return "Line-Strength";
1361 return "Line-Center";
1363 return "Line-Special-Parameter-1";
1365 return "NLTE-Level";
1403 return "Not-A-Prop-Mat-Variable";
1405 #undef lineshapevariable 1407 return "UNDEFINED-CHECK-IF-CASE-LIST-IS-COMPLETE";
void iso(Array< IsotopologueRecord >::iterator &ii, String name, const ArrayOfNumeric &coeff, const ArrayOfNumeric &temp_range, const Index &coefftype)
Initialize isotopologue and move iterator to next one.
INDEX Index
The type to use for all integer numbers and indices.
bool is_pressure_broadening_G0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
bool is_pressure_broadening_Y(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a Y derivative.
ArrayOfIndex equivalent_propmattype_indexes(const ArrayOfRetrievalQuantity &js)
Returns a list of positions for the derivatives in Propagation Matrix calculations.
const String SINEFIT_MAINTAG
void diy_from_pos_to_rgrids(Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstMatrixView diy_dpos, const Index &atmosphere_dim, ConstVectorView rtp_pos)
diy_from_pos_to_rgrids
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
bool supports_LBL_without_phase(const ArrayOfRetrievalQuantity &js)
Returns if the array supports line-by-line derivatives without requiring the phase.
JacPropMatType PropMatType() const
Returns the propagation matrix derivative type.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
const String TEMPERATURE_MAINTAG
const String FLUX_MAINTAG
Index nelem() const
Number of elements.
void Isotopologue(Index iso)
Set the Isotopologue.
bool is_pressure_broadening_D0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D0 derivative.
const QuantumIdentifier & QuantumIdentity() const
Returns the identity of this Jacobian.
const Index & Analytical() const
Returns the analytical tag.
const String POLYFIT_MAINTAG
QuantumIdentifier::QType Index LowerQuantumNumbers Species
bool do_magnetic_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a magnetic derivative.
Routines for setting up the jacobian.
Index Species() const
Molecular species index.
bool is_line_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is related to the absorption line.
Numeric frequency_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the frequency perturbation if it exists.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
bool supports_relaxation_matrix(const ArrayOfRetrievalQuantity &js)
Returns if the array supports relaxation matrix derivatives.
void from_dpath_to_dx(MatrixView diy_dx, ConstMatrixView diy_dq, const Numeric &w)
const String PARTICULATES_MAINTAG
const String ABSSPECIES_MAINTAG
Linear algebra functions.
const Vector & OffsetVector() const
bool do_line_center_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a line center derivative.
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
#define ISLINESHAPETYPE(X)
cmplx FADDEEVA() w(cmplx z, double relerr)
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.
Matrix pos
The distance between start pos and the last position in pos.
void transform_jacobian(Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs)
Applies both functional and affine transformations.
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
Calculates grid positions for pressure values.
const String WIND_MAINTAG
void get_pointers_for_analytical_jacobians(ArrayOfIndex &abs_species_i, ArrayOfIndex &scat_species_i, ArrayOfIndex &is_t, ArrayOfIndex &wind_i, ArrayOfIndex &magfield_i, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfArrayOfSpeciesTag &abs_species, const Index &cloudbox_on, const ArrayOfString &scat_species)
Help function for analytical jacobian calculations.
constexpr Index get_start() const
Returns the start index of the range.
#define FOR_ANALYTICAL_JACOBIANS_DO(what_to_do)
Numeric number_density(const Numeric &p, const Numeric &t)
number_density
bool supports_continuum(const ArrayOfRetrievalQuantity &js)
Returns if the array supports continuum derivatives.
Index nelem() const
Returns the number of elements.
Index equivalent_propmattype_index(const ArrayOfRetrievalQuantity &js, const Index i) noexcept
Returns a list of positions for the derivatives in Propagation Matrix calculations.
const Array< SpeciesRecord > species_data
Species Data.
Array< Index > ArrayOfIndex
An array of Index.
bool is_pressure_broadening_FVC(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a FVC derivative.
void calcBaselineFit(Vector &y_baseline, const Vector &x, const Index &mblock_index, const Sparse &sensor_response, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const RetrievalQuantity &rq, const Index rq_index, const ArrayOfArrayOfIndex &jacobian_indices)
Calculate baseline fit.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Numeric magnetic_field_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the magnetic field perturbation if it exists.
bool is_frequency_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations.
const Array< IsotopologueRecord > & Isotopologue() const
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. ...
bool supports_CIA(const ArrayOfRetrievalQuantity &js)
Returns if the array supports CIA derivatives.
Index ncols() const
Returns the number of columns.
const String PROPMAT_SUBSUBTAG
bool supports_propmat_clearsky(const ArrayOfRetrievalQuantity &js)
Returns if the array supports propagation matrix derivatives.
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
The global header file for ARTS.
bool supports_hitran_xsec(const ArrayOfRetrievalQuantity &js)
Returns if the array supports HITRAN cross-section derivatives.
bool is_derived_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a derived magnetic parameter.
ostream & operator<<(ostream &os, const RetrievalQuantity &ot)
Output operator for RetrievalQuantity.
bool is_pressure_broadening_D2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D2 derivative.
_CS_string_type str() const
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
String propmattype_string(const RetrievalQuantity &rq)
Returns a string of the retrieval quantity propagation matrix type.
void vmrunitscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
Scale factor for conversion between gas species units.
const Matrix & TransformationMatrix() const
const String & Mode() const
Returns the mode.
void Species(Index sp)
Set the Species.
Contains the lookup data for one species.
const String MAGFIELD_MAINTAG
A tag group can consist of the sum of several of these.
bool Integration() const
Do integration?
const String & MainTag() const
Returns the main tag.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
bool is_nlte_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a NLTE parameter.
Class to identify and match lines by their quantum numbers.
jacobianVMRcheck do_vmr_jacobian(const ArrayOfRetrievalQuantity &js, const QuantumIdentifier &line_qid) noexcept
Returns the required info for VMR Jacobian.
bool is_lineshape_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC, Y, G, DV derivative.
Numeric temperature_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the temperature perturbation if it exists.
NUMERIC Numeric
The type to use for all floating point numbers.
void jacobian_type_extrapol(ArrayOfGridPos &gp)
Adopts grid positions to extrapolation used for jacobians.
bool is_pressure_broadening_G(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G derivative.
void get_diydx(VectorView diy1, VectorView diy2, ConstMatrixView ImT, ConstMatrixView cumulative_transmission, ConstMatrixView dT1, ConstMatrixView dT2, ConstVectorView iYmJ, ConstVectorView dJ1, ConstVectorView dJ2, const Index stokes_dim, const bool transmission_only)
bool do_temperature_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants the temperature derivative.
bool is_lineshape_parameter_X0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X0 derivative.
Header file for special_interp.cc.
Numeric pow(const Rational base, Numeric exp)
Power of.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
const String & TransformationFunc() const
bool supports_lookup(const ArrayOfRetrievalQuantity &js)
Returns if the array supports lookup table derivatives.
bool species_match(const RetrievalQuantity &rq, const ArrayOfSpeciesTag &ast)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags...
bool is_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a magnetic parameter.
void dxdvmrscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
Scale factor for conversion of derivatives with respect to VMR.
void transform_x(Vector &x, const ArrayOfRetrievalQuantity &jqs)
Handles transformations of the state vector.
Index npages() const
Returns the number of pages.
constexpr QType Type() const
const Vector & TFuncParameters() const
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
#define lineshapevariable(X1, X2)
bool is_lineshape_parameter_X1(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X1 derivative.
void resize(Index n)
Resize function.
bool is_lineshape_parameter_X2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X2 derivative.
A constant view of a Tensor3.
A constant view of a Vector.
Index np
Number of points describing the ppath.
const String SCATSPECIES_MAINTAG
void diy_from_path_to_rgrids(Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstTensor3View diy_dpath, const Index &atmosphere_dim, const Ppath &ppath, ConstVectorView ppath_p)
Maps jacobian data for points along the propagation path, to jacobian retrieval grid data...
Range get_rowindex_for_mblock(const Sparse &sensor_response, const Index &mblock_index)
Returns the "range" of y corresponding to a measurement block.
Numeric mean(const ConstVectorView &x)
Mean function, vector version.
const String ELECTRONS_MAINTAG
#define VARISLINESHAPEPARAM(X, Y)
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
A constant view of a Matrix.
bool supports_faraday(const ArrayOfRetrievalQuantity &js)
Returns if the array supports Faraday derivatives.
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
bool species_iso_match(const RetrievalQuantity &rq, const Index species, const Index iso)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags...
bool is_lineshape_parameter_bar_linemixing(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC derivative.
bool is_wind_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a wind parameter.
Deals with whether or not we should do a VMR derivative.
The structure to describe a propagation path and releated quantities.
Index nelem() const
Number of elements in the grids.
const String & Subtag() const
Returns the sub-tag.
const Numeric NAT_LOG_TEN
bool supports_particles(const ArrayOfRetrievalQuantity &js)
Returns if the array supports particulate derivatives.
void transform_x_back(Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms)
Handles back-transformations of the state vector.
bool is_pressure_broadening_G2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
bool is_pressure_broadening_ETA(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a ETA derivative.
bool do_frequency_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a frequency derivative.
This file contains declerations of functions of physical character.
Index nrows() const
Returns the number of rows.
bool is_pressure_broadening_DV(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a DV derivative.
Declaration of functions in rte.cc.
void gp4length1grid(ArrayOfGridPos &gp)
Grid position matching a grid of length 1.