[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20030616: FieldImpl and RealTuple questions



Dan-

Daniel Bramer wrote:
From that method you should get something that is either:

(x,y,z) -> (value)

or

(Time -> ((x,y,z) -> (value)))  (for a time sequence)

What format do you want to pass to your applet in the end (z->value)?


I think so. I am a little inexperienced in the nomenclature you're displaying above, but I think this is correct.

Once you get your FieldImp back from the sampling routine, you
could call:

    System.out.println(myField.getType());

which will print out the MathType (layout/schema) of the Field (myField).
Another useful routine is:

    visad.python.JPythonMethods.dumpTypes(Data d)

(all VisAD objects are subclasses of Data).  You need to put
a try/catch block around this because it throws a RemoteException.


I am also away from my office today. However, I did want to send this off now. If I think of something else, I'll send another note. Lets say I want to take a sounding data field (with or without winds) and pass all of that information to my models. Jeff gave me the impression that I should be trying to pass a Tuple of Tuples into my model, and my model could break down the tuple into arrays of reals for use.

never trust jeff. ;-)

The method I've used to get to where I am leaves me with a FieldImpl. Again, if there's a better way from the 3D field, I'm flexible enough to change my models to deal with another class of data.

The result will either be a FieldImpl or a FlatField (subclass of
FieldImpl which is used for only one time).  What you will get back
from GridUtil.getProfileAtLatLonPoint(FieldImpl, LatLonPoint) is
something with a MathType of:

  (x, y, z) -> (t, td)              (FlatField)

or

  (time -> ((x, y, z) -> (t, td)))   (FieldImpl of FlatFields)

Depending on what you passed in, x,y,z will either be in terms
of (row, col, press) with a CoordinateSystem to (Latitude, Longitude,
Altitude) or just be (Latitude, Longitude, Altitude).  It will
be the same as what got passed in.

What you probabaly want for your stuff is (z -> (t, td)) or
(time -> (z -> (t,td))) so you'd have to decompose the FieldImpl.
We do the same thing in ProfileControl.loadProfile() which
calls  displayProfileForCoord.  In that method, the FieldImpl profile
will end up being one of the MathTypes above.  For each of
the  resulting (z -> (t, td)) FlatFields (ff), you could get the set of
altitudes by calling:

    ff.getDomainSet().getSamples();

which would return an array of float[1][numlevels].  To get
the temp and dewpoint, you could call:

    ff.getSamples();

which would give you an array of float[2][numlevels] with
array[0] being the temp and array[1] being the dewpoint.

I hope that helped.

Back at you.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
address@hidden                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************