There are two aspects of ordering that may be an issue here -- coordinates and arrays. Whatever order of the coordinates was used to dump arrays to netCDF is what is used by Import. This can be verified by comparing ncdump -h to what Print shows. Independently of that order, you can use Transpose to switch the order of coordinates. For example, many atmospheric simulations dump arrays in z, x, y order (e.g., pressure or altitude or sigma, latitude, longitude). With Transpose, you can switch it to x, y, z.
The other aspect is the arrays themselves. NetCDF orders arrays by row majority (C convention -- last dimension varying fastest). So, this is what Import assumes. However, some users of netCDF violate this assumption and order the data differently for which DX would have no way of knowing. This is more of a problem. If you want to do this entirely within DX, you'll need to break up the 3d array into a group of 2d slices and use Reorient to flip each array and then Stack the 2d arrays back into a volume. Although this might be messy, it's easily encapsulated as a macro, that you will only need to run once (i.e., Replace'g the corrected coordinates for each variable or time step), and the operation will be fast. Samuel Jones <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 08/16/2000 05:33:06 PM Please respond to [email protected] Sent by: [EMAIL PROTECTED] To: [email protected] cc: Subject: [opendx-users] netCDF coordinate inversion Hello I am reading in a netCDF file generated by a fortran simulation. The import module is reading the x,y,z coordinates in the wrong order. Is there some way to switch coordinates for a data set? Is there some way to specify the order of netCDF import? thanks -/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\- Samuel Jones phone: 303-492-0425 Department of Physics fax : 303-492-0642 Campus Box 390 email: [EMAIL PROTECTED] University of Colorado www : hybrid.colorado.edu/~ssjones Boulder, CO 80309
