Magnus Hagdorn:
 |...problem with setting up the positions. ... the horizontal
 |coordinates (x,y) a regularly spaced. the z-component is irregularly
 |spaced. 
...
 |i've got two 1d vectors X(x) and Y(y) describing the x and y
 |coords. the vertical coords depend on a 2d field H(x,y) multiplied by a
 |vector Z(z), so Z~(x,y,z)=Z(z)*H(x,y). 

Ok, this sounds a lot like a terrain-approximating grid used in some of the
atmospheric datasets around here (so much for netCDF being
"self-describing", eh?).  

Presuming Z(z) is irregularly spaced but uniform for all cells in a Z
slice, you can use a product array of two regular arrays (x & y) and an
explicit array (z) to get your positions.  Then have a H(x,y) topography
field you can attach and use to Rubbersheet your grid from X,Y,Z to its
true X,Y,Z~ spatial form when needed.

Alternatively you can up-front just output x*y cells with explicit
positions and connections, but be mindful that processing will be much
slower than on a regular grid and of course it (and derivative datasets)
will be huge in comparison to the regular grid rep.  If all of your
operations don't need this spatially-correct representation, probably best
to store it and keep it regular until you need it warped.

An M3IO netCDF -to- DX subsetting tool Todd Plessel and Mark Bolstad wrote
a while back uses grid defs like the above to describe netCDF atmospheric
data, also handling this grid warping for terrain-approximating grids, map
projections, etc.  If you need more detail let me know.

Randy

-- 
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA MD/24 ERC-1A; RTP, NC 27711

Reply via email to