Go to the documentation of this file.
74 os <<
"The variable *" << x_name <<
"* must be a boolean (0 or 1).\n"
75 <<
"The present value of *"<< x_name <<
"* is " << x <<
".";
76 throw runtime_error( os.str() );
101 if ( (x<x_low) || (x>x_high) )
104 os <<
"The variable *" << x_name <<
"* must fulfill:\n"
105 <<
" " << x_low <<
" <= " << x_name <<
" <= " << x_high <<
"\n"
106 <<
"The present value of *"<< x_name <<
"* is " << x <<
".";
107 throw runtime_error( os.str() );
133 os <<
"The ArrayOfIndex *" << x_name <<
"* must have strictly\n"
134 <<
"increasing values, but this is not the case.\n";
135 os <<
"x = " << x <<
"\n";
136 throw runtime_error( os.str() );
164 os <<
"The variable *" << x_name <<
"* must be >= 0.\n"
165 <<
"The present value of *"<< x_name <<
"* is " << x <<
".";
166 throw runtime_error( os.str() );
193 if ( (x<x_low) || (x>x_high) )
196 os <<
"The variable *" << x_name <<
"* must fulfill:\n"
197 <<
" " << x_low <<
" <= " << x_name <<
" <= " << x_high <<
"\n"
198 <<
"The present value of *"<< x_name <<
"* is " << x <<
".";
199 throw runtime_error( os.str() );
227 if ( x.
nelem() != l )
230 os <<
"The vector *" << x_name <<
"* must have the length " << l
232 <<
"The present length of *"<< x_name <<
"* is " << x.
nelem() <<
".";
233 throw runtime_error( os.str() );
262 os <<
"The vectors *" << x1_name <<
"* and *" << x2_name
263 <<
"* must have the same length.\n"
264 <<
"The length of *"<< x1_name <<
"* is " << x1.
nelem() <<
".\n"
265 <<
"The length of *"<< x2_name <<
"* is " << x2.
nelem() <<
".";
266 throw runtime_error( os.str() );
293 os <<
"The vector *" << x_name <<
"* must have strictly\n"
294 <<
"increasing values, but this is not the case.\n";
295 os <<
"x = " << x <<
"\n";
296 throw runtime_error( os.str() );
323 os <<
"The vector *" << x_name <<
"* must have strictly\ndecreasing "
324 <<
"values, but this is not the case.\n";
325 throw runtime_error( os.str() );
355 if (
abs(v1[i] - v2[i]) > margin)
358 os <<
"Vectors " << x1_name <<
" and " << x2_name
360 << x1_name <<
"[" << i <<
"]" <<
" = " << v1[i] <<
"\n"
361 << x2_name <<
"[" << i <<
"]" <<
" = " << v2[i] <<
"\n"
362 <<
"Difference should not exceed " << margin <<
"\n";
363 throw runtime_error(os.str());
399 os <<
"There is a problem with the grids for the\n"
400 <<
"following interpolation: " << which_interpolation <<
".\n";
405 os <<
"The original grid must have at least " << order+1 <<
" elements.";
406 throw runtime_error( os.str() );
410 bool ascending = ( old_grid[0] <= old_grid[1] );
421 os <<
"The original grid must be strictly sorted\n"
422 <<
"(no duplicate values). Yours is:\n"
424 throw runtime_error( os.str() );
428 og_min = old_grid[0] -
429 extpolfac * ( old_grid[1] - old_grid[0] );
430 og_max = old_grid[n_old-1] +
431 extpolfac * ( old_grid[n_old-1] - old_grid[n_old-2] );
438 os <<
"The original grid must be strictly sorted\n"
439 <<
"(no duplicate values). Yours is:\n"
441 throw runtime_error( os.str() );
446 og_max = old_grid[0] -
447 extpolfac * ( old_grid[1] - old_grid[0] );
448 og_min = old_grid[n_old-1] +
449 extpolfac * ( old_grid[n_old-1] - old_grid[n_old-2] );
461 os <<
"The minimum of the new grid must be inside\n"
462 <<
"the original grid. (We allow a bit of extrapolation,\n"
463 <<
"but not so much).\n"
464 <<
"Minimum of original grid: " <<
min(old_grid) <<
"\n"
465 <<
"Minimum allowed value for new grid: " << og_min <<
"\n"
466 <<
"Actual minimum of new grid: " << ng_min;
467 throw runtime_error( os.str() );
472 os <<
"The maximum of the new grid must be inside\n"
473 <<
"the original grid. (We allow a bit of extrapolation,\n"
474 <<
"but not so much).\n"
475 <<
"Maximum of original grid: " <<
max(old_grid) <<
"\n"
476 <<
"Maximum allowed value for new grid: " << og_max <<
"\n"
477 <<
"Actual maximum of new grid: " << ng_max;
478 throw runtime_error( os.str() );
544 if ( x.
ncols() != l )
547 os <<
"The matrix *" << x_name <<
"* must have " << l <<
" columns,\n"
548 <<
"but the number of columns is " << x.
ncols() <<
".";
549 throw runtime_error( os.str() );
573 if ( x.
nrows() != l )
576 os <<
"The matrix *" << x_name <<
"* must have " << l <<
" rows,\n"
577 <<
"but the number of rows is " << x.
nrows() <<
".";
578 throw runtime_error( os.str() );
610 if( p_grid.
nelem() < 2 )
611 throw runtime_error(
"The length of *p_grid* must be >= 2." );
617 if( lat_grid.
nelem() > 1 )
619 "For dim=1, the length of *lat_grid* must be 0 or 1." );
623 if( lat_grid.
nelem() < 2 )
625 "For dim>1, the length of *lat_grid* must be >= 2.");
632 if( lon_grid.
nelem() > 1 )
634 "For dim<3, the length of *lon_grid* must be 0 or 1." );
638 if( lon_grid.
nelem() < 2 )
640 "For dim=3, the length of *lon_grid* must be >= 2.");
647 if( lat_grid[0] < -90 )
649 "The latitude grid cannot extend below -90 degrees for 3D" );
650 if( lat_grid[lat_grid.
nelem() - 1] > 90 )
652 "The latitude grid cannot extend above 90 degrees for 3D" );
653 if( lon_grid[0] < -360 )
655 "No longitude (in lon_grid) can be below -360 degrees." );
656 if( lon_grid[lon_grid.
nelem() - 1] > 360 )
658 "No longitude (in lon_grid) can be above 360 degrees." );
659 if( lon_grid[lon_grid.
nelem() - 1]-lon_grid[0] > 360 )
661 "The longitude grid is not allowed to cover more than 360 degrees." );
692 Index npages=p_grid.
nelem(), nrows=1, ncols=1;
694 nrows = lat_grid.
nelem();
696 ncols = lon_grid.
nelem();
700 os <<
"The atmospheric field *" << x_name <<
"* has wrong size.\n"
701 <<
"Expected size is " << npages <<
" x " << nrows <<
" x "
702 << ncols <<
", while actual size is " << x.
npages() <<
" x "
704 throw runtime_error( os.str() );
707 if( dim == 3 && (lon_grid[ncols-1]-lon_grid[0]) == 360 )
709 const Index ic = ncols-1;
710 for(
Index ip=0; ip<npages; ip++ )
712 for(
Index ir=0; ir<nrows; ir++ )
714 if( fabs(x(ip,ir,ic)-x(ip,ir,0)) > 0 )
717 os <<
"The variable *" << x_name <<
"* covers 360 "
718 <<
"degrees in the longitude direction, but the field "
719 <<
"seems to deviate between first and last longitude "
720 <<
"point. The field must be \"cyclic\".";
721 throw runtime_error( os.str() );
751 const Index& nspecies,
756 Index npages=p_grid.
nelem(), nrows=1, ncols=1;
758 nrows = lat_grid.
nelem();
760 ncols = lon_grid.
nelem();
762 const Index nbooks=nspecies;
768 os <<
"The atmospheric field *" << x_name <<
"* has wrong size.\n"
769 <<
"Expected size is "
770 << nbooks <<
" x " << npages <<
" x "
771 << nrows <<
" x " << ncols <<
",\n"
772 <<
"while actual size is "
775 throw runtime_error( os.str() );
778 if( dim == 3 && (lon_grid[ncols-1]-lon_grid[0]) == 360 )
780 const Index ic = ncols-1;
781 for(
Index is=0; is<nspecies; is++ )
783 for(
Index ip=0; ip<npages; ip++ )
785 for(
Index ir=0; ir<nrows; ir++ )
787 if( fabs(x(is,ip,ir,ic)-x(is,ip,ir,0)) > 0 )
790 os <<
"The variable *" << x_name <<
"* covers 360 degrees"
791 <<
"in the longitude direction, but at least one field "
792 <<
"seems to deviate between first and last longitude "
793 <<
"point. The field must be \"cyclic\". This was found "
794 <<
"for field with index " << is <<
" (0-based).";
795 throw runtime_error( os.str() );
828 Index ncols=1, nrows=1;
830 nrows = lat_grid.
nelem();
832 ncols = lon_grid.
nelem();
836 os <<
"The surface variable *" << x_name <<
"* has wrong size.\n"
837 <<
"Expected size is " << nrows <<
" x " << ncols <<
","
838 <<
" while actual size is " << x.
nrows() <<
" x " << x.
ncols() <<
".";
839 throw runtime_error( os.str() );
842 if( dim == 3 && (lon_grid[ncols-1]-lon_grid[0]) == 360 )
844 const Index ic = ncols-1;
845 for(
Index ir=0; ir<nrows; ir++ )
847 if( fabs(x(ir,ic)-x(ir,0)) > 0 )
850 os <<
"The variable *" << x_name <<
"* covers 360 "
851 <<
"degrees in the longitude direction, but the data "
852 <<
"seems to deviate between first and last longitude "
853 <<
"point. The surface must be \"cyclic\".";
854 throw runtime_error( os.str() );
887 os <<
"The agenda *" << x_name <<
"* is empty.\nIt is not allowed \n"
888 <<
"that an agenda that is actually used to be empty.\n"
889 <<
"Empty agendas are only created of methods setting dummy values \n"
891 throw runtime_error( os.str() );
918 os <<
"The object *" << x_name
919 <<
"* does not have the right size.\n"
920 <<
"Dimensions should be:"
922 <<
",\nbut they are: "
925 throw runtime_error( os.str() );
950 os <<
"The object *" << x_name
951 <<
"* does not have the right size.\n"
952 <<
"Dimensions should be:"
955 <<
",\nbut they are: "
959 throw runtime_error( os.str() );
986 os <<
"The object *" << x_name
987 <<
"* does not have the right size.\n"
988 <<
"Dimensions should be:"
992 <<
",\nbut they are: "
997 throw runtime_error( os.str() );
1026 os <<
"The object *" << x_name
1027 <<
"* does not have the right size.\n"
1028 <<
"Dimensions should be:"
1033 <<
",\nbut they are: "
1039 throw runtime_error( os.str() );
1070 os <<
"The object *" << x_name
1071 <<
"* does not have the right size.\n"
1072 <<
"Dimensions should be:"
1078 <<
",\nbut they are: "
1085 throw runtime_error( os.str() );
1115 if ( !
is_size(x,v,s,b,p,r,c) )
1118 os <<
"The object *" << x_name
1119 <<
"* does not have the right size.\n"
1120 <<
"Dimensions should be:"
1127 <<
",\nbut they are: "
1135 throw runtime_error( os.str() );
1167 if ( !
is_size(x,l,v,s,b,p,r,c) )
1170 os <<
"The object *" << x_name
1171 <<
"* does not have the right size.\n"
1172 <<
"Dimensions should be:"
1180 <<
",\nbut they are: "
1189 throw runtime_error( os.str() );
1220 Index n, p_i, lat_i, lon_i;
1222 for (n=0; n < pnd_field_raw.
nelem(); n++) {
1223 for (p_i=0; p_i < pnd_field_raw[n].data.npages(); p_i++) {
1224 for (lat_i=0; lat_i < pnd_field_raw[n].data.nrows(); lat_i++) {
1225 for (lon_i=0; lon_i < pnd_field_raw[n].data.ncols(); lon_i++) {
1226 v = pnd_field_raw[n].data(p_i, lat_i, lon_i);
1230 if (!((p <= p_grid[cloudbox_limits[0]]) &
1231 (p >= p_grid[cloudbox_limits[1]]))) {
1233 os <<
"Found non-zero pnd outside cloudbox. "
1234 <<
"Cloudbox extends from p="
1235 << p_grid[cloudbox_limits[0]]
1237 << p_grid[cloudbox_limits[1]]
1238 <<
" Pa, but found pnd=" << v
1239 <<
"/m³ at p=" << p <<
" Pa.";
1240 throw runtime_error(os.str());
1245 if (!((lat >= lat_grid[cloudbox_limits[2]]) &
1246 (lat <= lat_grid[cloudbox_limits[3]]))) {
1248 os <<
"Found non-zero pnd outside cloudbox. "
1249 <<
"Cloudbox extends from lat="
1250 << lat_grid[cloudbox_limits[2]]
1252 << lat_grid[cloudbox_limits[3]]
1253 <<
"°, but found pnd=" << v
1254 <<
"/m³ at lat=" << lat <<
"°.";
1255 throw runtime_error(os.str());
1261 if (!((lon >= lon_grid[cloudbox_limits[4]]) &
1262 (lon <= lon_grid[cloudbox_limits[5]]))) {
1264 os <<
"Found non-zero pnd outside cloudbox. "
1265 <<
"Cloudbox extends from lon="
1266 << lon_grid[cloudbox_limits[4]]
1268 << lon_grid[cloudbox_limits[5]]
1269 <<
"°, but found pnd=" << v
1270 <<
"/m³ at lon=" << lon <<
"°.";
1271 throw runtime_error(os.str());
Implementation of gridded fields.
Index nshelves() const
Returns the number of shelves.
Index nshelves() const
Returns the number of shelves.
Index nbooks() const
Returns the number of books.
Index ncols() const
Returns the number of columns.
Index npages() const
Returns the number of pages.
Index ncols() const
Returns the number of columns.
A constant view of a Tensor7.
Index nelem() const
Return the number of agenda elements.
Index nrows() const
Returns the number of rows.
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.
Index npages() const
Returns the number of pages.
Index npages() const
Returns the number of pages.
Index nlibraries() const
Returns the number of libraries.
A constant view of a Tensor4.
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
Index nvitrines() const
Returns the number of vitrines.
Index ncols() const
Returns the number of columns.
The implementation for String, the ARTS string class.
Index nelem() const
Returns the number of elements.
Index nvitrines() const
Returns the number of vitrines.
Index ncols() const
Returns the number of columns.
Index npages() const
Returns the number of pages.
A constant view of a Tensor6.
NUMERIC Numeric
The type to use for all floating point numbers.
Index npages() const
Returns the number of pages.
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
Index nbooks() const
Returns the number of books.
A constant view of a Matrix.
Index nrows() const
Returns the number of rows.
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Header file for logic.cc.
Index nshelves() const
Returns the number of shelves.
Index ncols() const
Returns the number of columns.
A constant view of a Tensor3.
INDEX Index
The type to use for all integer numbers and indices.
Index nrows() const
Returns the number of rows.
A constant view of a Vector.
Index nelem() const
Number of elements.
Index ncols() const
Returns the number of columns.
A constant view of a Tensor5.