Go to the documentation of this file.
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) {
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) {
134 2 * (pars[1] - pars[0]) /
pow(exp(-x_t[c]) + exp(x_t[c]), 2.0);
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);
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) {
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);
355 const Numeric extpolfac = 1.0e99;
363 p2gridpos(gp_p, jacobian_quantity.
Grids()[0], ppath_p, extpolfac);
373 gp_lat.resize(
ppath.np);
377 jacobian_quantity.
Grids()[1],
389 gp_lon.resize(
ppath.np);
390 if (jacobian_quantity.
Grids()[2].
nelem() > 1) {
392 jacobian_quantity.
Grids()[2],
404 if (gp_p[ip].fd[1] > 0) {
409 if (gp_p[ip].fd[0] > 0) {
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]);
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]);
517 const Numeric extpolfac = 1.0e99;
533 jacobian_quantity.
Grids()[0],
546 if (jacobian_quantity.
Grids()[1].
nelem() > 1) {
548 jacobian_quantity.
Grids()[1],
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]);
610 is_t[iq] =
Index(JacobianType::Temperature);
611 }
else { is_t[iq] =
Index(JacobianType::None); }
615 bool test_available =
false;
619 test_available =
true;
620 abs_species_i[iq] = ii;
624 if (!test_available) {
627 <<
" in species of abs_species.\n";
628 throw std::runtime_error(os.str());
637 abs_species_i[iq] = -9999;
638 }
else { abs_species_i[iq] = -1; }
644 if (scat_species_i[iq] < 0) {
646 os <<
"Jacobian quantity with index " << iq <<
" refers to\n"
648 <<
"\nbut this species could not be found in *scat_species*.";
649 throw runtime_error(os.str());
651 }
else { scat_species_i[iq] = -1; }
659 wind_i[iq] =
Index(JacobianType::WindFieldU);
661 wind_i[iq] =
Index(JacobianType::WindFieldV);
663 wind_i[iq] =
Index(JacobianType::WindFieldW);
664 else if (test == (
Index(
's') - 116))
665 wind_i[iq] =
Index(JacobianType::AbsWind);
666 }
else { wind_i[iq] =
Index(JacobianType::None); }
674 magfield_i[iq] =
Index(JacobianType::MagFieldU);
676 magfield_i[iq] =
Index(JacobianType::MagFieldV);
678 magfield_i[iq] =
Index(JacobianType::MagFieldW);
679 else if (test == (
Index(
's') - 116))
680 magfield_i[iq] =
Index(JacobianType::AbsMag);
681 }
else { magfield_i[iq] =
Index(JacobianType::None); }
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]) <
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.";
745 if (
lat_grid[0] not_eq lat_retr[0]) {
746 os <<
"Mismatching 1-long grids for " << lat_retr_name;
753 lat_retr[lat_retr.
nelem() - 1] >
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;
784 lon_retr[lon_retr.
nelem() - 1] >
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.";
829 if (
lat_grid[0] not_eq lat_retr[0]) {
830 os <<
"Mismatching 1-long grids for " << lat_retr_name;
837 lat_retr[lat_retr.
nelem() - 1] >
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;
869 lon_retr[lon_retr.
nelem() - 1] >
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) {
900 const Index l =
x.nelem();
902 assert(l > poly_coeff);
906 if (poly_coeff == 0) {
912 for (
Index i = 0; i < l; i++) {
913 b[i] = (
x[i] - xmin) /
dx - 1.0;
914 b[i] =
pow(b[i],
int(poly_coeff));
929 const Index rq_index,
931 bool is_sine_fit =
false;
938 "Retrieval quantity is neither a polynomial or a sine "
954 for (
Index f = 0; f < nf; f++) {
973 Index col4 = jacobian_indices[rq_index][0];
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];
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());
1059 const bool transmission_only) {
1079 if (not transmission_only) {
1087 if (not transmission_only) {
1101 pos.reserve(js.
nelem());
1108 const Index i) noexcept {
1110 for (
Index k = 0; k <= i; k++)
1116 return t == JacPropMatType::WindMagnitude or t == JacPropMatType::WindU or
1117 t == JacPropMatType::WindV or t == JacPropMatType::WindW;
1125 return t == JacPropMatType::MagneticMagnitude;
1129 return t == JacPropMatType::MagneticU or t == JacPropMatType::MagneticV or
1134 return t == JacPropMatType::NLTE;
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
1196 return t == JacPropMatType::LineCenter or t == JacPropMatType::LineStrength or
1201 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return (j == JacPropMatType::Temperature or j == JacPropMatType::VMR or is_frequency_parameter(j));});
1205 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return (j == JacPropMatType::Temperature or j == JacPropMatType::VMR or is_frequency_parameter(j));});
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");
1211 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return (j == JacPropMatType::Temperature or j == JacPropMatType::VMR or is_frequency_parameter(j));});
1215 return not std::any_of(js.cbegin(), js.cend(), [](
auto& j){return j not_eq JacPropMatType::VMR or j not_eq JacPropMatType::LineStrength or not is_nlte_parameter(j);});
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");
1221 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return (j == JacPropMatType::Temperature or is_frequency_parameter(j));});
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");
1227 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return (j == JacPropMatType::Temperature or j == JacPropMatType::VMR or is_frequency_parameter(j));});
1231 if (std::any_of(js.cbegin(), js.cend(), [](
auto& j){return is_derived_magnetic_parameter(j);}))
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");
1233 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return j == JacPropMatType::MagneticU or j == JacPropMatType::MagneticV or j == JacPropMatType::MagneticW or j == JacPropMatType::Electrons or is_frequency_parameter(j);});
1237 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return j not_eq JacPropMatType::NotPropagationMatrixType;});
1241 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return j not_eq JacPropMatType::NotPropagationMatrixType;});
1246 for (
const auto& s : ast) {
1256 if (ast not_eq test)
1263 if (rq == JacPropMatType::VMR)
1269 const Index species,
1280 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return j == JacPropMatType::Temperature;});
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};
1293 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return j == JacPropMatType::LineCenter;});
1297 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return is_frequency_parameter(j);});
1301 return std::any_of(js.cbegin(), js.cend(), [](
auto& j){return is_magnetic_parameter(j);});
1305 auto p = std::find_if(js.cbegin(), js.cend(), [](
auto& j){return j == JacPropMatType::Temperature;});
1306 if (p not_eq js.cend())
1307 return p -> Perturbation();
1313 auto p = std::find_if(js.cbegin(), js.cend(), [](
auto& j){return is_frequency_parameter(j);});
1314 if (p not_eq js.cend())
1315 return p -> Perturbation();
1321 auto p = std::find_if(js.cbegin(), js.cend(), [](
auto& j){return is_magnetic_parameter(j);});
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
1332 case JacPropMatType::VMR:
1334 case JacPropMatType::Electrons:
1335 return "Electrons-VMR";
1336 case JacPropMatType::Particulates:
1337 return "Particulate-VMR";
1338 case JacPropMatType::Temperature:
1339 return "Temperature";
1340 case JacPropMatType::MagneticMagnitude:
1341 return "Magnetic-Strength";
1342 case JacPropMatType::MagneticU:
1343 return "Magnetic-u";
1344 case JacPropMatType::MagneticV:
1345 return "Magnetic-v";
1346 case JacPropMatType::MagneticW:
1347 return "Magnetic-w";
1348 case JacPropMatType::WindMagnitude:
1349 return "Wind-Strength";
1350 case JacPropMatType::WindU:
1352 case JacPropMatType::WindV:
1354 case JacPropMatType::WindW:
1356 case JacPropMatType::Frequency:
1358 case JacPropMatType::LineStrength:
1359 return "Line-Strength";
1360 case JacPropMatType::LineCenter:
1361 return "Line-Center";
1362 case JacPropMatType::LineSpecialParameter1:
1363 return "Line-Special-Parameter-1";
1364 case JacPropMatType::NLTE:
1365 return "NLTE-Level";
1403 return "Not-A-Prop-Mat-Variable";
1405 #undef lineshapevariable
1407 return "UNDEFINED-CHECK-IF-CASE-LIST-IS-COMPLETE";
bool supports_continuum(const ArrayOfRetrievalQuantity &js)
Returns if the array supports continuum derivatives.
Index atmosphere_dim(Workspace &ws) noexcept
jacobianVMRcheck do_vmr_jacobian(const ArrayOfRetrievalQuantity &js, const QuantumIdentifier &line_qid) noexcept
Returns the required info for VMR Jacobian.
std::size_t pos() const noexcept
Range get_rowindex_for_mblock(const Sparse &sensor_response, const Index &mblock_index)
Returns the "range" of y corresponding to a measurement block.
Matrix sensor_response_dlos_grid(Workspace &ws) noexcept
Numeric magnetic_field_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the magnetic field perturbation if it exists.
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)
void Isotopologue(Index iso)
Set the Isotopologue.
const Index & Analytical() const
Returns the analytical tag.
const Numeric NAT_LOG_TEN
bool is_pressure_broadening_Y(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a Y derivative.
Class to identify and match lines by their quantum numbers.
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Complex w(Complex z) noexcept
The Faddeeva function.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
bool is_derived_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a derived magnetic parameter.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
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.
#define lineshapevariable(X1, X2)
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_X1(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X1 derivative.
ostream & operator<<(ostream &os, const RetrievalQuantity &ot)
Output operator for RetrievalQuantity.
Sparse sensor_response(Workspace &ws) noexcept
#define VARISLINESHAPEPARAM(X, Y)
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
Calculates grid positions for pressure values.
void jacobian_type_extrapol(ArrayOfGridPos &gp)
Adopts grid positions to extrapolation used for jacobians.
Vector lat_grid(Workspace &ws) noexcept
const QuantumIdentifier & QuantumIdentity() const
Returns the identity of this Jacobian.
Vector y_baseline(Workspace &ws) noexcept
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
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)
Numeric temperature_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the temperature perturbation if it exists.
void swap(ComplexVector &v1, ComplexVector &v2)
Swaps two objects.
void vmrunitscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
Scale factor for conversion between gas species units.
void resize(Index n)
Resize function.
ArrayOfTensor3 diy_dx(Workspace &ws) noexcept
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.
bool is_nlte_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a NLTE parameter.
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
const String ELECTRONS_MAINTAG
bool supports_lookup(const ArrayOfRetrievalQuantity &js)
Returns if the array supports lookup table derivatives.
bool is_pressure_broadening_FVC(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a FVC derivative.
QuantumIdentifier::QType Index LowerQuantumNumbers Species
Index stokes_dim(Workspace &ws) noexcept
bool supports_particles(const ArrayOfRetrievalQuantity &js)
Returns if the array supports particulate derivatives.
bool is_pressure_broadening_DV(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a DV derivative.
const Vector & OffsetVector() const
#define FOR_ANALYTICAL_JACOBIANS_DO(what_to_do)
bool do_temperature_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants the temperature derivative.
const Array< SpeciesRecord > species_data
Species Data.
bool is_lineshape_parameter_X2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X2 derivative.
The structure to describe a propagation path and releated quantities.
Numeric frequency_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the frequency perturbation if it exists.
bool is_wind_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a wind 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.
bool is_pressure_broadening_D0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D0 derivative.
Index npages() const
Returns the number of pages.
constexpr Index get_start() const
Returns the start index of the range.
void transform_x_back(Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms)
Handles back-transformations of the state vector.
bool supports_LBL_without_phase(const ArrayOfRetrievalQuantity &js)
Returns if the array supports line-by-line derivatives without requiring the phase.
bool is_pressure_broadening_G0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
const String MAGFIELD_MAINTAG
Numeric pow(const Rational base, Numeric exp)
Power of.
A tag group can consist of the sum of several of these.
Numeric number_density(const Numeric &p, const Numeric &t)
number_density
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
const Matrix & TransformationMatrix() const
bool is_magnetic_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a magnetic parameter.
void transform_x(Vector &x, const ArrayOfRetrievalQuantity &jqs)
Handles transformations of the state vector.
const String SCATSPECIES_MAINTAG
void Species(Index sp)
Set the Species.
Index ncols() const
Returns the number of columns.
const String POLYFIT_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
ArrayOfIndex equivalent_propmattype_indexes(const ArrayOfRetrievalQuantity &js)
Returns a list of positions for the derivatives in Propagation Matrix calculations.
bool Integration() const
Do integration?
const String & MainTag() const
Returns the main tag.
Index nelem() const
Returns the number of elements.
Array< Index > ArrayOfIndex
An array of Index.
This file contains declerations of functions of physical character.
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Numeric mean(const ConstVectorView &x)
Mean function, vector version.
bool is_lineshape_parameter_bar_linemixing(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0, D0, G2, D2, ETA, FVC derivative.
Vector p_grid(Workspace &ws) noexcept
Ppath ppath(Workspace &ws) noexcept
const String & Mode() const
Returns the mode.
Routines for setting up the jacobian.
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
bool do_frequency_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a frequency derivative.
const String FLUX_MAINTAG
const String TEMPERATURE_MAINTAG
Vector sensor_response_f_grid(Workspace &ws) noexcept
void calcBaselineFit(Vector &y_baseline, const Vector &x, const Index &mblock_index, const Sparse &sensor_response, const ArrayOfIndex &sensor_response_pol_grid, const Vector &sensor_response_f_grid, const Matrix &sensor_response_dlos_grid, const RetrievalQuantity &rq, const Index rq_index, const ArrayOfArrayOfIndex &jacobian_indices)
Calculate baseline fit.
bool is_pressure_broadening_G(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G derivative.
bool is_line_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is related to the absorption line.
Contains the lookup data for one species.
Vector lon_grid(Workspace &ws) noexcept
A constant view of a Matrix.
constexpr QType Type() const
bool supports_faraday(const ArrayOfRetrievalQuantity &js)
Returns if the array supports Faraday derivatives.
bool is_pressure_broadening_D2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a D2 derivative.
ArrayOfTransmissionMatrix cumulative_transmission(const ArrayOfTransmissionMatrix &T, const CumulativeTransmission type)
Accumulate the transmission matrix over all layers.
const String SINEFIT_MAINTAG
const Array< IsotopologueRecord > & Isotopologue() const
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.
ArrayOfIndex sensor_response_pol_grid(Workspace &ws) noexcept
const String WIND_MAINTAG
const String & TransformationFunc() const
bool is_pressure_broadening_G2(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a G0 derivative.
void gp4length1grid(ArrayOfGridPos &gp)
Grid position matching a grid of length 1.
bool do_magnetic_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a magnetic derivative.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
const String PROPMAT_SUBSUBTAG
const String PARTICULATES_MAINTAG
const Vector & TFuncParameters() const
Declaration of functions in rte.cc.
#define ISLINESHAPETYPE(X)
A constant view of a Tensor3.
Header file for special_interp.cc.
bool supports_hitran_xsec(const ArrayOfRetrievalQuantity &js)
Returns if the array supports HITRAN cross-section derivatives.
Index equivalent_propmattype_index(const ArrayOfRetrievalQuantity &js, const Index i) noexcept
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Deals with whether or not we should do a VMR derivative.
bool is_lineshape_parameter_X0(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a X0 derivative.
bool supports_CIA(const ArrayOfRetrievalQuantity &js)
Returns if the array supports CIA derivatives.
bool supports_propmat_clearsky(const ArrayOfRetrievalQuantity &js)
Returns if the array supports propagation matrix derivatives.
Matrix jacobian(Workspace &ws) noexcept
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
ConstComplexMatrixView transpose(ConstComplexMatrixView m)
Const version of transpose.
ArrayOfString scat_species(Workspace &ws) noexcept
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
Index mblock_index(Workspace &ws) noexcept
bool is_frequency_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations.
void transform_jacobian(Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs)
Applies both functional and affine transformations.
void jac_ranges_indices(ArrayOfArrayOfIndex &jis, bool &any_affine, const ArrayOfRetrievalQuantity &jqs, const bool &before_affine)
Determines the index range inside x and the Jacobian for each retrieval quantity.
A constant view of a Vector.
String propmattype_string(const RetrievalQuantity &rq)
Returns a string of the retrieval quantity propagation matrix type.
bool is_pressure_broadening_ETA(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a ETA derivative.
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.
Index nelem() const
Number of elements.
Index nelem() const
Number of elements in the grids.
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.
const String & Subtag() const
Returns the sub-tag.
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.
const String ABSSPECIES_MAINTAG
Vector rtp_pos(Workspace &ws) noexcept
The global header file for ARTS.
JacPropMatType PropMatType() const
Returns the propagation matrix derivative type.
Index cloudbox_on(Workspace &ws) noexcept
bool do_line_center_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a line center derivative.