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.

Re: Spreadsheet: exporting data

Hi Peter,

Your message has shown me the error of my ways.  Now
MathType.toString() returns the same String that
MathType.prettyString() returns.  So for example, a
FunctionType will print with something like:

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

It is generally true that in:

  adapter.save(filename, data, replace);
  Data new_data = adapter.open(filename);

data and new_data will have different MathTypes.  For
example, ((Time, x) -> range) may become (Time -> (x -> range).

I can comment on this specific case if you'll please send
me the "pretty" strings using the new MathType.toString().

By the way, if HDF-5 files include names for variables
such as "latitude", "row", "time", "temperature", etc
these would make better RealType names than "dim0" and
"Float2Darray1".

Also, I am not quite sure from these Strings, but it looks
like you may be returning MathTypes like:

((dim0, dim1) -> ((dim0, dim1, dim2) -> variable))

If so, then the two occurences of dim0 and dim1 should
have different RealTypes and different names.  I see you
do use integers to create different names for Float2Darray1,
Float2Darray2, etc.

Cheers,
Bill

> I have an HDF5 file with complicate hierarchical structure. When I map the
> file into Visad data, I have the following data type.
> 
> data type = (FunctionType (Real): (dim0, dim1) -> (Float2Darray1),
> ((FunctionTyp
> e (Real): (dim0, dim1) -> (Float2Darray2), FunctionType (Real): (dim0, dim1) 
> ->
> (Float2Darray3)), (FunctionType (Real): (dim0, dim1) -> (Int2Darray2),
> FunctionT
> ype (Real): (dim0, dim1) -> (Int2Darray3)), ((FunctionType (Real): (dim0, 
> dim1)
> -> (Float2Darray1), FunctionType (Real): (dim0, dim1) -> (Int2Darray1)))),
> Funct
> ionType (Real): (dim0, dim1) -> (Int2Darray1), FunctionType (Real): (dim0,
> dim1)
>  -> (Int2Darray1_HL), FunctionType (Real): (dim0, dim1, dim2) -> (Int3Darray))
> 
> When I export the file into netcdf, the data type is the following.
> 
> data type = (FunctionType (Real): (dim0, dim1) -> (Float2Darray2,
> Float2Darray3,
>  Int2Darray2, Int2Darray3, Float2Darray1, Int2Darray1, Int2Darray1_HL),
> Function
> Type (Real): (dim0, dim1, dim2) -> Int3Darray)
> 
> I couldn't trace the source code where the datatype is converted. Can anyone
> tell me
> where the datatype is created when exporting data into netcdf ?
> 
> -----------------------------------------------------------
> Thanks,
> 
> Peter Xiangchi Cao
> Tel. (217) 244-3830
> Fax. (217) 244-1987
> Scientific Data Technologies Division
> National Center for Supercomputing Applications

-- 
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html

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