Previous: Overview of Data Sources Next: Creating a Weather Text Data Source Table of contents Frames User guide
Unidata IDV Workshop for version 6.2u2 > Java Developer Topics > Data Sources

5.5.1 Using VisAD Data in the IDV
The IDV uses VisAD visad.Data objects to model the different types of data.

The VisAD data model was designed to support virtually any numerical data. Rather than providing a variety of specific data structures like images, grids and tables, the VisAD data model defines a set of classes that can be used to build any hierarchical numerical data structures. All these objects are defined in subclasses of visad.Data and can be compared and manipulated without converting from one form to another. This page is not meant to be a comprehensive overview of the VisAD data model, but rather to show what Data objects are used in the IDV. However, let's look at a good description here.

For more detailed information on the VisAD Data model, see:

Getting data into the IDV

The getData() method of the DataSource class returns a VisAD Data object. This generalization allows us to easily create new DataSources without having to cast the return to a specific form. The basic task of a developer creating a new DataSource is to transform the raw data into one of the known VisAD Data forms that the IDV uses.

Grids

The IDV models grids as visad.FieldImpl objects. A grid can take the form of:
  (x,y) -> (parm)
  (x,y) -> (parm1, ..., parmN)
  (x,y,z) -> (parm)
  (x,y,z) -> (parm1, ..., parmN)
  (t -> (x,y) -> (parm))
  (t -> (x,y) -> (parm1, ..., parmN))
  (t -> (x,y,z) -> (parm))
  (t -> (x,y,z) -> (parm1, ..., parmN))
  (t -> (index -> (x,y) -> (parm)))
  (t -> (index -> (x,y) -> (parm1, ..., parmN)))
  (t -> (index -> (x,y,z) -> (parm)))
  (t -> (index -> (x,y,z) -> (parm1, ..., parmN)))
In general, t is a time variable, but it might also be just an index. In the last 4 examples, index can be an index to a set of radar rays for an RHI, or an ensemble index. The ucar.unidata.data.grid.GridUtil and ucar.unidata.data.grid.GridMath classes provide utilities for slicing, dicing, querying and performing mathematical operations on data that fits into these forms.

Images (satellite, radar)

Just like grids, images are modelled as FieldImpl-s and generally have the form of:
  (x,y) -> (parm)
  (x,y) -> (parm1, ..., parmN)
  (t -> (x,y) -> (parm))
  (t -> (x,y) -> (parm1, ..., parmN))

RGB Images (GIF, JPEG, PNG)

These are also modelled as FieldImpl-s, but have 3 or 4 components:
  (x,y) -> (red, green, blue)
  (x,y) -> (red, green, blue, alpha)
  (t -> (x,y) -> (red, green, blue))
  (t -> (x,y) -> (red, green, blue, alpha))

Point Data

Point data (METAR, earthquake, lightning) are modelled using the ucar.unidata.data.point.PointOb structure which has the methods:
    /**
     * Get the location (lat/lon/alt) of the observation.
     * @return georeference location
     */
    public EarthLocation getEarthLocation();

    /**
     * Get the time of the observation.
     * @return  time the observation was taken
     */
    public DateTime getDateTime();

    /**
     * Get the data associated with this observation.
     * @return observed data for this location and time.
     */
    public Data getData();
In the IDV, we use the ucar.unidata.data.point.PointObTuple to implement this interface as a visad.Tuple.

Text

Text data is modelled using the visad.Text object which is basically a wrapper for a String.

Map Lines

Map lines are a set of lat/lon and possibly alt points defined by a VisAD visad.Gridded*DSet where * is usually 2, but can be 3 if altitude is present. It has a 1D manifold in either case. (Latitude, Longitude) (Latitude, Longitude, Altitude)

Miscellaneous

Most other data in the IDV is modelled using some form of FieldImpl structure. For example, aircraft tracks have the form:
  (t -> (x,y,z) -> (parm))
but wouldn't be thought of as a grid or image. However, using such a structure allows us to easily compare the values along an aircraft track with colocated points in a grid.

Geolocation

Some data (e.g., Point Data) include the necessary information to geolocate data (Latitude, Longitude, Altitude). Other data (grids, images) may have their spatial extents defined in native coordinates (line/element, row/column). The IDV uses the visad.CoordinateSystem class to provide the necessary transforms for geolocation. These provide on-the-fly coordinate transforms.

Time

The IDV uses the visad.DateTime class for time animation. DateTime describes time values in seconds since some point. It provides methods for formatting the values to timestamps and creating sets from arrays of DateTime objects.

 


Previous: Overview of Data Sources Next: Creating a Weather Text Data Source Table of contents Frames User guide
Unidata IDV Workshop for version 6.2u2 > Java Developer Topics > Data Sources