ARTS 2.5.0 (git: 9ee3ac6c)
GriddedField Class Referenceabstract

#include <gridded_fields.h>

Inheritance diagram for GriddedField:
GriddedField1 GriddedField2 GriddedField3 GriddedField4 GriddedField5 GriddedField6

Public Member Functions

Index get_dim () const
 Get the dimension of this gridded field. More...
 
void copy_grids (const GriddedField &gf)
 Copy grids. More...
 
const Stringget_grid_name (Index i) const
 Get grid name. More...
 
Index get_grid_size (Index i) const
 Get the size of a grid. More...
 
GridType get_grid_type (Index i) const
 Get grid type. More...
 
const Vectorget_numeric_grid (Index i) const
 Get a numeric grid. More...
 
Vectorget_numeric_grid (Index i)
 Get a numeric grid. More...
 
const ArrayOfStringget_string_grid (Index i) const
 Get a string grid. More...
 
ArrayOfStringget_string_grid (Index i)
 Get a string grid. More...
 
const Stringget_name () const
 Get the name of this gridded field. More...
 
void set_grid (Index i, const Vector &g)
 Set a numeric grid. More...
 
void set_grid (Index i, const ArrayOfString &g)
 Set a string grid. More...
 
void set_grid_name (Index i, const String &s)
 Set grid name. More...
 
void set_name (const String &s)
 Set name of this gridded field. More...
 
virtual bool checksize () const =0
 Consistency check. More...
 
virtual void checksize_strict () const =0
 Strict consistency check. More...
 
virtual ~GriddedField ()
 GriddedField virtual destructor. More...
 

Protected Member Functions

 GriddedField ()
 Construct an empty GriddedField. More...
 
 GriddedField (const Index d, const String &s)
 Construct a GriddedField. More...
 

Private Attributes

Index dim
 
String mname
 
Array< GridTypemgridtypes
 
ArrayOfString mgridnames
 
Array< ArrayOfStringmstringgrids
 
ArrayOfVector mnumericgrids
 

Friends

std::ostream & operator<< (std::ostream &os, const GriddedField &gf)
 

Detailed Description

Abstract base class for gridded fields.

Definition at line 81 of file gridded_fields.h.

Constructor & Destructor Documentation

◆ GriddedField() [1/2]

GriddedField::GriddedField ( )
inlineprotected

Construct an empty GriddedField.

The constructor for GriddedField is protected because it is only used internally by the derived classed.

Definition at line 96 of file gridded_fields.h.

◆ GriddedField() [2/2]

GriddedField::GriddedField ( const Index  d,
const String s 
)
inlineprotected

Construct a GriddedField.

Constructs a GriddedField with the given dimension and name.

The constructor for GriddedField is protected because it is only used internally by the derived classes.

Parameters
[in]dDimension.
[in]sName.

Definition at line 115 of file gridded_fields.h.

◆ ~GriddedField()

virtual GriddedField::~GriddedField ( )
inlinevirtual

GriddedField virtual destructor.

Definition at line 220 of file gridded_fields.h.

Member Function Documentation

◆ checksize()

virtual bool GriddedField::checksize ( ) const
pure virtual

Consistency check.

Check if the sizes of the grids match the data dimension.

This function must be overwritten by the derived classes.

Returns
True if sizes match.

Implemented in GriddedField1, GriddedField2, GriddedField3, GriddedField4, GriddedField5, and GriddedField6.

◆ checksize_strict()

virtual void GriddedField::checksize_strict ( ) const
pure virtual

Strict consistency check.

Same as GriddedField::checksize but throws runtime_error in case of error.

Implemented in GriddedField1, GriddedField2, GriddedField3, GriddedField4, GriddedField5, and GriddedField6.

◆ copy_grids()

void GriddedField::copy_grids ( const GriddedField gf)

Copy grids.

Copies the grids from the given GriddedField to the current one.

Parameters
[in]gfSource gridded field

Definition at line 59 of file gridded_fields.cc.

References ARTS_ASSERT, dim, get_dim(), get_grid_type(), get_numeric_grid(), get_string_grid(), GRID_TYPE_NUMERIC, GRID_TYPE_STRING, mgridtypes, mnumericgrids, and mstringgrids.

◆ get_dim()

Index GriddedField::get_dim ( ) const
inline

Get the dimension of this gridded field.

Returns
Dimension.

Definition at line 127 of file gridded_fields.h.

References dim.

Referenced by chk_griddedfield_gridname(), copy_grids(), xml_read_from_stream(), and xml_write_to_stream().

◆ get_grid_name()

const String & GriddedField::get_grid_name ( Index  i) const
inline

Get grid name.

Returns the name of the grid with index i.

Parameters
[in]iGrid index.
Returns
Grid name.

Definition at line 138 of file gridded_fields.h.

References mgridnames.

Referenced by chk_griddedfield_gridname(), GriddedFieldLatLonExpand(), GriddedFieldLatLonRegrid(), GriddedFieldLatLonRegridHelper(), GriddedFieldPRegrid(), GriddedFieldPRegridHelper(), GriddedFieldZToPRegrid(), and xml_write_to_stream().

◆ get_grid_size()

◆ get_grid_type()

GridType GriddedField::get_grid_type ( Index  i) const
inline

Get grid type.

Returns the type of the grid with index i.

Parameters
[in]iGrid index.
Returns
Grid type.

Definition at line 169 of file gridded_fields.h.

References mgridtypes.

Referenced by copy_grids(), and xml_write_to_stream().

◆ get_name()

const String & GriddedField::get_name ( ) const
inline

Get the name of this gridded field.

Returns
Gridded field name.

Definition at line 181 of file gridded_fields.h.

References mname.

Referenced by chk_griddedfield_gridname(), main(), and xml_write_to_stream().

◆ get_numeric_grid() [1/2]

Vector & GriddedField::get_numeric_grid ( Index  i)

Get a numeric grid.

Returns the numeric grid with index i.

Throws a runtime error if grid i is not of type Numeric.

Parameters
[in]iGrid index.
Returns
Numeric grid.

Definition at line 105 of file gridded_fields.cc.

References ARTS_ASSERT, ARTS_USER_ERROR_IF, dim, GRID_TYPE_NUMERIC, mgridnames, mgridtypes, mname, mnumericgrids, and var_string().

◆ get_numeric_grid() [2/2]

◆ get_string_grid() [1/2]

ArrayOfString & GriddedField::get_string_grid ( Index  i)

Get a string grid.

Returns the string grid with index i.

Throws a runtime error if grid i is not of type String.

Parameters
[in]iGrid index.
Returns
String grid.

Definition at line 141 of file gridded_fields.cc.

References ARTS_ASSERT, ARTS_USER_ERROR_IF, dim, GRID_TYPE_STRING, mgridnames, mgridtypes, mname, mstringgrids, and var_string().

◆ get_string_grid() [2/2]

const ArrayOfString & GriddedField::get_string_grid ( Index  i) const

Get a string grid.

Returns the string grid with index i.

Throws a runtime error if grid i is not of type String.

Parameters
[in]iGrid index.
Returns
String grid.

Definition at line 123 of file gridded_fields.cc.

References ARTS_ASSERT, ARTS_USER_ERROR_IF, dim, GRID_TYPE_STRING, mgridnames, mgridtypes, mname, mstringgrids, and var_string().

Referenced by antenna1d_matrix(), antenna2d_interp_response(), atm_fields_compactAddConstant(), atm_fields_compactCleanup(), atm_fields_compactExpand(), copy_grids(), sensor_responseAntenna(), and xml_write_to_stream().

◆ set_grid() [1/2]

void GriddedField::set_grid ( Index  i,
const ArrayOfString g 
)

Set a string grid.

Sets grid i to the given grid.

Parameters
[in]iGrid index.
[in]gNew grid.

Definition at line 171 of file gridded_fields.cc.

References ARTS_ASSERT, dim, GRID_TYPE_STRING, mgridtypes, mnumericgrids, and mstringgrids.

◆ set_grid() [2/2]

◆ set_grid_name()

◆ set_name()

void GriddedField::set_name ( const String s)
inline

Set name of this gridded field.

Parameters
[in]sGridded field name.

Definition at line 201 of file gridded_fields.h.

References mname.

Referenced by antenna_responseGaussian(), antenna_responseVaryingGaussian(), iyIndependentBeamApproximation(), main(), sensor_responseGenericAMSU(), sensor_responseSimpleAMSU(), and xml_read_from_stream().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const GriddedField gf 
)
friend

Member Data Documentation

◆ dim

Index GriddedField::dim
private

◆ mgridnames

ArrayOfString GriddedField::mgridnames
private

◆ mgridtypes

Array<GridType> GriddedField::mgridtypes
private

◆ mname

String GriddedField::mname
private

Definition at line 84 of file gridded_fields.h.

Referenced by get_name(), get_numeric_grid(), get_string_grid(), operator<<(), and set_name().

◆ mnumericgrids

ArrayOfVector GriddedField::mnumericgrids
private

Definition at line 88 of file gridded_fields.h.

Referenced by copy_grids(), get_grid_size(), get_numeric_grid(), operator<<(), and set_grid().

◆ mstringgrids

Array<ArrayOfString> GriddedField::mstringgrids
private

Definition at line 87 of file gridded_fields.h.

Referenced by copy_grids(), get_grid_size(), get_string_grid(), operator<<(), and set_grid().


The documentation for this class was generated from the following files: