Go to the documentation of this file.
68 os <<
"The variable *" << x_name <<
"* must be a boolean (0 or 1).\n"
69 <<
"The present value of *" << x_name <<
"* is " <<
x <<
".";
70 throw runtime_error(os.str());
92 const Index& x_high) {
93 if ((
x < x_low) || (
x > x_high)) {
95 os <<
"The variable *" << x_name <<
"* must fulfill:\n"
96 <<
" " << x_low <<
" <= " << x_name <<
" <= " << x_high <<
"\n"
97 <<
"The present value of *" << x_name <<
"* is " <<
x <<
".";
98 throw runtime_error(os.str());
120 os <<
"The ArrayOfIndex *" << x_name <<
"* must have strictly\n"
121 <<
"increasing values, but this is not the case.\n";
122 os <<
"x = " <<
x <<
"\n";
123 throw runtime_error(os.str());
146 os <<
"The variable *" << x_name <<
"* must be >= 0.\n"
147 <<
"The present value of *" << x_name <<
"* is " <<
x <<
".";
148 throw runtime_error(os.str());
171 if ((
x < x_low) || (
x > x_high)) {
173 os <<
"The variable *" << x_name <<
"* must fulfill:\n"
174 <<
" " << x_low <<
" <= " << x_name <<
" <= " << x_high <<
"\n"
175 <<
"The present value of *" << x_name <<
"* is " <<
x <<
".";
176 throw runtime_error(os.str());
199 if ((
x <= x_low) || (
x > x_high)) {
201 os <<
"The variable *" << x_name <<
"* must fulfill:\n"
202 <<
" " << x_low <<
" < " << x_name <<
" <= " << x_high <<
"\n"
203 <<
"The present value of *" << x_name <<
"* is " <<
x <<
".";
204 throw runtime_error(os.str());
227 if ((
x < x_low) || (
x >= x_high)) {
229 os <<
"The variable *" << x_name <<
"* must fulfill:\n"
230 <<
" " << x_low <<
" <= " << x_name <<
" < " << x_high <<
"\n"
231 <<
"The present value of *" << x_name <<
"* is " <<
x <<
".";
232 throw runtime_error(os.str());
255 if ((
x <= x_low) || (
x >= x_high)) {
257 os <<
"The variable *" << x_name <<
"* must fulfill:\n"
258 <<
" " << x_low <<
" < " << x_name <<
" < " << x_high <<
"\n"
259 <<
"The present value of *" << x_name <<
"* is " <<
x <<
".";
260 throw runtime_error(os.str());
284 if (
x.nelem() != l) {
286 os <<
"The vector *" << x_name <<
"* must have the length " << l <<
".\n"
287 <<
"The present length of *" << x_name <<
"* is " <<
x.nelem() <<
".";
288 throw runtime_error(os.str());
310 if (
x1.nelem() !=
x2.nelem()) {
312 os <<
"The vectors *" << x1_name <<
"* and *" << x2_name
313 <<
"* must have the same length.\n"
314 <<
"The length of *" << x1_name <<
"* is " <<
x1.nelem() <<
".\n"
315 <<
"The length of *" << x2_name <<
"* is " <<
x2.nelem() <<
".";
316 throw runtime_error(os.str());
337 os <<
"The vector *" << x_name <<
"* must have strictly\n"
338 <<
"increasing values, but this is not the case.\n";
339 os <<
"x = " <<
x <<
"\n";
340 throw runtime_error(os.str());
361 os <<
"The vector *" << x_name <<
"* must have strictly\ndecreasing "
362 <<
"values, but this is not the case.\n";
363 throw runtime_error(os.str());
389 if (
abs(v1[i] - v2[i]) > margin) {
391 os <<
"Vectors " << x1_name <<
" and " << x2_name <<
" differ.\n"
392 << x1_name <<
"[" << i <<
"]"
393 <<
" = " << v1[i] <<
"\n"
394 << x2_name <<
"[" << i <<
"]"
395 <<
" = " << v2[i] <<
"\n"
396 <<
"Difference should not exceed " << margin <<
"\n";
397 throw runtime_error(os.str());
420 if (
x.ncols() != l) {
422 os <<
"The matrix *" << x_name <<
"* must have " << l <<
" columns,\n"
423 <<
"but the number of columns is " <<
x.ncols() <<
".";
424 throw runtime_error(os.str());
442 if (
x.nrows() != l) {
444 os <<
"The matrix *" << x_name <<
"* must have " << l <<
" rows,\n"
445 <<
"but the number of rows is " <<
x.nrows() <<
".";
446 throw runtime_error(os.str());
469 os <<
"The object *" << x_name <<
"* does not have the right size.\n"
470 <<
"Dimension should be:"
471 <<
" " << c <<
",\nbut it is: "
472 <<
" " <<
x.nelem() <<
".";
473 throw runtime_error(os.str());
496 os <<
"The object *" << x_name <<
"* does not have the right size.\n"
497 <<
"Dimensions should be:"
498 <<
" " << r <<
" " << c <<
",\nbut they are: "
499 <<
" " <<
x.nrows() <<
" " <<
x.ncols() <<
".";
500 throw runtime_error(os.str());
525 os <<
"The object *" << x_name <<
"* does not have the right size.\n"
526 <<
"Dimensions should be:"
527 <<
" " << p <<
" " << r <<
" " << c <<
",\nbut they are: "
528 <<
" " <<
x.npages() <<
" " <<
x.nrows() <<
" " <<
x.ncols() <<
".";
529 throw runtime_error(os.str());
556 os <<
"The object *" << x_name <<
"* does not have the right size.\n"
557 <<
"Dimensions should be:"
558 <<
" " << b <<
" " << p <<
" " << r <<
" " << c
559 <<
",\nbut they are: "
560 <<
" " <<
x.nbooks() <<
" " <<
x.npages() <<
" " <<
x.nrows() <<
" "
562 throw runtime_error(os.str());
591 os <<
"The object *" << x_name <<
"* does not have the right size.\n"
592 <<
"Dimensions should be:"
593 <<
" " << s <<
" " << b <<
" " << p <<
" " << r <<
" " << c
594 <<
",\nbut they are: "
595 <<
" " <<
x.nshelves() <<
" " <<
x.nbooks() <<
" " <<
x.npages() <<
" "
596 <<
x.nrows() <<
" " <<
x.ncols() <<
".";
597 throw runtime_error(os.str());
626 if (!
is_size(
x, v, s, b, p, r, c)) {
628 os <<
"The object *" << x_name <<
"* does not have the right size.\n"
629 <<
"Dimensions should be:"
630 <<
" " << v <<
" " << s <<
" " << b <<
" " << p <<
" " << r <<
" " << c
631 <<
",\nbut they are: "
632 <<
" " <<
x.nvitrines() <<
" " <<
x.nshelves() <<
" " <<
x.nbooks()
633 <<
" " <<
x.npages() <<
" " <<
x.nrows() <<
" " <<
x.ncols() <<
".";
634 throw runtime_error(os.str());
665 if (!
is_size(
x, l, v, s, b, p, r, c)) {
667 os <<
"The object *" << x_name <<
"* does not have the right size.\n"
668 <<
"Dimensions should be:"
669 <<
" " << l <<
" " << v <<
" " << s <<
" " << b <<
" " << p <<
" " << r
670 <<
" " << c <<
",\nbut they are: "
671 <<
" " <<
x.nlibraries() <<
" " <<
x.nvitrines() <<
" " <<
x.nshelves()
672 <<
" " <<
x.nbooks() <<
" " <<
x.npages() <<
" " <<
x.nrows() <<
" "
674 throw runtime_error(os.str());
695 if (
x.nelem() == 0) {
697 os <<
"The agenda *" << x_name <<
"* is empty.\nIt is not allowed \n"
698 <<
"that an empty agenda that is actually used.\n"
699 <<
"Empty agendas are only created of methods setting dummy values \n"
701 throw runtime_error(os.str());
737 const String& which_interpolation,
743 ing_min, ing_max, which_interpolation, old_grid, new_grid, order);
746 ing_min, ing_max, which_interpolation, old_grid, new_grid,
data);
776 const String& which_interpolation,
782 if (!new_grid.
nelem())
783 throw runtime_error(
"The new grid is not allowed to be empty.");
786 os <<
"There is a problem with the grids for the following interpolation:\n"
787 << which_interpolation <<
"\n";
790 if (n_old < order + 1) {
791 os <<
"The original grid must have at least " << order + 1 <<
" elements.";
792 throw runtime_error(os.str());
796 const bool ascending = (old_grid[0] <= old_grid[1]);
803 ing_max = new_grid.
nelem() - 1;
807 os <<
"The original grid must be strictly sorted\n"
808 <<
"(no duplicate values). Yours is:\n"
810 throw runtime_error(os.str());
814 og_min = old_grid[0];
815 og_max = old_grid[n_old - 1];
819 os <<
"The original grid must be strictly sorted\n"
820 <<
"(no duplicate values). Yours is:\n"
822 throw runtime_error(os.str());
826 og_max = old_grid[0];
827 og_min = old_grid[n_old - 1];
837 const Index iog_min = 0;
841 ing_max = new_grid.
nelem() - 1;
844 if (ng_max > og_max) {
845 while (ing_max > 0 && new_grid[ing_max] > old_grid[iog_max]) ing_max--;
848 if (ng_min < og_min) {
849 while (ing_min < new_grid.
nelem() - 1 &&
850 new_grid[ing_min] < old_grid[iog_min])
854 if (ng_min < og_min) {
855 while (ing_max > 0 && new_grid[ing_max] < old_grid[iog_max]) ing_max--;
858 if (ng_max > og_max) {
859 while (ing_min < new_grid.
nelem() - 1 &&
860 new_grid[ing_min] > old_grid[iog_min])
893 const String& which_interpolation,
905 ing_min, ing_max, which_interpolation, logold, lognew, order);
932 const String& which_interpolation,
936 if (!new_grid.
nelem())
937 throw runtime_error(
"The new grid is not allowed to be empty.");
940 os <<
"There is a problem with the grids for the following interpolation:\n"
941 << which_interpolation <<
"\n";
944 const bool ascending = (old_grid[0] <= old_grid[1]);
949 const Index iog_min = ascending ? old_grid.
nelem() - 1 : 0;
950 const Index iog_max = ascending ? 0 : old_grid.
nelem() - 1;
952 if (ing_min > 0 &&
data[iog_min] != 0) {
953 os <<
"\nThe new grid is not fully inside the original grid.\n"
954 <<
"This is allowed if the corresponding boundary value of raw data is 0.\n"
955 <<
"New grid point: " << new_grid[ing_min] <<
"\n"
956 <<
"Old grid point: " << old_grid[iog_min] <<
"\n"
957 <<
"Boundary value: " <<
data[iog_min];
958 throw runtime_error(os.str());
961 if (ing_max < new_grid.
nelem() - 1 &&
data[iog_max] != 0) {
962 os <<
"\nThe the new grid is not fully inside the original grid.\n"
963 <<
"This is allowed if the corresponding boundary value of raw data is 0.\n"
964 <<
"New grid point: " << new_grid[ing_max] <<
"\n"
965 <<
"Old grid point: " << old_grid[iog_max] <<
"\n"
966 <<
"Boundary value: " <<
data[iog_max];
967 throw runtime_error(os.str());
997 if (!new_grid.
nelem())
998 throw runtime_error(
"The new grid is not allowed to be empty.");
1002 os <<
"There is a problem with the grids for the following "
1003 <<
"interpolation:\n"
1004 << which_interpolation <<
"\n"
1005 <<
"Interpolation order must be 0 or larger (but your's is " << order
1007 throw runtime_error(os.str());
1011 if (n_old < order + 1) {
1013 os <<
"There is a problem with the grids for the following "
1014 <<
"interpolation:\n"
1015 << which_interpolation <<
"\n"
1016 <<
"For interpolation order " << order
1017 <<
", the original grid must have at least\n"
1018 << order + 1 <<
" elements (but your's has only " << n_old <<
").";
1019 throw runtime_error(os.str());
1023 const bool ascending = ((n_old > 1) ? (old_grid[0] <= old_grid[1]) :
true);
1027 Numeric og_min = old_grid[0], og_max = old_grid[0];
1033 os <<
"There is a problem with the grids for the "
1034 <<
"following interpolation:\n"
1035 << which_interpolation <<
"\n"
1036 <<
"The original grid must be strictly sorted\n"
1037 <<
"(no duplicate values). Yours is:\n"
1039 throw runtime_error(os.str());
1044 og_min = old_grid[0] - extpolfac * (old_grid[1] - old_grid[0]);
1045 og_max = old_grid[n_old - 1] +
1046 extpolfac * (old_grid[n_old - 1] - old_grid[n_old - 2]);
1052 os <<
"There is a problem with the grids for the "
1053 <<
"following interpolation:\n"
1054 << which_interpolation <<
"\n"
1055 <<
"The original grid must be strictly sorted\n"
1056 <<
"(no duplicate values). Yours is:\n"
1058 throw runtime_error(os.str());
1064 og_max = old_grid[0] - extpolfac * (old_grid[1] - old_grid[0]);
1065 og_min = old_grid[n_old - 1] +
1066 extpolfac * (old_grid[n_old - 1] - old_grid[n_old - 2]);
1078 if (ng_min < og_min) {
1080 os <<
"There is a problem with the grids for the "
1081 <<
"following interpolation:\n"
1082 << which_interpolation <<
"\n"
1083 <<
"The minimum of the new grid must be inside "
1084 <<
"the original grid.\n(We allow a bit of extrapolation, "
1085 <<
"but not so much).\n"
1086 <<
"Minimum of original grid: " <<
min(old_grid);
1087 if (islog) os <<
" (" << exp(
min(old_grid)) <<
")";
1088 os <<
"\nMinimum allowed value for new grid: " << og_min;
1089 if (islog) os <<
" (" << exp(og_min) <<
")";
1090 os <<
"\nActual minimum of new grid: " << ng_min;
1091 if (islog) os <<
" (" << exp(ng_min) <<
")";
1092 throw runtime_error(os.str());
1095 if (ng_max > og_max) {
1097 os <<
"There is a problem with the grids for the "
1098 <<
"following interpolation:\n"
1099 << which_interpolation <<
"\n"
1100 <<
"The maximum of the new grid must be inside\n"
1101 <<
"the original grid. (We allow a bit of extrapolation,\n"
1102 <<
"but not so much).\n"
1103 <<
"Maximum of original grid: " <<
max(old_grid);
1104 if (islog) os <<
" (" << exp(
max(old_grid)) <<
")";
1105 os <<
"\nMaximum allowed value for new grid: " << og_max;
1106 if (islog) os <<
" (" << exp(og_max) <<
")";
1107 os <<
"\nActual maximum of new grid: " << ng_max;
1108 if (islog) os <<
" (" << exp(ng_max) <<
")";
1109 throw runtime_error(os.str());
1144 const Vector v(1, new_grid);
1179 which_interpolation, logold, lognew, order, extpolfac,
true);
1207 throw runtime_error(
"The length of *p_grid* must be >= 2.");
1213 throw runtime_error(
"For dim=1, the length of *lat_grid* must be 0.");
1216 throw runtime_error(
"For dim>1, the length of *lat_grid* must be >= 2.");
1223 throw runtime_error(
"For dim<3, the length of *lon_grid* must be 0.");
1226 throw runtime_error(
"For dim=3, the length of *lon_grid* must be >= 2.");
1233 throw runtime_error(
1234 "The latitude grid cannot extend below -90 degrees for 3D");
1236 throw runtime_error(
1237 "The latitude grid cannot extend above 90 degrees for 3D");
1239 throw runtime_error(
1240 "No longitude (in lon_grid) can be below -360 degrees.");
1242 throw runtime_error(
1243 "No longitude (in lon_grid) can be above 360 degrees.");
1245 throw runtime_error(
1246 "The longitude grid is not allowed to cover more than 360 degrees.");
1274 const bool& chk_lat90) {
1281 os <<
"The atmospheric field *" << x_name <<
"* has wrong size.\n"
1283 <<
", while actual size is " <<
x.npages() <<
" x " <<
x.nrows() <<
" x "
1284 <<
x.ncols() <<
".";
1285 throw runtime_error(os.str());
1292 if (std::isnan(
x(ip, ir, ic))) {
1294 os <<
"The variable *" << x_name <<
"* contains one or "
1295 <<
"several NaNs. This is not allowed!";
1296 throw runtime_error(os.str());
1310 x(ip, ir, ic),
x(ip, ir, 0), 4 * DBL_EPSILON)) {
1312 os <<
"The variable *" << x_name <<
"* covers 360 "
1313 <<
"degrees in the longitude direction, but the field "
1314 <<
"seems to deviate between first and last longitude "
1315 <<
"point. The field must be \"cyclic\".\n"
1316 <<
"Difference: " << setprecision(16)
1317 <<
x(ip, ir, ic) -
x(ip, ir, 0) <<
"\n"
1319 << 4 * DBL_EPSILON *
max(
x(ip, ir, ic),
x(ip, ir, 0));
1320 throw runtime_error(os.str());
1333 x(ip, 0, ic),
x(ip, 0, ic - 1), 2 * DBL_EPSILON)) {
1335 os <<
"The variable *" << x_name <<
"* covers the South\n"
1336 <<
"pole. The data corresponding to the pole can not\n"
1337 <<
"vary with longitude, but this appears to be the\n"
1344 throw runtime_error(os.str());
1355 x(ip, ir, ic),
x(ip, ir, ic - 1), 2 * DBL_EPSILON)) {
1357 os <<
"The variable *" << x_name <<
"* covers the North\n"
1358 <<
"pole. The data corresponding to the pole can not\n"
1359 <<
"vary with longitude, but this appears to be the "
1366 throw runtime_error(os.str());
1397 const Index& nspecies,
1401 const bool& check_nan) {
1407 os <<
"The atmospheric field *" << x_name <<
"* should be empty.\n";
1408 throw runtime_error(os.str());
1421 os <<
"The atmospheric field *" << x_name <<
"* has wrong size.\n"
1423 <<
" x " <<
ncols <<
",\n"
1424 <<
"while actual size is " <<
x.nbooks() <<
" x " <<
x.npages() <<
" x "
1425 <<
x.nrows() <<
" x " <<
x.ncols() <<
".";
1426 throw runtime_error(os.str());
1436 if (std::isnan(
x(ib, ip, ir, ic))) {
1438 os <<
"The variable *" << x_name <<
"* contains one or "
1439 <<
"several NaNs. This is not allowed!";
1440 throw runtime_error(os.str());
1453 for (
Index is = 0; is < nspecies; is++) {
1457 x(is, ip, ir, ic),
x(is, ip, ir, 0), 2 * DBL_EPSILON)) {
1459 os <<
"The variable *" << x_name <<
"* covers 360 "
1460 <<
"degrees in the longitude direction, but at least "
1461 <<
"one field seems to deviate between first and last "
1462 <<
"longitude point. The field must be \"cyclic\". "
1463 <<
"This was found for field with index " << is
1465 throw runtime_error(os.str());
1473 for (
Index is = 0; is < nspecies; is++) {
1477 x(is, ip, 0, ic),
x(is, ip, 0, ic - 1), 2 * DBL_EPSILON)) {
1479 os <<
"The variable *" << x_name <<
"* covers the South "
1480 <<
"pole. The data corresponding to the pole can not "
1481 <<
"vary with longitude, but this appears to be the "
1482 <<
"case. This was found for field with index " << is
1484 throw runtime_error(os.str());
1493 for (
Index is = 0; is < nspecies; is++) {
1497 x(is, ip, ir, ic - 1),
1500 os <<
"The variable *" << x_name <<
"* covers the North "
1501 <<
"pole. The data corresponding to the pole can not "
1502 <<
"vary with longitude, but this appears to be the "
1503 <<
"case. This was found for field with index " << is
1505 throw runtime_error(os.str());
1560 os <<
"The atmospheric fields *" << x1_name <<
"* and *" << x2_name
1561 <<
"* do not match in size.\n"
1562 <<
"*" << x1_name <<
"*'s size is " <<
npages <<
" x " <<
nrows
1563 <<
" x " <<
ncols <<
", while *" << x1_name <<
"*'s size is "
1564 <<
x2.npages() <<
" x " <<
x2.nrows() <<
" x " <<
x2.ncols() <<
".";
1565 throw runtime_error(os.str());
1589 vec1 =
x1(ip, 0, ic) *
x1(ip, 0, ic) +
x2(ip, 0, ic) *
x2(ip, 0, ic);
1590 vec2 =
x1(ip, 0, ic - 1) *
x1(ip, 0, ic - 1) +
1591 x2(ip, 0, ic - 1) *
x2(ip, 0, ic - 1);
1592 if (fabs(vec1 / vec2 - 1.) > th) {
1594 os <<
"The variables *" << x1_name <<
"* and *" << x2_name
1595 <<
"* are assumed\n"
1596 <<
"to be two horizontal components of a vector field.\n"
1597 <<
"At the pole, the data (here: the total length of\n"
1598 <<
"the horizontal vector) can NOT vary with longitude,\n"
1599 <<
"but this appears to be the case on the South pole.\n"
1600 <<
"The threshold is " << threshold <<
", but the actual\n"
1601 <<
"deviation at pressure level " << ip <<
" and longitude\n"
1602 <<
"points " << ic - 1 <<
" and " << ic <<
" is "
1604 throw runtime_error(os.str());
1616 x1(ip, ir, ic) *
x1(ip, ir, ic) +
x2(ip, ir, ic) *
x2(ip, ir, ic);
1617 vec2 =
x1(ip, ir, ic - 1) *
x1(ip, ir, ic - 1) +
1618 x2(ip, ir, ic - 1) *
x2(ip, ir, ic - 1);
1619 if (fabs(vec1 / vec2 - 1.) > th) {
1621 os <<
"The variables *" << x1_name <<
"* and *" << x2_name
1622 <<
"* are assumed\n"
1623 <<
"to be two horizontal components of a vector field.\n"
1624 <<
"At the pole, the data (here: the total length of\n"
1625 <<
"the horizontal vector) can NOT vary with longitude,\n"
1626 <<
"but this appears to be the case on the North pole.\n"
1627 <<
"The threshold is " << threshold <<
", but the actual\n"
1628 <<
"deviation at pressure level " << ip <<
" and longitude\n"
1629 <<
"points " << ic - 1 <<
" and " << ic <<
" is "
1631 throw runtime_error(os.str());
1658 throw runtime_error(
1659 "For 1D, the method requires that *lat_true* "
1660 "and *lon_true* have length 1.");
1667 throw runtime_error(
1668 "For 2D, the method requires that *lat_true* "
1669 "and *lon_true* have the same length as *lat_grid*.");
1699 os <<
"The surface variable *" << x_name <<
"* has wrong size.\n"
1700 <<
"Expected size is " <<
nrows <<
" x " <<
ncols <<
","
1701 <<
" while actual size is " <<
x.nrows() <<
" x " <<
x.ncols() <<
".";
1702 throw runtime_error(os.str());
1713 os <<
"The variable *" << x_name <<
"* covers 360 "
1714 <<
"degrees in the longitude direction, but the field "
1715 <<
"seems to deviate between first and last longitude "
1716 <<
"point. The field must be \"cyclic\".";
1717 throw runtime_error(os.str());
1727 os <<
"The variable *" << x_name <<
"* covers the South "
1728 <<
"pole. The data corresponding to the pole can not "
1729 <<
"vary with longitude, but this appears to be the "
1731 throw runtime_error(os.str());
1740 x(ir, ic),
x(ir, ic - 1), 2 * DBL_EPSILON)) {
1742 os <<
"The variable *" << x_name <<
"* covers the North "
1743 <<
"pole. The data corresponding to the pole can not "
1744 <<
"vary with longitude, but this appears to be the "
1746 throw runtime_error(os.str());
1772 const bool& is_rte_pos2)
1775 String vname =
"*rte_pos*";
1777 vname =
"*rte_pos2*";
1784 os <<
"For 1D, " << vname <<
" must have length 1.";
1785 throw runtime_error(os.str());
1790 os <<
"For 1D, " << vname <<
" must have length 2.";
1791 throw runtime_error(os.str());
1795 os <<
"For 1D, the latitude in " << vname <<
" must be in the "
1796 <<
"range [-180,180].";
1797 throw runtime_error(os.str());
1803 os <<
"For 2D, " << vname <<
" must have length 2.";
1804 throw runtime_error(os.str());
1809 os <<
"For 3D, " << vname <<
" must have length 3.";
1810 throw runtime_error(os.str());
1814 os <<
"The (3D) latitude in " << vname <<
" must be in the "
1815 <<
"range [-90,90].";
1816 throw runtime_error(os.str());
1820 os <<
"The longitude in " << vname <<
" must be in the "
1821 <<
"range [-360,360].";
1822 throw runtime_error(os.str());
1844 throw runtime_error(
"For 1D, los-vectors must have length 1.");
1847 throw runtime_error(
1848 "For 1D, the zenith angle of a los-vector must "
1849 "be in the range [0,180].");
1853 throw runtime_error(
"For 2D, los-vectors must have length 1.");
1856 throw runtime_error(
1857 "For 2D, the zenith angle of a los-vector must "
1858 "be in the range [-180,180].");
1862 throw runtime_error(
"For 3D, los-vectors must have length 2.");
1865 throw runtime_error(
1866 "For 3D, the zenith angle of a los-vector must "
1867 "be in the range [0,180].");
1870 throw runtime_error(
1871 "For 3D, the azimuth angle of a los-vector must "
1872 "be in the range [-180,180].");
1892 const Index gridindex,
1893 const String& gridname) {
1894 if (gf.
get_dim() - 1 < gridindex) {
1896 os <<
"Grid index " << gridindex <<
" exceeds dimension of GriddedField";
1898 throw runtime_error(os.str());
1904 String gridnameupper = gridname;
1907 if (gfgridnameupper != gridnameupper) {
1909 os <<
"Name of grid " << gridindex <<
" in GriddedField";
1912 <<
"The expected name is \"" << gridname <<
"\".";
1913 throw runtime_error(os.str());
1933 throw std::runtime_error(
"No channels defined in *met_mm_backend*.");
1935 if (mmb.
ncols() != 4)
1936 throw std::runtime_error(
"*met_mm_backend* must have 4 columns.");
1942 Numeric bandwidth = mmb(ch, 3);
1947 os <<
"Error in channel " << ch + 1 <<
" at row " << ch
1948 <<
" in *met_mm_backend*.\n"
1949 <<
"Center frequency is negative: " << mmb(ch, 0) <<
" Hz";
1950 throw std::runtime_error(os.str());
1954 if (offset1 < 0. || offset2 < 0.) {
1956 os <<
"Error in channel " << ch + 1 <<
" at row " << ch
1957 <<
" in *met_mm_backend*.\n"
1958 <<
"Offset is negative:\n"
1959 <<
"offset1: " << offset1 <<
" Hz\n"
1960 <<
"offset2: " << offset2 <<
" Hz\n";
1961 throw std::runtime_error(os.str());
1965 if (offset1 != 0. && offset1 <= offset2) {
1967 os <<
"Error in channel " << ch + 1 <<
" at row " << ch
1968 <<
" in *met_mm_backend*.\n"
1969 <<
"First passband offset is smaller than/equal to the second offset:\n"
1970 <<
"offset1: " << offset1 <<
" Hz\n"
1971 <<
"offset2: " << offset2 <<
" Hz\n";
1972 throw std::runtime_error(os.str());
1976 if (offset1 > 0 && offset1 - offset2 <= bandwidth / 2.) {
1978 os <<
"Error in channel " << ch + 1 <<
" at row " << ch
1979 <<
" in *met_mm_backend*.\n"
1980 <<
"Band touches or overlaps with the center frequency:\n"
1981 <<
"offset1 : " << offset1 <<
" Hz\n"
1982 <<
"offset2 : " << offset2 <<
" Hz\n"
1983 <<
"bandwidth : " << bandwidth <<
" Hz\n"
1984 <<
"offset1 - offset2 - bandwidth/2: "
1985 << offset1 - offset2 - bandwidth / 2. <<
" Hz\n";
1986 throw std::runtime_error(os.str());
1990 if (offset2 > 0 && offset2 <= bandwidth / 2.) {
1992 os <<
"Error in channel " << ch + 1 <<
" at row " << ch
1993 <<
" in *met_mm_backend*.\n"
1994 <<
"Bands overlap or touch, offset2 > bandwidth/2:\n"
1995 <<
"offset2 : " << offset2 <<
" Hz\n"
1996 <<
"bandwidth/2: " << bandwidth / 2. <<
" Hz\n";
1997 throw std::runtime_error(os.str());
2001 if (
lo - offset1 - offset2 - bandwidth / 2. <= 0) {
2003 os <<
"Error in channel " << ch + 1 <<
" at row " << ch
2004 <<
" in *met_mm_backend*.\n"
2005 <<
"Band too wide, reaches/exceeds 0 Hz:\n"
2006 <<
"LO : " <<
lo <<
" Hz\n"
2007 <<
"offset1 : " << offset1 <<
" Hz\n"
2008 <<
"offset2 : " << offset2 <<
" Hz\n"
2009 <<
"bandwidth : " << bandwidth <<
" Hz\n"
2010 <<
"LO - offset1 - offset2 - bandwidth/2: "
2011 <<
lo - offset1 - offset2 - bandwidth / 2. <<
" Hz\n";
2012 throw std::runtime_error(os.str());
Index atmosphere_dim(Workspace &ws) noexcept
Implementation of gridded fields.
bool is_same_within_epsilon(const Numeric &a, const Numeric &b, const Numeric &epsilon)
Check, if two numbers agree within a given epsilon.
void transform(VectorView y, double(&my_func)(double), ConstVectorView x)
A generic transform function for vectors, which can be used to implement mathematical functions opera...
void toupper()
Convert to upper case.
Numeric lo(Workspace &ws) noexcept
Vector lat_grid(Workspace &ws) noexcept
A constant view of a Tensor7.
Index get_dim() const
Get the dimension of this gridded field.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Index nrows() const
Returns the number of rows.
bool is_bool(const Index &x)
Checks if a variable equals 0 or 1.
This file contains the definition of Array.
bool is_size(ConstVectorView x, const Index &n)
Verifies that the size of x is l.
Numeric sqrt(const Rational r)
Square root.
Vector lon_true(Workspace &ws) noexcept
A constant view of a Tensor4.
This can be used to make arrays out of anything.
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
Vector rte_pos(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
Index nelem() const
Returns the number of elements.
Vector rte_los(Workspace &ws) noexcept
Vector p_grid(Workspace &ws) noexcept
A constant view of a Tensor6.
NUMERIC Numeric
The type to use for all floating point numbers.
Index npages(Workspace &ws) noexcept
const String & get_name() const
Get the name of this gridded field.
bool is_lon_cyclic(ConstVectorView grid, const Numeric &epsilon)
Check if the given longitude grid is cyclic.
Vector lat_true(Workspace &ws) noexcept
Index nelem() const
Number of elements.
Vector lon_grid(Workspace &ws) noexcept
A constant view of a Matrix.
Index nrows(Workspace &ws) noexcept
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Header file for logic.cc.
A constant view of a Tensor3.
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
const String & get_grid_name(Index i) const
Get grid name.
Index ncols(Workspace &ws) noexcept
A constant view of a Vector.
Index nbooks(Workspace &ws) noexcept
A constant view of a Tensor5.