Re: 17 input fields

Hi Michelle:

Sorry, but I don't know what "vis5d_type" is. In your case, however, the only domain element you have is "index" (the other parameters are range componenets". In Python, subscripts to RealTuples give the the sample at that value...so, you simply say:

a=load('MichelleData.csv')
b=a[0]   (first domain component)
c=a[6]   (7-th domain component)

'b' and 'c' will contain the Data for the range components at that "index" (that is, 'b' is a RealTuple with 17 components). If you referred to b[4] you would get the Real for your "Prop_Mass" parameter.

You could also just say "a[0][4]"...

tom


Kam, Michelle C wrote:

Hi Tom,

Thanks, I was able to load the file in properly. I was wondering if
there is a way to refer to the input field "index" without calling
getComponent() on every single element that vis5d_type.getDomain()
returns and checking if it is "index" like the line below:

RealType time = (RealType) vis5d_type.getDomain().getComponent(0);      

In the file I sent earlier with 17 input fields, index was the first
field but it was not the first element listed in the domain in the
mapping dialog box. In another csv file that had index -> x, y, z etc in
the same way as the one with 17 fields, index showed up as the first
input field. So I can't just getComponenet(0) since it changes per file.


Thanks,
Michelle

Michelle Kam           (408) 742-2881
Lockheed Martin Space Systems Co. SSM/ATC/MSIS
B/153 O/L922 1111 Lockheed Martin Way, Sunnyvale, CA 94089




-----Original Message-----
From: Tom Whittaker [mailto:tomw@xxxxxxxxxxxxx]
Sent: Tuesday, July 22, 2003 11:10 AM
To: Kam, Michelle C; visad
Subject: Re: 17 input fields


Michelle:

Thanks for sending the file.

It appears that the entire problem you are having is because of the names of two of your parameters: RI-X and RI-Z. Since the names you specify to the TextAdapter are directly used to make VisAD MathTypes (RealTypes in this case), you need to adhere to the rules for the names of MathTypes...which means no "-" signs (only letters, numbers and underscore may be used). If you change the "-" to underscore, you should be able to read the .csv file.

Also, if you use the TextAdapter directly (instead of the generic 'load()' method), the Exception you received would have read:

visad.VisADException: TextAdapter: MathType badly formed or missing: ((index)->(
torque,RI-X,RI-Z,DRY_Mass,Prop_mass,RW_Index,RW_Choice,Pay_power,Pay_Mas
s,MinFre
qMode,Miss_Life,Slew_Angle,Delta_V,Slew_Time,Mass,sheet_thick,Cost))

The reason for this is that the 'load()' method handles Exceptions and tries other FileAdapters to see if one works for the file.

Hope that helps.

tom


Kam, Michelle C wrote:


Hi Tom,

I attached the file that I am trying to load into a spreadsheet cell.
The 2 line header at the top is the same as my original .csv file but

I

removed most of the rows. There were over 1,000 rows but I shorted it
down considerably. I get "the source could not be converted to visad
data."

Thanks,
Michelle

Michelle Kam           (408) 742-2881
Lockheed Martin Space Systems Co. SSM/ATC/MSIS
B/153 O/L922 1111 Lockheed Martin Way, Sunnyvale, CA 94089




-----Original Message-----
From: Tom Whittaker [mailto:tomw@xxxxxxxxxxxxx]
Sent: Tuesday, July 22, 2003 6:14 AM
To: Kam, Michelle C
Subject: Re: 17 input fields


Hi Michelle:

I'm back from travels for a few days.  If you still need help with

this,

please FTP a copy of your file to our server and let me know what you call it.

tom


Kam, Michelle C wrote:



I'm trying to load a csv file with 17 input fields but I'm getting an

error: visad could not convert the source to a visad data file. Can
Visad handle an input of 17 fields?


In the next email is the csv file zipped up. The 2 line header is at

the top. I mapped the index to all of 17 fields.


Thanks,
Michelle

Michelle Kam           (408) 742-2881
Lockheed Martin Space Systems Co. SSM/ATC/MSIS
B/153 O/L922 1111 Lockheed Martin Way, Sunnyvale, CA 94089








--
Tom Whittaker (tomw@xxxxxxxxxxxxx)
University of Wisconsin-Madison
Space Science and Engineering Center
Cooperative Institute for Meteorological Satellite Studies
Phone/VoiceMail: 608.262.2759


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: