Re: the AD in VisAD

On Thu, 13 Mar 2003, m huang wrote:

> I would like to know more about algorithm development with VisAD.
> For general users who want to develop algorithms to process data,
> is there a way in VisAD to let the user 1) compose an algorithm of
> arbitrary complexity, 2) plug it into perhaps a subclass of
> FlatField WITHOUT having to modify the said FlatField subclass
> source code and recompiling, and 3) run evaluate() on a given
> domain set with the efficiency that is largely limited
> to the efficiency of the code of the algorithm.

Which method of FlatField would you like to extend?

The evaluate() method is defined all the way up in
the Function interface, to support representations
of function other than by finite sampling.

> What is asked for is perhaps an algorithm object that is more
> detached from the actual data, that can be developed and fiddled
> with by the user, that could have parameters (i.e. number of data
> point in a boxcar smoothing algorithm), but can be applied
> to data using a hosting FlatField. Of course the algorithm object has
> to be applicable to the data according to the domain and range
> in the FlatField.

New interpolation algorithms can be implemented by defining
new subclasses of Set and overriding the valueToInterp()
method. This will then be used by FieldImpl and FlatField
when a Set of the new class is used as the Field domain.
The valueToInterp() method can be used to define any
interpolation algorithm using weighted average of samples,
which includes any degree polynomial interpolation and a
wealth of others. To go beyond this, you need to extend
FieldImpl or FlatField and override its resample() method.

This is discussed in Section 3.5.1 of the Developers
Guide, and mentioned in a number of papers I have written.

> Currently FlatField, by implementing DataImpl, can do simple
> math such as sin() exp(). A user could use Jython to realize
> a certain type of complext algorithm using these methods.
> There are limits in developing algorithms this way.
> The efficiency in memory and speed can be a problem if
> the algorithm needs to do many primitive floating point operations,
> and can easily be impossible if the algorithm is more complex
> than doing the same math operation to all elements in the
> data sample (e.g. doing an transformation to an image).

The real intention of the name "Visualization for Algorithm
Development" is exactly this type of quick and easy development
of scientific algorithms via Python. The huge popularity of IDL
and Matlab attests to the importance of this capability to the
science community. Of course, VisAD offers a rich data model
with metadata integration that those systems don't.

We have also tried to exploit object-oriented extensibility
to allow the types of algorithm development you describe.
This addresses the needs of a much smaller community of system
developers. The average scientist is not going to be defining
new subclasses of VisAD classes.

> I could well have missed something obvious in the VisAD framework
> that allows rapid and flexible algorithm developement
> without losing efficiency during execution.
> But if there isn't anything close to the above requirements in VisAD,
> how to implement it? I guess an algorithm can be plugged into
> somewhere in the Funtion-> Field -> FlatField inheritance chain?
> I only use FlatField as example above.
> any thoughts?

Section 11 (Extending the VisAD Java Class Library) gives an
overview of ways that VisAD classes can be extended. More
detail is in specific sections, and in other documents such
as the DataRenderer tutorial. And of course there's always
this visad-list for tough questions.