For typical DEMs, you should do the following:
1. Import via a general array importer (i.e., as a grid). You'll have to
do this twice (once for the data and the other for the coordinates, as you
already noted). The first is a scalar field, the second as a vector field
2. I assume the number entries are the same (i.e., 251x323 and 251x323x2).
3. The default array ordering assumes row majority (last dimension varies
fastest, i.e., like C). Many DEMs are dumped in column majority (like
FORTRAN). That's an option you can specify in general array importer
(e.g., through the data prompter)
4. Most DEMs are cell-centered, not node/vertex-based. You can tell DX
that the data are connection-dependent (the former), but you'll need an
extra coordinate for each dimension.
5. Many DEMs are regularly spaced in some projection. If that's the case
here, then you don't need the coordinates file. You can specify the origin
and delta for each dimension when you import the data array.
You should do this to use the coordinates with the data:
Import (coords) Import(data)
| |
Replace(, , "data","positions")
|
Brent Wood <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 10/24/2002 07:23:58
PM
Please respond to [email protected]
Sent by: [EMAIL PROTECTED]
To: [email protected]
cc:
Subject: [opendx-users] assigning geographic positions to data imported
as a grid
I have two files I'm trying to load into OpenDX. The first is a grid, the
second is a file comprising a lat/long coord for each row in the grid.
(These are to be plotted over a terrain model- I think the terain model is
OK, but I need to get the grid data georeferenced to plot over the
terrain)
The grid has 251 rows & 323 columns, the other file has 323 rows/coord
pairs (so each row/position from the coord file needs to be assigned to
its matching column of the grid)
What I've tried is to import the positions, stick an X & Y as a new first
line & use
ImportSpreadsheet (file of lat long positions)
|
-----------
| |
Mark Mark
|__ __|
| |
Compute a & b -> [a,b]
|
Unmark (positions)
[I think this gives me a data object comprising the 323 positions I
require]
I have also imported the gridded data & saved as a dx format binary file
which displays fine.
The script then has a Replace module to put the positions component of the
lat/long data in the positions component of the grid.
This appears to work (at least it doesn't generate any errors), & I have
print modules to check that the number of members of both incoming files
is 323.
When I pass the data through Color/Colormap/Image, I get an error from the
Image module:
ERROR: Image: Display: Bad parameter: colors are dependent on positions
but have different numbers of entries.
1. Can anyone confirm the appropriate import specs for the grid are (or
aren't), 323x251, column oriented?
2. Is this a reasonable approach in OpenDX to assigning positions to the
grid values? Am I better off using Construct (& if so, how)?
3. Any other pointers to help me get this done?
Any help appreciated.
Brent Wood