I would like to get back to David's specification and how to handle some
of the questions we encountered with Regrid.

On Fri, 30 Mar 2001, David Thompson wrote:

> Inputs:
> 
> input: field with 1-,2-, or 3-dimensional "positions" or list of 1-,2-, or
>       3-dimensional vectors.
> 
> grid: base with dimensionality matching input.
> 
> nearest: integer or "infinity". The number of nearest points (to each grid
>       point) to be used in computing an average data value.
> 
> radius: scalar or "infinity". Specifies the max radius (from gridpoint) within
>       which the nearest neighbors can be found.

radius = 0  This new option will place the data on the nearest grid point.  
            If more than 1 data values lie within 1/2 delta of a grid
            point, then the average value will be computed.

<<snip>>

> The following are not addressed by this specification:
> 
> 1. If input has components that are connection dependent, what 
> happens? What should happen? Error message, warning, removed?

I would like to elaborate on how connection data is currently handled. I
tested a couple of different data sets and this is what I found. 

a) Construct (6x6x4 grid, 75 data values, con dep) -> Regrid (input)
   Construct (6x6x4 grid, no data values) -> Regrid (grid)

   Regrid output does NOT contain a data component.

b) Construct (6x6x4 grid, 75 data values, con dep) -> Regrid (input) 
   Construct (6x6x4 grid, 144 data values) -> Regrid (grid)

   Regrid output includes data component with same values as 2nd Construct

c) Case b, but Reduce 2nd grid to 3x3x2. Regrid radius set to .5.

   Regrid output includes a data component with 18 values all the same as
   the Reduce output values, except the two output grid points in the
   center are marked as invalid. This is because there are no input points
   within the specified 0.5 radius. Another words, Regrid must
   examine the input positions to determine if any are within the
   specified radius, even if the data input values are not used. If I
   increase the radius to 1, all values are valid.

We had similar results using Regrid on a real 2D connection dependent data
set.


Looking at the Regrid code, there is an attribute dep test 

if(strcmp(DXGetString((String)attr),"positions"))
  goto component_done;

in ConnectNearest(), ConnectRadius(). So when connection dep data is
tested, it is simply skipped. The question we had is should a warning be
issued here to let the user know that the connection dependent data can
not (currently) be regridded? Or should an error be issued halting
execution?

I looked at another case where I made a "data1" component dep on
connections and "data2" component dep on positions. The Regrid output
contains a "data" component with the same values as the Regrid grid input
(or no "data" component if values are not assigned). The output has no
"data1" component and the "data2" component appears to be the correct
regrid. 

At the very least I think a Warning needs to be issued if connection
dependent data is input into Regrid. The problem with Warnings is that
they are often lost in the message window and thus ignored.

The problem with using an Error is that execution is halted and the user
would need to remove the connection dep data in order to procede if the
Field also contains position dep data.

The third option is to implement a way to grid connection dep data.

 
> 2. If input or grid has "invalid positions" what happens? What if 
> missing is set or not set?
> 

Currently, if the Regrid 'grid' input contains invalid positions and
'missing' is not set, these invalid positions are replaced with a new
invalid positions component computed in Regrid.

If 'missing' is set, then the invalid positions component from the 'grid'
input is kept and output from Regrid.

Personally, I don't think using a grid with invalid positions is that
commmon, and if someone wants to combine these invalid positions with new
ones from Regrid, it seems as though this can be simply accomplished by
setting a missing value in Regrid and then use the Include to exclude
them. The resulting invalid postions is thus a combination of both. I can
also see writing Macros to do this.  

I am interested in this because I added the Scatter to Grid option (with
radius = 0) that we discussed in January and I would like it to match the
specifications of the other 2 Regrid methods (Nearest and Radius).

Jeff










Reply via email to