Re: warping space

Hi Rick,

> i'm working on a soil science application, wherein the data are in a
> time series of Gridded3DSets.  the Z dimension is depth below the
> surface.  so far, so good.
> unfortunately, the surface isn't flat, and i want to display the data
> with regard to absolute depth, not depth measured from the surface.  i
> have the elevation data, of course.  conceptually speaking, what i want
> to do is shove data values deeper down in Z where there's a hollow on
> the surface, and pull them higher up where there's a hill.
> i can use the brute-force approach, of course: extract the samples into
> arrays, and move the values up or down in each Z column depending on the
> elevation at that point.  but that's ugly, and probably inaccurate to
> boot,  since the set isn't uniformly sampled (there are fewer samples as
> you go deeper).
> there's probably a spiffy way to resample my Gridded3DSets to accomplish
> this, but i'm danged if i know what it is.  does anything obvious leap
> out at y'all?

In your program you must construct your Gridded3DSet with a
call like:

  Set set = new Gridded3DSet(set_type, samples, ...);

where samples is an array float[3][number_of_samples].
Before the constructor call, put in a loop like:

  for (int i=0; i<number_of_samples; i++) {
    float x = samples[0][i];
    float y = samples[1][i];
    float z_surface = some_function_of(x, y);
    samples[2][i] = z_surface - samples[2][i];
  Set set = new Gridded3DSet(set_type, samples, ...);

This will convert your surface-relative depths to altitude
above sea level, which can be converted to any other
absolute depth measure.

- ----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: