class GCLscalarfield3d | ? ^
|
extends GCLgrid3d as public
Three-dimensional scalar field defined on a GCLgrid framework.
- Source:
- gclgrid.h:997
- Author:
- unascribed
- Version:
- unknown
Friend:
function |
ostream&operator<< |
stream output operator for a 3d scalar field.
Format is:
line 1: n1 n2 n3
line 2+: x1, x2, x3, lat(deg), lon(deg), r(km), val in C output order
(index 3 most rapidly varying).
|
destructor ~GCLscalarfield3d | ? ^
> |
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:1055
- 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.
GCLscalarfield3d(Dbptr db, string grdnm, string fn);
Destructor.
Note the same precautions about application of the default constructor as noted
in
GCLgrid3d::~GCLgrid3d |
- 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 ~ GCLscalarfield3d ( ) |
constructor GCLscalarfield3d | ? ^
< > |
Default constructor.
- Source:
- gclgrid.h:1007
- Code:
public GCLscalarfield3d ( | ) |
constructor GCLscalarfield3d | ? ^
< > |
Simple constructor.
Allocates space for x1, x2, x3, and val arrays and initializes
object data attributes to zero.
- Source:
- gclgrid.h:1016
- 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.
|
- Code:
public GCLscalarfield3d ( | int n1size , |
| int n2size , |
| int n3size ) |
constructor GCLscalarfield3d | ? ^
< > |
Standard copy constructor.
- Source:
- gclgrid.h:1018
- Code:
public GCLscalarfield3d ( | const GCLscalarfield3d & ) |
constructor GCLscalarfield3d | ? ^
< > |
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:1030
- Param:
- Code:
-
method compute_extents | ? ^
< > |
undocumented
- Inherited From:
- GCLgrid3d
- Source:
- gclgrid.h:675
- Code:
public void compute_extents ( | ) |
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:
-
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:
-
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:1091
- 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 ) |
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:
-
See
BasicGCLgrid::get_index
- Inherited From:
- GCLgrid3d
- Source:
- gclgrid.h:625
- Code:
public void get_index ( | int * ind ) |
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:
-
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:
-
method interpolate | ? ^
< > |
Interpolate a 3d scalar field.
Usage and caveats are the same as described in
GCLscalarfield::interpolate
- Source:
- gclgrid.h:1121
- Code:
public double interpolate ( | double , |
| double , |
| double ) |
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 ) |
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 ) |
Multiply all field values by a constant scale factor.
- Source:
- gclgrid.h:1114
- Param:
c
| constant by which the field is to be scaled.
|
- Code:
public void operator *= ( | double c ) |
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:1108
- Code:
public void operator += ( | GCLscalarfield3d & ) |
Standard assignment operator.
- Source:
- gclgrid.h:1057
- Code:
public GCLscalarfield3d & operator = ( | const GCLscalarfield3d & ) |
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 ( | ) |
Scalar field variable stored in a three-dimensional C array.
Index of the field is parallel with coordinate arrays x1, x2, and x3
that define grid point positions in space.
- Source:
- gclgrid.h:1004
- 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.