GField Class Reference

#include <gridded_fields.h>

Inheritance diagram for GField:

Inheritance graph
[legend]
Collaboration diagram for GField:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Index get_dim () const
 Get the dimension of this gridded field.
void copy_grids (const GField &gf)
 Copy grids.
const Stringget_grid_name (Index i) const
 Get grid name.
Index get_grid_size (const Index i) const
 Get the size of a grid.
GridType get_grid_type (Index i) const
 Get grid type.
ConstVectorView get_numeric_grid (Index i) const
 Get a numeric grid.
VectorView get_numeric_grid (Index i)
 Get a numeric grid.
const ArrayOfStringget_string_grid (Index i) const
 Get a string grid.
ArrayOfStringget_string_grid (Index i)
 Get a string grid.
const Stringget_name () const
 Get the name of this gridded field.
void set_grid (Index i, const Vector &g)
 Set a numeric grid.
void set_grid (Index i, const ArrayOfString &g)
 Set a string grid.
void set_gridname (Index i, const String &s)
 Set grid name.
void set_name (const String &s)
 Set name of this gridded field.
virtual bool checksize () const
 Consistency check.
virtual ~GField ()
 GField destructor.

Protected Member Functions

 GField ()
 Construct an empty GField.
 GField (const Index d, const String s)
 Construct a GField.

Private Attributes

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

Friends

ostream & operator<< (ostream &os, const GField &gf)
 Output operator for GField.


Detailed Description

Abstract base class for gridded fields.

Definition at line 51 of file gridded_fields.h.


Constructor & Destructor Documentation

GField::GField (  )  [inline, protected]

Construct an empty GField.

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

Definition at line 67 of file gridded_fields.h.

GField::GField ( const Index  d,
const String  s 
) [inline, protected]

Construct a GField.

Constructs a GField with the given dimension and name.

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

Parameters:
[in] d Dimension.
[in] s Name.

Definition at line 85 of file gridded_fields.h.

virtual GField::~GField (  )  [inline, virtual]

GField destructor.

Definition at line 165 of file gridded_fields.h.


Member Function Documentation

Index GField::get_dim (  )  const [inline]

Get the dimension of this gridded field.

Returns:
Dimension.

Definition at line 97 of file gridded_fields.h.

References dim.

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

void GField::copy_grids ( const GField gf  ) 

Copy grids.

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

Parameters:
[in] gf Source gridded field

Definition at line 59 of file gridded_fields.cc.

References dim, get_dim(), get_grid_type(), get_numeric_grid(), get_string_grid(), GRIDTYPE_NUMERIC, GRIDTYPE_STRING, mgridtypes, mnumericgrids, and mstringgrids.

const String& GField::get_grid_name ( Index  i  )  const [inline]

Get grid name.

Returns the name of the grid with index i.

Parameters:
[in] i Grid index.
Returns:
Grid name.

Definition at line 108 of file gridded_fields.h.

References mgridnames.

Referenced by interp_gfield3(), and xml_write_to_stream().

Index GField::get_grid_size ( const Index  i  )  const

Get the size of a grid.

Returns the size of grid i.

Parameters:
[in] i Grid index.
Returns:
Grid size.

Definition at line 89 of file gridded_fields.cc.

References dim, GRIDTYPE_NUMERIC, GRIDTYPE_STRING, mgridtypes, mnumericgrids, mstringgrids, and Array< base >::nelem().

Referenced by AtmFieldsFromCompact(), GField4::checksize(), GField3::checksize(), GField2::checksize(), GField1::checksize(), GField4::resize(), GField3::resize(), GField2::resize(), and GField1::resize().

GridType GField::get_grid_type ( Index  i  )  const [inline]

Get grid type.

Returns the type of the grid with index i.

Parameters:
[in] i Grid index.
Returns:
Grid type.

Definition at line 119 of file gridded_fields.h.

References mgridtypes.

Referenced by copy_grids(), and xml_write_to_stream().

ConstVectorView GField::get_numeric_grid ( Index  i  )  const

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] i Grid index.
Returns:
Numeric grid.

Definition at line 112 of file gridded_fields.cc.

References dim, GRIDTYPE_NUMERIC, mgridnames, mgridtypes, mname, and mnumericgrids.

Referenced by antenna1d_matrix(), AtmFieldsCalc(), AtmFieldsFromCompact(), chk_if_pnd_zero_lat(), chk_if_pnd_zero_lon(), chk_if_pnd_zero_p(), chk_pnd_data(), copy_grids(), interp_gfield3(), mixer_matrix(), sensor_responseAntenna(), sensor_responseMixer(), xml_write_to_stream(), ybatchMetProfiles(), and ybatchMetProfilesClear().

VectorView GField::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] i Grid index.
Returns:
Numeric grid.

Definition at line 145 of file gridded_fields.cc.

References dim, GRIDTYPE_NUMERIC, mgridnames, mgridtypes, mname, and mnumericgrids.

const ArrayOfString & GField::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] i Grid index.
Returns:
String grid.

Definition at line 178 of file gridded_fields.cc.

References dim, GRIDTYPE_STRING, mgridnames, mgridtypes, mname, and mstringgrids.

Referenced by antenna1d_matrix(), atm_fields_compactAddConstant(), AtmFieldsFromCompact(), copy_grids(), sensor_responseAntenna(), and xml_write_to_stream().

ArrayOfString & GField::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] i Grid index.
Returns:
String grid.

Definition at line 212 of file gridded_fields.cc.

References dim, GRIDTYPE_STRING, mgridnames, mgridtypes, mname, and mstringgrids.

const String& GField::get_name (  )  const [inline]

Get the name of this gridded field.

Returns:
Gridded field name.

Definition at line 131 of file gridded_fields.h.

References mname.

Referenced by xml_write_to_stream().

void GField::set_grid ( Index  i,
const Vector g 
)

Set a numeric grid.

Sets grid i to the given grid.

Parameters:
[in] i Grid index.
[in] g New grid.

Definition at line 244 of file gridded_fields.cc.

References dim, GRIDTYPE_NUMERIC, mgridtypes, mnumericgrids, and mstringgrids.

Referenced by atm_fields_compactFromMatrix(), and xml_read_from_stream().

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

Set a string grid.

Sets grid i to the given grid.

Parameters:
[in] i Grid index.
[in] g New grid.

Definition at line 260 of file gridded_fields.cc.

References dim, GRIDTYPE_STRING, mgridtypes, mnumericgrids, and mstringgrids.

void GField::set_gridname ( Index  i,
const String s 
) [inline]

Set grid name.

Sets the name with the given index.

Parameters:
[in] i Grid index.
[in] s Grid name.

Definition at line 144 of file gridded_fields.h.

References dim, and mgridnames.

Referenced by xml_read_from_stream().

void GField::set_name ( const String s  )  [inline]

Set name of this gridded field.

Parameters:
[in] s Gridded field name.

Definition at line 152 of file gridded_fields.h.

References mname.

Referenced by xml_read_from_stream().

virtual bool GField::checksize (  )  const [inline, 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.

Reimplemented in GField1, GField2, GField3, and GField4.

Definition at line 162 of file gridded_fields.h.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const GField gf 
) [friend]

Output operator for GField.

Outputs the grids for the given GField.

Parameters:
[in,out] os Output stream.
[in] gf GField.

Definition at line 276 of file gridded_fields.cc.


Member Data Documentation

Index GField::dim [private]

String GField::mname [private]

Definition at line 55 of file gridded_fields.h.

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

Definition at line 58 of file gridded_fields.h.

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

Definition at line 59 of file gridded_fields.h.

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


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

Generated on Mon Mar 23 14:06:59 2009 for ARTS by  doxygen 1.5.6