After importing your data field, wire through the Mark module, marking
"positions". Wire this into a Compute module with the Expression set to
something like:

[a.z*cos(a.x)*sin(a.y), a.z*sin(a.x)*sin(a.y), a.z*cos(a.y)]

It's tricky because the coordinates are in reverse order from what you
expect (i.e. my coordinates are radius, polar, azimuthal, which get 
assigned to z,y,x respectively).

Wire the compute output through Unmark, again unmarking "positions".

You should now have your irregular field stored with the x,y,z cartesian
coordinates of your grid points.

I use this to render all the visualizations at

http://astro.physics.ncsu.edu/~mpowen/

Michael Owen
Theoretical Astrophysics Group
Department of Physics
North Carolina State University


On Fri, 2003-05-09 at 11:38, Susan Wahl wrote:
> I am reading in a netCDF file through the Import
> routine.  From the documentation, I understand
> that each variable is placed in the data model
> as "data" and the "positions" are internally computed.
> The first 3 variables are the actual positions in
> spherical coordinates (R, theta, phi) that are scalar
> 1-D arrays.  However, these are not of equal dimensions 
> (64, 30, 45), which makes a standard "Compute" not
> possible.  The way these are written out produces
> a cube rather than a sphere, i.e., the radial component
> is at a constant distance (regular grid).  The objective
> is to transform this regular grid to a spherical
> grid (slightly irregular) and replace the positions
> produced by DX with the computed positions.
> 
> I am hoping to be able to do this in the network
> without having to write an external C program.
> 
> Thanks for any help.
> 

Reply via email to