Great.  I think thats the best solution.  I was wondering (as long as we
are on the subject) whether it could do something moderately intelligent if
the grid is not given.  If the data were defined on a axis-aligned grid,
then it seems like one could, for each axis, extract the corresponding
coordinate from each of the scattered points, sort them, remove the
duplicates and derive the origin and step size for the axis from the
result.  I'm not sure how you'd avoid doing something really bad, however,
if the data was not actually organized on an axis-aligned Cartesian grid.
Might end up inferring some enormous grid thats totally bogus.

Greg


Jeff Braun <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 01/10/2001 05:01:52
PM

Please respond to [email protected]

Sent by:  [EMAIL PROTECTED]


To:   [email protected]
cc:
Subject:  Re: [opendx-dev] Adding a new module to CVS?



On Wed, 10 Jan 2001, Gregory D Abram wrote:

>
> Then I agree with Dave - this seems like a special case of Regrid, where
> the grid is fully regular,  nearest is 1 and radius is 0.   I guess you
are
> inverting the 4x4 |d00 d01 d02 0| and applying the inverse to the
scattered
> (xyz) coordinate to get the (ijk) coordinate?
>                |d10 d11 d12 0|
>                |d20 d21 d22 0|
>                | ox    oy    oz  1|
> I *hope* thats what Regrid does when the grid is regular, but then it
> doesn't assume that the resulting (ijk) coordinate will hit the grid
vertex
> (or at least will with a little rounding).

This does not currently work, because Regrid does not except a radius of
0. But, as I think you are suggesting, the Regrid module could be modified
so that when a radius of 0 is specified, then the Regrid module would
perform the simple tranformation from x,y,z to i,j,k. (rounding to
closest int should assign the data value to the closest grid point).

The cdep case was something I just added after looking at some test cases
and thinking that someone might want to assign the data value to a
cell or find the average value in a cell. I do not know if it really would
be of any use and I agree that your proposed macro would do exactly the
same thing.

So really it sounds like adding a third method to the Regrid module might
work just fine.

Jeff

>
> Couldn't you get the cdep case in a macro in which you create a new grid
> with 1 less point in each dimension and a new origin (orig. origin) +
(0.5
> 0.5 0.5)(deltas),  run Regrid as above,  pull the resulting pdep data
> component off the result, change the dependency attribute to
"connections"
> and Replace it onto the original grid?
>
> This is exactly the sort of discussion we had in the modules committee
> meetings.
>
> Greg
>




Reply via email to