NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Michelle:
Tom, I was actually wondering if it was possible to extract the rangevalue for the "index" input field.
What do you mean? In your example, the MathType is:(index) -> (torque,RI_X,RI_Z,DRY_Mass,Prop_mass,RW_Index,RW_Choice,Pay_power,Pay
_Mass,MinFreqMode,Miss_Life,Slew_Angle,Delta_V,Slew_Time,Mass,sheet_thick,Cost)that tells me that 'index' is the domain of your "function" and the tuple 'torque, RI_X, ..., Cost' is the range. So to say "extract the range value for 'index' means to me that you want to get the values of 'torque, RI_X, ..., Cost' for some value of 'index'. In my example, you would simply refer to "a[0]" and that gives you the tuple of 'torque...' for index=0.
ie. I'm trying to see if the input "index" is mapped to the Visad parameter "iso-contour".
I'm not sure what this has to do with the "range value" you asked about in the previous sentence?
I don't think I can just access the value of the first spot in an array of the types since index seems to occur in different places in the domain (and is
In your MathType, you only have _one_ domain component: index. Everything else is a "range component".
listed in a different order on the left column of the mapping dialog box) for each csv file I've tried. Do you know if there is a way to see what value "index" was mapped to?
I'm going to assume you're only interested in discovering the Scalar-to-Display mappings you've done, and are really only interested in finding out what, if anything, the RealType called "index" has been mapped to a DisplayScalar.
You can use: display.getMapVector()which will return a Vector of the mappings. You can then look at each element's getDisplayScalar() and see if that is iso-contour (I use the toString() method for that...), and getScalar() to see if it is 'index' or whatever.
Sorry for my confusion... tom
Thanks, Michelle Michelle Kam (408) 742-2881 Lockheed Martin Space Systems Co. SSM/ATC/MSISB/153 O/L922 1111 Lockheed Martin Way, Sunnyvale, CA 94089-----Original Message----- From: Bill Hibbard [mailto:billh@xxxxxxxxxxxxx] Sent: Tuesday, July 22, 2003 12:07 PM To: Kam, Michelle C Cc: visad-list@xxxxxxxxxxxxx Subject: RE: ShadowFunctionOrSetType On Tue, 22 Jul 2003, Kam, Michelle C wrote:I'm referring to an example shown below from the url you suggested.ButI'm wondering how to specify the Data object, "d:\\visad\\data\\tes5.csv", before calling getType() on it. I don't know of a Data constructor that can take in a string.You have to have a Data object before calling getType(). You can either construct the Data object, or read it from a file.Also, when I get the FunctionType and call getDomain() on the FunctionType, it returnsaRealTupleType and I think TupleType.TupleComponents.length would then give me the number of input fields. Would that be one way to extractthenumber of input fields?Yes.// get the MathType of a Data object named 'vis5d' FunctionType vis5d_type = (FunctionType) vis5d.getType(); // extract time, the domain of the FunctionType RealType time = (RealType) vis5d_type.getDomain().getComponent(0); Also, if the exception was thrown because index was in the domain ofthefunction and it was mapped to iso-contour, are there other fields intheVisad range that would produce the same error when index is mapped to it? What about other input fields in the domain besides index?I think you'd get the same Exception with Flow, Text, Shape and ShapeScale. Good luck, Bill
-- Tom Whittaker (tomw@xxxxxxxxxxxxx) University of Wisconsin-Madison Space Science and Engineering Center Cooperative Institute for Meteorological Satellite Studies Phone/VoiceMail: 608.262.2759
visad
archives: