Using JPythonMethod's data type functions

May, 2001


VisAD's Data Model is designed to be very generalized around the principle of finite samples of functions. Because of this, there are two, related constructs used. The first defines the Type of the data object. Are the values of the range simple numbers, represented as VisAD "Real" quantities? If so, then the values have a Type that is called RealType. (just as a number in your Fortran program has a type called Double Precision).

As you'll see, VisAD Types do not have to be simple one-sylable parameters; in fact, most are not. VisAD has terminology to cope with these, words like "RealTupleType" and "FunctionType" and "SetType". The key is that each quantitiy in VisAD must have a type...just like in any other language. VisAD also has TextTypes, and so there is a more generic way to refer to all these: MathType

Type-related functions

Here's a brief example:
If you then just command t you'll see what t now is.

If you want a more thorough listing of the type information, use the dumpTypes(d) function and you will get a listing that looks like:

VisAD MathType analysis
  Domain has 2 components:
   0. RealType: Longitude
   0.   Name = Longitude
   0.   Unit: deg
   1. RealType: Latitude
   1.   Name = Latitude
   1.   Unit: deg
    RealTupleType has 1 components:
     0. RealType: value
     0.   Name = value
- - - - - - - - - - - - - - - - - - - - - - -
DataType analysis...
    FlatField of length = 360
    ((Longitude, Latitude) -> value)
      Domain has 2 components:
        Linear2DSet: Length = 360
          0. Linear1DSet (GENERIC_REAL) Range = -130.0 to -40.0 step 10.0
          1. Linear1DSet (GENERIC_REAL) Range = 20.0 to 60.0 step 1.1428571428571428
      Range has 1 components:
        0. FloatSet (value) Dimension = 1
        0. number missing = 10
The first portion of this is for the "MathTypes" (ref: VisAD tutorial), that is the types of the variables defined by the structure (like "real" or "function"), and shows their structure and relationships.

The second portion of this is for the "Data Types", that is what data structures (and sub-structures) are defined; you'll notice that where possible some numeric information is also provided. In this case, a VisAD "FlatField" (basically, an array of 360 samples) is defined as a mapping from a domain of (Lontitude,Latitude) pairs to a set of floating point numbers in the range. Remember that VisAD data are really finite samples of continuous functions, so what is being shown here is that there are 360 samples in the Longitude space from (-130 to -40) and Latitude space from (20 to 60).

VisAD data structures can be vary in complexity, and I encourage you to look over the VisAD tutorial for programmers for more details. Later sections of this tutorial will discuss how to manipulate the data in the objects.

Field data object manipulation utilities

More examples using all these...

Back to the home page