Ugrid restrict: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
No edit summary
Line 32: Line 32:


== Getting Gridfields ==
== Getting Gridfields ==
The google code site is found [code.google.com/p/gridfields/ here]
The google code site is found [http://code.google.com/p/gridfields/ here]


to checkout the c code necessary to run this function use the command
to checkout the c code necessary to run this function use the command


svn co https://gridfields.googlecode.com/svn/tags/gridfieldsclib-0.7/
svn co https://gridfields.googlecode.com/svn/tags/gridfieldsclib-0.7/

Revision as of 04:32, 9 August 2012

ugrid_restrict

ugrid_restrict is a function creates a grid object out of an input grid according to to an input restriction constraint. At this time the input grid is assumed to be an unstructured grid made up of counter-clockwise oriented triangles.

Input Arguments

Calls to the function take the formugrid_restrict(int dim,string constraint). The first input must be an integer that denotes the dimension which will be restricted. For example setting dim to be 0 would indicate the restriction will occur on nodes.The second input is a string which describes the constraint that should be enforced.

Some Examples

ugrid_restrict(0,"nodedata>0.0")


ugrid_restrict(0,"X>-68.0&X<0&Y>41.5&Y<42.78&nodedata>0.0&nodedata<500")


The first call is pretty basic. This call is restricting the mesh to the nodes such that nodedata (some array bound to the nodes) is greater than 0. You can also have much more complicated constraints: The second call actually combines 6 constraints.

Requirements for the Input File

Every array must have an attribute known as grid_location that can take two possible values. If grid_location="element" this indicates that data is associated with the triangular cell. Otherwise if grid_location="node" the data is associated with the nodes of the grid.

In addition the array containing the connectivity information of the triangular grid must be an n by 3 array that has an attribute cell_type which is equal to "tri_ccw" which indicates the cells are counter clockwise oriented triangles. In addition the connectivity array has an index_origin attribute which must be an integer that gives the value associated with the first cell (usually 1). Finally it must have an attribute coordinates_node that gives the coordinates that will be used for the nodes (for example "X Y").

Demo

A demo that allows easy experimentation with this function can be found here

Possible URLs

http://ec2-174-129-186-110.compute-1.amazonaws.com:8088/opendap/data/nc/test4.nc.nc?ugrid_restrict(0,"Y>41.5&Y<42.75&X>-68.0&X<-66.0")


http://ec2-107-22-36-153.compute-1.amazonaws.com/graph?nodegreat=0.0&nodeless=200

Getting Gridfields

The google code site is found here

to checkout the c code necessary to run this function use the command

svn co https://gridfields.googlecode.com/svn/tags/gridfieldsclib-0.7/