33 #ifndef gridded_fields_h 34 #define gridded_fields_h 46 #define CHECK_ERROR_BOILERPLATE \ 47 "size mismatch between grids and data.\n" \ 48 "Note that a grid is allowed to be empty, but in the\n" \ 49 "data that dimension must have exactly one element.\n" 121 switch (mgridtypes[i]) {
123 ret = mnumericgrids[
i].
nelem();
126 ret = mstringgrids[
i].
nelem();
212 os <<
"GriddedField1 ";
219 os <<
" = " <<
data.nelem();
220 throw std::runtime_error(os.str());
255 os <<
"GriddedField2 ";
264 os <<
" = " <<
data.nrows() <<
", " <<
data.ncols();
265 throw std::runtime_error(os.str());
310 os <<
"GriddedField3 ";
319 os <<
" = " <<
data.npages() <<
", " <<
data.nrows() <<
", " 321 throw std::runtime_error(os.str());
362 os <<
"GriddedField4 ";
371 os <<
" = " <<
data.nbooks() <<
", " <<
data.npages() <<
", ";
372 os <<
data.nrows() <<
", " <<
data.ncols();
373 throw std::runtime_error(os.str());
419 os <<
"GriddedField5 ";
428 os <<
" = " <<
data.nshelves() <<
", " <<
data.nbooks() <<
", ";
429 os <<
data.npages() <<
", " <<
data.nrows() <<
", " <<
data.ncols();
430 throw std::runtime_error(os.str());
447 data.resize(s, b, p, r, c);
481 os <<
"GriddedField6 ";
490 os <<
" = " <<
data.nvitrines() <<
data.nshelves() <<
", " 491 <<
data.nbooks() <<
", ";
492 os <<
data.npages() <<
", " <<
data.nrows() <<
", " <<
data.ncols();
493 throw std::runtime_error(os.str());
511 data.resize(v, s, b, p, r, c);
540 #undef CHECK_ERROR_BOILERPLATE INDEX Index
The type to use for all integer numbers and indices.
GriddedField5()
Construct an empty GriddedField5.
void checksize_strict() const final
Strict consistency check.
Index nelem() const
Number of elements.
virtual bool checksize() const =0
Consistency check.
Array< GriddedField3 > ArrayOfGriddedField3
void resize(const GriddedField1 &gf)
Make this GriddedField1 the same size as the given one.
GriddedField(const Index d, const String &s)
Construct a GriddedField.
Array< GriddedField2 > ArrayOfGriddedField2
#define CHECK_ERROR_BOILERPLATE
bool checksize() const final
Consistency check.
const ArrayOfString & get_string_grid(Index i) const
Get a string grid.
virtual void checksize_strict() const =0
Strict consistency check.
void resize(const GriddedField6 &gf)
Make this GriddedField6 the same size as the given one.
GriddedField1()
Construct an empty GriddedField1.
GriddedField()
Construct an empty GriddedField.
GridType get_grid_type(Index i) const
Get grid type.
void checksize_strict() const final
Strict consistency check.
void checksize_strict() const final
Strict consistency check.
Array< GriddedField4 > ArrayOfGriddedField4
void resize(const GriddedField4 &gf)
Make this GriddedField4 the same size as the given one.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
bool checksize() const final
Consistency check.
void checksize_strict() const final
Strict consistency check.
Array< GriddedField1 > ArrayOfGriddedField1
bool checksize() const final
Consistency check.
void copy_grids(const GriddedField &gf)
Copy grids.
This file contains the definition of Array.
GriddedField6()
Construct an empty GriddedField6.
const String & get_name() const
Get the name of this gridded field.
Index get_dim() const
Get the dimension of this gridded field.
GriddedField2()
Construct an empty GriddedField2.
GriddedField5(const String &s)
Construct an empty GriddedField5 with the given name.
void checksize_strict() const final
Strict consistency check.
void resize(Index r, Index c)
Resize the data matrix.
GriddedField3(const String &s)
Construct an empty GriddedField3 with the given name.
Array< GridType > ArrayOfGridType
GriddedField3()
Construct an empty GriddedField3.
ArrayOfVector mnumericgrids
GriddedField4()
Construct an empty GriddedField4.
void resize(Index v, Index s, Index b, Index p, Index r, Index c)
Resize the data tensor.
void set_grid(Index i, const Vector &g)
Set a numeric grid.
Index get_grid_size(Index i) const
Get the size of a grid.
GriddedField3 & operator=(Numeric n)
Array< ArrayOfString > mstringgrids
bool checksize() const final
Consistency check.
void resize(const GriddedField2 &gf)
Make this GriddedField2 the same size as the given one.
const Vector & get_numeric_grid(Index i) const
Get a numeric grid.
void resize(Index b, Index p, Index r, Index c)
Resize the data tensor.
NUMERIC Numeric
The type to use for all floating point numbers.
GriddedField6(const String &s)
Construct an empty GriddedField6 with the given name.
friend std::ostream & operator<<(std::ostream &os, const GriddedField &gf)
GriddedField2(const String &s)
Construct an empty GriddedField2 with the given name.
GriddedField4(const String &s)
Construct an empty GriddedField4 with the given name.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
void resize(Index p, Index r, Index c)
Resize the data tensor.
void resize(Index n)
Resize the data vector.
const String & get_grid_name(Index i) const
Get grid name.
void checksize_strict() const final
Strict consistency check.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize the data tensor.
void set_name(const String &s)
Set name of this gridded field.
Index nelem(const Lines &l)
Number of lines.
GriddedField1(const String &s)
Construct an empty GriddedField1 with the given name.
void set_grid_name(Index i, const String &s)
Set grid name.
void resize(const GriddedField5 &gf)
Make this GriddedField5 the same size as the given one.
Array< GriddedField5 > ArrayOfGriddedField5
bool checksize() const final
Consistency check.
Array< Array< GriddedField3 > > ArrayOfArrayOfGriddedField3
void resize(const GriddedField3 &gf)
Make this GriddedField3 the same size as the given one.
virtual ~GriddedField()
GriddedField virtual destructor.
bool checksize() const final
Consistency check.
Array< GridType > mgridtypes
Array< Array< GriddedField1 > > ArrayOfArrayOfGriddedField1
Array< Array< GriddedField2 > > ArrayOfArrayOfGriddedField2
This file contains the definition of String, the ARTS string class.