Go to the documentation of this file.
130 "No retrieval quantities has been added to *jacobian_quantities*.");
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");
195 os <<
"The gas species:\n"
196 << species <<
"\nis already included in "
197 <<
"*jacobian_quantities*.";
198 throw runtime_error(os.str());
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.");
252 if (not for_species_tag) {
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 "
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());
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*.");
383 const Index porder = 3;
386 Matrix itw(nf2, porder + 1);
394 for (
Index ilos = 0; ilos < nlos2; ilos++) {
409 for (
Index i = 0; i < n1y; i++) {
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.");
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());
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*.");
540 const Index porder = 3;
543 Matrix itw(nf2, porder + 1);
551 for (
Index ilos = 0; ilos < nlos2; ilos++) {
566 for (
Index i = 0; i < n1y; i++) {
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];
605 const Index& poly_order,
612 "The polynomial order has to be positive or -1 for gitter.");
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.");
633 os <<
"The WSV *sensor_time* must be defined for every "
634 <<
"measurement block.\n";
635 throw runtime_error(os.str());
641 "The polynomial order can not be >= length of *sensor_time*.");
654 Vector grid(0, poly_order + 1, 1);
655 if (poly_order == -1) {
662 if (calcmode ==
"recalc") {
665 }
else if (calcmode ==
"interp") {
670 "Possible choices for *calcmode* are \"recalc\" and \"interp\".");
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).");
719 ji = jacobian_indices[n];
724 "There is no such pointing retrieval quantity defined.\n");
748 Matrix itw1(nza, 2), itw2(nza, 2);
756 for (
Index iza = 0; iza < nza; iza++) {
757 for (
Index iv = 0; iv < nf; iv++) {
772 for (
Index i = 0; i < n1y; i++) {
780 const Index it = ji[0];
785 if (rq.
Grids()[0][0] == -1)
795 for (
Index c = 0; c < lg; c++) {
800 for (
Index i = 0; i < n1y; i++) {
848 ji = jacobian_indices[n];
853 "There is no such pointing retrieval quantity defined.\n");
897 for (
Index i = 0; i < n1y; i++) {
905 const Index it = ji[0];
910 if (rq.
Grids()[0][0] == -1)
920 for (
Index c = 0; c < lg; c++) {
925 for (
Index i = 0; i < n1y; i++) {
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)
976 if (no_los_variation)
980 if (no_mblock_variation)
994 for (
Index i = 0; i <= poly_order; i++) {
996 sstr <<
"Coefficient " << i;
1021 const Index& poly_coeff,
1029 sstr <<
"Coefficient " << poly_coeff;
1038 throw runtime_error(
1039 "There is no Polyfit jacobian defined, in general "
1040 "or for the selected polynomial coefficient.\n");
1069 Index col4 = jacobian_indices[iq][0];
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++) {
1107 const Vector& rq_lat_grid,
1108 const Vector& rq_lon_grid,
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());
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)
1207 if (no_los_variation)
1211 if (no_mblock_variation)
1225 for (
Index i = 0; i < np; i++) {
1227 sstr <<
"Period " << i;
1231 grids[0] =
Vector(2, period_lengths[i]);
1252 const Index& period_index,
1260 sstr <<
"Period " << period_index;
1269 throw runtime_error(
1270 "There is no Sinefit jacobian defined, in general "
1271 "or for the selected period length.\n");
1287 for (
Index f = 0; f < nf; f++) {
1307 Index col4 = jacobian_indices[iq][0];
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++) {
1327 jacobian(row2 + p, col1 + 1) = c[f];
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());
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());
1463 rq.
PropType(JacPropMatType::Temperature);
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")
1527 rq.
PropType(JacPropMatType::WindU);
1528 else if (component ==
"v")
1529 rq.
PropType(JacPropMatType::WindV);
1530 else if (component ==
"w")
1531 rq.
PropType(JacPropMatType::WindW);
1532 else if (component ==
"strength")
1533 rq.
PropType(JacPropMatType::WindMagnitude);
1535 throw std::runtime_error(
1536 "The selection for *component* can only be \"u\", \"v\", \"w\" or \"strength\".");
1548 out3 <<
" Calculations done by propagation matrix expression.\n";
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")
1607 rq.
PropType(JacPropMatType::MagneticU);
1608 else if (component ==
"v")
1609 rq.
PropType(JacPropMatType::MagneticV);
1610 else if (component ==
"w")
1611 rq.
PropType(JacPropMatType::MagneticW);
1612 else if (component ==
"strength")
1613 rq.
PropType(JacPropMatType::MagneticMagnitude);
1615 throw runtime_error(
1616 "The selection for *component* can only be \"u\", \"v\", \"w\", or \"strength\".");
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";
1674 if (
q.HasSameInternalsAs(rq))
1675 throw std::runtime_error(
"Error with copies of the quantities");
1679 out3 <<
"Creation was successful!\n";
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)
1723 const String& catalog_parameter,
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());
1745 rq.
PropType(JacPropMatType::LineStrength);
1747 rq.
PropType(JacPropMatType::LineCenter);
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());
1758 rq.
Mode(catalog_parameter);
1767 out3 <<
" Calculations done by propagation matrix expressions.\n";
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)
1804 const Vector& rq_lat_grid,
1805 const Vector& rq_lon_grid,
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());
1856 out3 <<
" Calculations done by propagation matrix expressions.\n";
1869 const Vector& rq_lat_grid,
1870 const Vector& rq_lon_grid,
1874 for (
const auto& qi : energy_level_identities)
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());
1933 if (species ==
"electrons") {
1937 os <<
"Electrons are already included in *jacobian_quantities*.";
1938 throw std::runtime_error(os.str());
1942 rq.
PropType(JacPropMatType::Electrons);
1943 }
else if (species ==
"particulates") {
1947 os <<
"Particulates are already included in *jacobian_quantities*.";
1948 throw std::runtime_error(os.str());
1952 rq.
PropType(JacPropMatType::Particulates);
1955 os <<
"Unknown special species jacobian: \"" << species
1956 <<
"\"\nPlease see *jacobianAddSpecialSpecies* for viable options.";
1957 throw std::runtime_error(os.str());
1986 bool vars_init =
false;
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.");
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);
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;
2111 ret_grids[1] = lat_ret_grid;
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;
2182 const Tensor3& original_field,
2183 const Index& pert_index,
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;
2211 tot_index -= lon_index * n_lat * 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,
2227 else if (pert_mode ==
"relative"){
2228 perturbed_field(p_index,
2233 throw runtime_error(
"Bad *pert_mode*. Allowed choices are: "
2234 """absolute"" and ""relative"".");
2249 n = n_p * n_lat * n_lon;
2258 const Index n =
y.nelem();
2259 if( y_pert.
nelem() != n ){
2260 throw runtime_error(
"Inconsistency in length of *y_pert* and *y*.");
2273 const Index n =
y.nelem();
2277 throw runtime_error(
"Inconsistency in length of y and ybatch[0].");
2280 for (
Index i=0; i<l; i++) {
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;
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;
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;
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 FOREIGNBROADENINGEXPONENT_MODE
Index atmosphere_dim(Workspace &ws) noexcept
const String SURFACE_MAINTAG
const String POINTING_MAINTAG
Range get_rowindex_for_mblock(const Sparse &sensor_response, const Index &mblock_index)
Returns the "range" of y corresponding to a measurement block.
Vector geo_pos(Workspace &ws) noexcept
ArrayOfString AllLineShapeCoeffs()
All available line shape coefficients.
Matrix sensor_response_dlos_grid(Workspace &ws) noexcept
void Isotopologue(Index iso)
Set the Isotopologue.
const Index & Analytical() const
Returns the analytical tag.
const String LINEMIXINGDFEXPONENT_MODE
Class to identify and match lines by their quantum numbers.
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Declarations required for the calculation of absorption coefficients.
ArrayOfString AllLineShapeVars()
All available line shape variables.
Complex w(Complex z) noexcept
The Faddeeva function.
const String SELFPRESSURESHIFT_MODE
This stores arbitrary token values and remembers the type.
const ArrayOfVector & Grids() const
Returns the grids of the retrieval.
Matrix transmitter_pos(Workspace &ws) noexcept
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void jacobianAddBasicCatalogParameters(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfQuantumIdentifier &catalog_identities, const ArrayOfString &catalog_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameters.
Sparse sensor_response(Workspace &ws) noexcept
const String POLYFIT_MAINTAG
Vector lat_grid(Workspace &ws) noexcept
const String FLUX_MAINTAG
const QuantumIdentifier & QuantumIdentity() const
Returns the identity of this Jacobian.
const String & SubSubtag() const
Returns the sub-sub-tag.
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.
const String WATERBROADENINGEXPONENT_MODE
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
const String LINEMIXINGG1_MODE
const String PARTICULATES_MAINTAG
Verbosity verbosity(Workspace &ws) noexcept
const String LINEMIXINGY0_MODE
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
const String LINECENTER_MODE
Index jacobian_do(Workspace &ws) noexcept
Vector y(Workspace &ws) noexcept
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 resize(Index n)
Resize function.
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
const String SELFBROADENINGEXPONENT_MODE
QuantumIdentifier::QType Index LowerQuantumNumbers Species
Index stokes_dim(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
const String LINEMIXINGY1_MODE
JacPropMatType
List of Jacobian properties for analytical line shape related derivatives.
const String LINEMIXINGDF0_MODE
String iy_unit(Workspace &ws) noexcept
const String WIND_MAINTAG
void jacobianFromTwoY(Matrix &jacobian, const Vector &y_pert, const Vector &y, const Numeric &pert_size, const Verbosity &)
WORKSPACE METHOD: jacobianFromTwoY.
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.
const String TEMPERATURE_MAINTAG
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 jacobianAdjustAndTransform(Matrix &jacobian, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &x, const Verbosity &)
WORKSPACE METHOD: jacobianAdjustAndTransform.
constexpr Index get_start() const
Returns the start index of the range.
const String FREQUENCY_MAINTAG
void transform_x_back(Vector &x_t, const ArrayOfRetrievalQuantity &jqs, bool revert_functional_transforms)
Handles back-transformations of the state vector.
Array< Vector > ArrayOfVector
An array of vectors.
ArrayOfString particle_bulkprop_names(Workspace &ws) noexcept
const String FOREIGNBROADENING_MODE
EnergyLevelMap nlte_field(Workspace &ws) noexcept
This can be used to make arrays out of anything.
A tag group can consist of the sum of several of these.
JacPropMatType select_derivativeLineShape(const String &var, const String &coeff)
Return the derivative type based on string input.
const String LINEMIXINGYEXPONENT_MODE
void IntegrationOn()
Sets the integration flag to true.
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
Index nelem(const Lines &l)
Number of lines.
void jacobianSetFuncTransformation(ArrayOfRetrievalQuantity &jqs, const String &transformation_func, const Numeric &z_min, const Numeric &z_max, const Verbosity &)
WORKSPACE METHOD: jacobianSetFuncTransformation.
void IndexNumberOfAtmosphericPoints(Index &n, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Verbosity &)
WORKSPACE METHOD: IndexNumberOfAtmosphericPoints.
void jacobianFromYbatch(Matrix &jacobian, const ArrayOfVector &ybatch, const Vector &y, const Numeric &pert_size, const Verbosity &)
WORKSPACE METHOD: jacobianFromYbatch.
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
void Species(Index sp)
Set the Species.
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.
Declarations having to do with the four output streams.
void reshape(Tensor3View X, ConstVectorView x)
reshape
Vector sensor_time(Workspace &ws) noexcept
const String PROPMAT_SUBSUBTAG
Array< String > ArrayOfString
An array of Strings.
const String WATERPRESSURESHIFT_MODE
Array< ArrayOfIndex > ArrayOfArrayOfIndex
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 String & MainTag() const
Returns the main tag.
void jacobianOff(Index &jacobian_do, Agenda &jacobian_agenda, ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianOff.
const String FREQUENCY_SUBTAG_1
Index nelem() const
Returns the number of elements.
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.
Tensor4 vmr_field(Workspace &ws) noexcept
This file contains declerations of functions of physical character.
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
const String WATERBROADENING_MODE
Vector p_grid(Workspace &ws) noexcept
const String SCATSPECIES_MAINTAG
const String NLTE_MAINTAG
const String & Mode() const
Returns the mode.
const String POINTING_CALCMODE_B
Routines for setting up the jacobian.
void jacobianCalcDoNothing(Matrix &jacobian, const Index &mblock_index, const Vector &iyb, const Vector &yb, const Verbosity &)
WORKSPACE METHOD: jacobianCalcDoNothing.
void jacobianAddFreqShift(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqShift.
NUMERIC Numeric
The type to use for all floating point numbers.
Vector iyb(Workspace &ws) noexcept
const String ELECTRONS_MAINTAG
const String POINTING_SUBTAG_A
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 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 jacobianClose(Workspace &ws, Index &jacobian_do, Agenda &jacobian_agenda, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianClose.
void jacobianInit(ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Verbosity &)
WORKSPACE METHOD: jacobianInit.
const String LINESTRENGTH_MODE
Vector f_grid(Workspace &ws) noexcept
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.
Matrix sensor_pos(Workspace &ws) noexcept
Vector sensor_response_f_grid(Workspace &ws) noexcept
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.
Workspace methods and template functions for supergeneric XML IO.
Header file for interpolation_poly.cc.
Vector lon_grid(Workspace &ws) noexcept
void jacobianAddFreqStretch(Workspace &ws, ArrayOfRetrievalQuantity &jacobian_quantities, Agenda &jacobian_agenda, const Vector &f_grid, const Numeric &df, const Verbosity &)
WORKSPACE METHOD: jacobianAddFreqStretch.
void jacobianAddAbsSpecies(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_p_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &species, const String &mode, const Index &for_species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddAbsSpecies.
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.
const String FOREIGNPRESSURESHIFT_MODE
constexpr QType Type() const
Internal cloudbox functions.
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 PropType(const JacPropMatType t)
Sets the propagation matrix derivative type.
QuantumIdentifier::QType Isotopologue
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
Matrix mblock_dlos_grid(Workspace &ws) noexcept
bool check_retrieval_grids(ArrayOfVector &grids, ostringstream &os, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &p_retr, const Vector &lat_retr, const Vector &lon_retr, const String &p_retr_name, const String &lat_retr_name, const String &lon_retr_name, const Index &dim)
Check that the retrieval grids are defined for each atmosphere dim.
void jacobianAddBasicCatalogParameter(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const QuantumIdentifier &catalog_identity, const String &catalog_parameter, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddBasicCatalogParameter.
ArrayOfIndex sensor_response_pol_grid(Workspace &ws) noexcept
void jacobianAddSurfaceQuantity(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &quantity, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddSurfaceQuantity.
String SpeciesNameMain() const
Name of main species.
Agenda geo_pos_agenda(Workspace &ws) noexcept
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Agenda iy_main_agenda(Workspace &ws) noexcept
const String MAGFIELD_MAINTAG
const String SINEFIT_MAINTAG
const String ABSSPECIES_MAINTAG
Tensor4 particle_bulkprop_field(Workspace &ws) noexcept
Vector yb(Workspace &ws) noexcept
Declaration of functions in rte.cc.
const String LINEMIXINGY_MODE
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 jacobianAddWind(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_p_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &component, const Numeric &dfrequency, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddWind.
void jacobianAddMagField(Workspace &, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &rq_p_grid, const Vector &rq_lat_grid, const Vector &rq_lon_grid, const String &component, const Numeric &dB, const Verbosity &verbosity)
WORKSPACE METHOD: jacobianAddMagField.
void jacobianSetAffineTransformation(ArrayOfRetrievalQuantity &jqs, const Matrix &transformation_matrix, const Vector &offset_vector, const Verbosity &)
WORKSPACE METHOD: jacobianSetAffineTransformation.
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.
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.
const String LINEMIXINGG_MODE
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.
Deals with internal derivatives, Jacobian definition, and OEM calculations.
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.
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
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.
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.
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.
const String LINEMIXINGDF_MODE
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.
Index mblock_index(Workspace &ws) noexcept
const String CATALOGPARAMETER_MAINTAG
Agenda jacobian_agenda(Workspace &ws) noexcept
void transform_jacobian(Matrix &jacobian, const Vector x, const ArrayOfRetrievalQuantity &jqs)
Applies both functional and affine transformations.
const String LINEMIXINGGEXPONENT_MODE
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.
ArrayOfVector ybatch(Workspace &ws) noexcept
Index nelem() const
Number of elements.
const String & Subtag() const
Returns the sub-tag.
Matrix sensor_los(Workspace &ws) noexcept
void jacobianAddPolyfit(Workspace &ws, ArrayOfRetrievalQuantity &jq, Agenda &jacobian_agenda, const ArrayOfIndex &sensor_response_pol_grid, const Matrix &sensor_response_dlos_grid, const Matrix &sensor_pos, const Index &poly_order, const Index &no_pol_variation, const Index &no_los_variation, const Index &no_mblock_variation, const Verbosity &)
WORKSPACE METHOD: jacobianAddPolyfit.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
const String POINTING_CALCMODE_A
const String PRESSUREBROADENINGGAMMA_MODE
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 SELFBROADENING_MODE
The global header file for ARTS.
const String LINEMIXINGG0_MODE
const String FREQUENCY_SUBTAG_0
Index cloudbox_on(Workspace &ws) noexcept
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 SetAll()
Set to All identifier.
const Numeric & Perturbation() const
Returns the size of perturbation.
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 &)