GCLgrid :: GCLgrid classes

class GCLvectorfield3d

? ^ 
    extends GCLgrid3d as public

Three-dimensional vector field defined on a GCLgrid framework.
Source:
gclgrid.h:1135
Author:
unascribed
Version:
unknown
Friend:
function ostream&operator<< stream output operator for a 3d scalar field.

Format is:

line 1:  n1 n2 n3 nv
line 2+:  x1, x2, x3, lat(deg), lon(deg), r(km), val[0..nv-1] in C output order 
		(index 3 most rapidly varying).

Contents

^ 
EntityInherited FromTypeScopeShort Description
~GCLvectorfield3ddestructor public Destructor.
GCLvectorfield3dconstructor publicDefault constructor.
GCLvectorfield3dconstructor public Simple constructor.
GCLvectorfield3dconstructor publicStandard copy constructor.
GCLvectorfield3dconstructor public Partial copy constructor cloning grid but not setting field variable.
GCLvectorfield3dconstructor public Antelope database driven constructor.
compute_extentsGCLgrid3dmethod publicundocumented
ctogBasicGCLgridmethod public Convert Cartesian coordinates to geographical coordinates.
ctogBasicGCLgridmethod public Convert from Cartesian coordinates to geographical coordinates.
dbsavemethod public Save field to an Antelope (Datascope) database.
depthGCLgrid3dmethod public Get the depth below the standard reference ellipsoid of a grid point.
fetch_transformation_matrixBasicGCLgridmethod public Returns the transformation matrix for this grid as a 3x3 dmatrix object.
fetch_translation_vectorBasicGCLgridmethod public Returns a newly allocated 3 vector of double containing a copy of the translation vector defining the GCLgrid transformation property.
geo_coordinatesGCLgrid3dmethod public Returns the geographical coordinates of a point in the grid specified by grid index positions.
get_indexGCLgrid3dmethod publicSee BasicGCLgrid::get_index
gtocBasicGCLgridmethod public Convert from geographical to Cartesian coordinates in the GCLgrid coordinate system.
gtocBasicGCLgridmethod public Convert from geographical to Cartesian coordinates in the GCLgrid coordinate system.
interpolatemethod public Interpolate a 3d scalar field.
latGCLgrid3dmethod public Get the latitude (in radians) of a grid point.
lookupGCLgrid3dmethod public Save grid to an Antelope (Datascope) database.
nvattribute publicNumber of components to each vector of the field.
operator *=operator public Multiply all field values by a constant scale factor.
operator +=operator public Add one field to another.
operator =operator publicStandard assignment operator.
rGCLgrid3dmethod public Get the longitude (in radians) of a grid point.
reset_indexGCLgrid3dmethod publicSee BasicGCLgrid::reset_index
set_transformation_matrixBasicGCLgridmethod public Set or reset the transformation properties for the grid.
valattribute public Scalar field variable stored in a four-dimensional C array.

destructor ~GCLvectorfield3d

? ^  > 
Destructor.

Note the same precautions about application of the default constructor as noted in GCLgrid3d::~GCLgrid3d

Source:
gclgrid.h:1200
Code:
public ~ GCLvectorfield3d ( )

constructor GCLvectorfield3d

? ^  < > 
Default constructor.
Source:
gclgrid.h:1148
Code:
public GCLvectorfield3d ( )

constructor GCLvectorfield3d

? ^  < > 
Simple constructor.

Allocates space for x1, x2, x3, and val arrays and initializes object data attributes to zero.

Source:
gclgrid.h:1158
Params:
n1size number of grid points on generalized coordinate axis 1.
n2size number of grid points on generalized coordinate axis 2.
n3size number of grid points on generalized coordinate axis 3.
nvsize number of components of vectors in this field
Code:
public GCLvectorfield3d ( int n1size ,
int n2size ,
int n3size ,
int nvsize )

constructor GCLvectorfield3d

? ^  < > 
Standard copy constructor.
Source:
gclgrid.h:1160
Code:
public GCLvectorfield3d ( const GCLvectorfield3d & )

constructor GCLvectorfield3d

? ^  < > 
Partial copy constructor cloning grid but not setting field variable.

A common situation is to have a grid that is already defined that needs to be cloned and have field variables set through some other mechanism. For example, one might create a standard grid and then plan to load it with values from a different grid or compute values of a field variable at the grid points.

Source:
gclgrid.h:1173
Params:
g Grid to be cloned.
nvsize number of vector components for vector field val array.
Code:
public GCLvectorfield3d ( GCLgrid3d & ,
int nvsize )

constructor GCLvectorfield3d

? ^  < > 
Antelope database driven constructor.

This is a specialized constructor that loads a field tagged with two names: grid name and the field name (see below). The two components are stored separately in the external database using two different tables. This constructor has a fair amount of memory overhead as it loads a copy of the parent GCLgrid object before creating the field and then loading field variable data from the database.

Source:
gclgrid.h:1194
Params:
db Antelope database pointer.
grdnm name of grid to be loaded from the database.
fn name tag for the field to be loaded from the database.
nvsize expected number of components for vectors in field.
Exception:
int Exception is thrown if there are any input problems. A simple int exception is used because errors are posted to the Antelope elog mechanism. If this exception is caught, call elog_complain to flush the elog buffer.

Code:
public GCLvectorfield3d ( Dbptr db ,
string grdnm ,
string fn ,
int nvsize )

method compute_extents

? ^  < > 
undocumented
Inherited From:
GCLgrid3d
Source:
gclgrid.h:675
Code:
public void compute_extents ( )

method ctog

? ^  < > 
Convert Cartesian coordinates to geographical coordinates.
Inherited From:
BasicGCLgrid
Source:
gclgrid.h:208
Params:
x1p - Cartesian x1 coordinate of point to convert
x2p - Cartesian x2 coordinate of point to convert
x3p - Cartesian x3 coordinate of point to convert
Returns:
Geographic_point data structure (see Geographic_point )
Code:
public Geographic_point ctog ( double x1p ,
double x2p ,
double x3p )

method ctog

? ^  < > 
Convert from Cartesian coordinates to geographical coordinates.
Inherited From:
BasicGCLgrid
Source:
gclgrid.h:214
Param:
p point to convert stored in a Cartesian_point data structure
Returns:
Geographic_point data structure (see Geographic_point )
Code:
public Geographic_point ctog ( Cartesian_point p )

method dbsave

? ^  < > 
Save field to an Antelope (Datascope) database.

This routine writes the object attributes to a special table and writes the grid coordinate data to an output file. Note the file name used to store the grid is the same as the name parameter passed to this function. The field variable data are written to a different file and stored indexed with a different database table. An odd feature of this routine is that if the directory name for the field passed to the function is empty (the string equivalent of NULL) the grid is not saved. This is a necessary feature for saving multiple fields on the same parent grid structure.

Source:
gclgrid.h:1235
Params:
db Antelope database pointer.
gclgdir directory to save gclgrid data. If zero length, grid data is not saved.
fielddir directory where field (val) data will be saved. Can be the same as gclgdir, but should not be zero length.
fieldname name assigned to this field.
dfile name of file to be used to save field (val) data. Note the grid data is always saved to a name based in the name attribure of the grid.
Exception:
int Exception is thrown if save failed. A simple int exception is used because errors are posted to the Antelope elog mechanism. If this exception is caught, call elog_complain to flush the elog buffer.

Code:
public void dbsave ( Dbptr db ,
string gclgdir ,
string fielddir ,
string fieldname ,
string dfile ) throw ( int )

method depth

? ^  < > 
Get the depth below the standard reference ellipsoid of a grid point.

Inherited From:
GCLgrid3d
Source:
gclgrid.h:673
Params:
i1 Value of grid index 1 for point desired.
i2 Value of grid index 2 for point desired.
i3 Value of grid index 3 for point desired.
Returns:
depth in kilometers of the requested grid point.
Code:
public double depth ( int ,
int ,
int )

method fetch_transformation_matrix

? ^  < > 
Returns the transformation matrix for this grid as a 3x3 dmatrix object.
Inherited From:
BasicGCLgrid
Source:
gclgrid.h:194
Code:
public dmatrix fetch_transformation_matrix ( )

method fetch_translation_vector

? ^  < > 
Returns a newly allocated 3 vector of double containing a copy of the translation vector defining the GCLgrid transformation property.

The user must be sure to call delete [] after using this vector to avoid a memory leak.

Inherited From:
BasicGCLgrid
Source:
gclgrid.h:200
Code:
public double * fetch_translation_vector ( )

method geo_coordinates

? ^  < > 
Returns the geographical coordinates of a point in the grid specified by grid index positions.

If you need the actual coordinates of the points that define the grid converted to geographic coordinates use this function. Use the ctog function to convert an arbitrary ordered triplet.

Inherited From:
GCLgrid3d
Source:
gclgrid.h:638
Params:
i1 Value of grid index 1 for point desired.
i2 Value of grid index 2 for point desired.
i3 Value of grid index 3 for point desired.
Returns:
grid point requested in an Geographic_point data structure.
Code:
public Geographic_point geo_coordinates ( int i1 ,
int i2 ,
int i3 )

method get_index

? ^  < > 
See BasicGCLgrid::get_index
Inherited From:
GCLgrid3d
Source:
gclgrid.h:625
Code:
public void get_index ( int * ind )

method gtoc

? ^  < > 
Convert from geographical to Cartesian coordinates in the GCLgrid coordinate system.

Inherited From:
BasicGCLgrid
Source:
gclgrid.h:224
Params:
plat Latitude (radians) of point to convert.
plon Longitude (radians) of point to convert.
pr Earth radius (km) of point to convert.
Returns:
Cartesian_point data structure (see @endlink)
Code:
public Cartesian_point gtoc ( double plat ,
double plon ,
double pr )

method gtoc

? ^  < > 
Convert from geographical to Cartesian coordinates in the GCLgrid coordinate system.

Inherited From:
BasicGCLgrid
Source:
gclgrid.h:232
Param:
p point to convert stored in a @link Geographic_point @endlink data structure.
Returns:
Cartesian_point data structure (see @endlink) )
Code:
public Cartesian_point gtoc ( Geographic_point p )

method interpolate

? ^  < > 
Interpolate a 3d scalar field.

Usage and caveats are the same as described in GCLvectorfield::interpolate

Source:
gclgrid.h:1267
Returns:
pointer to vector of doubles allocated with new []. User must take caution to free this array to avoid memory leaks.
Code:
public double * interpolate ( double ,
double ,
double )

method lat

? ^  < > 
Get the latitude (in radians) of a grid point.

Inherited From:
GCLgrid3d
Source:
gclgrid.h:647
Params:
i1 Value of grid index 1 for point desired.
i2 Value of grid index 2 for point desired.
i3 Value of grid index 3 for point desired.
Returns:
latitude in radians of the requested grid point.
Code:
public double lat ( int ,
int ,
int )

method lookup

? ^  < > 
Save grid to an Antelope (Datascope) database.

This routine writes the object attributes to a special table and writes the grid coordinate data an output file. Note the file name used to store the grid is the same as the name parameter passed to this function.

Inherited From:
GCLgrid3d
Source:
gclgrid.h:621
Params:
db Antelope database pointer.
nm name used to save the grid. void dbsave(Dbptr db, string nm) throw(int); Find the index position of a point in a GCLgrid3d object. This is a low level function to find the location of a point specified as the Cartesian, ordered triplet (x1p,x2p,x3p) in a grid. It does not return the actual index positions, but only sets the internal index. The routine is very procedural returning an integer code (see below) indicating success or failure of the lookup. This was intentional as this routine is called millions of times in some contexts so efficiency is critical. The alternative would be to throw an exception when a lookup failed, but since this is viewed as a common problem that could happen millions of times this was a potential efficiency problems (the books all say throwing exceptions is an expensive operation).
x1p - Cartesian x1 coordinate of point to find within the grid
x2p - Cartesian x2 coordinate of point to find within the grid
x3p - Cartesian x3 coordinate of point to find within the grid
Returns:
2 when point is in gray area within on nominal grid spacing of the edge 1 when the point is outside the bounding box. 0 on success.\ -1 if the lookup function did not converge.

Exception:
int Exception is thrown if save failed. A simple int exception is used because errors are posted to the Antelope elog mechanism. If this exception is caught, call elog_complain to flush the elog buffer.

Code:
public int lookup ( double ,
double ,
double )

attribute nv

? ^  < > 
Number of components to each vector of the field.
Source:
gclgrid.h:1138
Code:
public int nv

operator *=

? ^  < > 
Multiply all field values by a constant scale factor.

Source:
gclgrid.h:1258
Param:
c constant by which the field is to be scaled.
Code:
public void operator *= ( double )

operator +=

? ^  < > 
Add one field to another.

This acts like the += operator for simple types, but does so for an entire field defined on a grid. As for simple types the field on the right hand side is accumulated to the field on the left had side of the operator. This works even if the the two fields have different transformation properties and do not match in positions. The most important limitation to understand, however, is basic sampling. The field to contain the accumulation needs to be as denser or more densely sampled as the field on the right hand side to avoid aliasing effects. This is exactly like time series sampling -- upsampling can just be done by interpolation but downsampling requires an antialiasing (smoother) filter.

Source:
gclgrid.h:1252
Code:
public void operator += ( GCLvectorfield3d & )

operator =

? ^  < > 
Standard assignment operator.
Source:
gclgrid.h:1202
Code:
public GCLvectorfield3d & operator = ( const GCLvectorfield3d & )

method r

? ^  < > 
Get the longitude (in radians) of a grid point.

Inherited From:
GCLgrid3d
Source:
gclgrid.h:664
Params:
i1 Value of grid index 1 for point desired.
i2 Value of grid index 2 for point desired.
i3 Value of grid index 3 for point desired. double lon(int,int,int); Get the radius from the center of the Earth of a grid point.

i1 Value of grid index 1 for point desired.
i2 Value of grid index 2 for point desired.
i3 Value of grid index 3 for point desired.
Returns:
latitude in radians of the requested grid point. Earth radius in kilometers of the requested grid point.
Code:
public double r ( int ,
int ,
int )

method reset_index

? ^  < > 
See BasicGCLgrid::reset_index
Inherited From:
GCLgrid3d
Source:
gclgrid.h:623
Code:
public void reset_index ( )

method set_transformation_matrix

? ^  < > 
Set or reset the transformation properties for the grid.

The transformation properties are uniquely defined by the coordinate system origin and azimuth_y so if these are all that are known this low level member function can be called to set the transformation properties. It is of minimal use to most users and should be used cautiously and only if you thoroughly understand the way this all works.

Inherited From:
BasicGCLgrid
Source:
gclgrid.h:190
Code:
public void set_transformation_matrix ( )

attribute val

? ^  < > 
Scalar field variable stored in a four-dimensional C array.

Index of the field is parallel with coordinate arrays x1, x2, and x3 that define grid point positions in space. The fourth index defines the component of each vector of the field.

Source:
gclgrid.h:1145
Code:
public double * * * * val

Created Fri Jan 21 08:54:55 2005.
This documentation was generated automatically by
ccdoc v08r41 2004/09/29 bin_opt_suncc_sun4-solaris-2.8.
Click here to submit a bug report or feature request for ccdoc.
Click here to return to the top of the page.