Re: Creating a subsampling set

  • To: Edward Stanford <stanford@xxxxxxx>
  • Subject: Re: Creating a subsampling set
  • From: Doug Lindholm <lind@xxxxxxxx>
  • Date: Tue, 26 Sep 2000 15:51:37 -0600
Edward Stanford wrote:
> I have a FieldImpl containing a 3-D data set.  The domain set is a
> Gridded3DDataSet, created for a sample grid which was nx x ny x nz points,
> with a manifold dimension of 1 (e.g., the data set represents temperatures
> on an irregular grid of lat-lon-pressure).

Is it truly irregular (in which case you should look into using an
IrregularSet) or is it topologically regular in which case you can use a
Gridded3DSet with manifold dimension *3*. 

> So far, so good: I can create my data set nicely, and write it out as a
> VisAD file.  But now I would like to read it back in, then make arbitrary
> 2D displays of pressure surfaces, interpolating, or not, as appropriate.
> The way to proceed would appear to be to
> 1) make a sampling set of the desired slice, namely, a set with all the
> lat-lon points of the original data set, and an arbitrary setting of the
> pressure level
> 2) create a new flatfield by resampling my original data set to this
> sampling set
> 3) and plot the result the way I would any other 2D data set.
> (f there's a better way please let me know).
> However, I run into trouble on (1).  I can certainly get the sampling set
> back out of the FieldImpl, and I can get the samples array out of
> the  sampling set, but how can I get the original dimensions of the set (nx
> x ny x nz)?  There appears to be a private member (lengths[]) of
> Gridded3DSet which would contain the information I need, but there are no
> accessors for it.

I won't guarantee it, but I suspect getLengths() (inherited from
GriddedSet) might do the trick.

Let me know if I can help further. Dealing with sample arrays from
GriddedSets always ties my brain in knots.


| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |