Re: HDF5 adapter: open second file

"Peter X. Cao" wrote:
> The Speradsheet always fails when I try to open the second file.
> For example, it works when I first open an HDF5 file, float2Darray.h5.
> Then I open another HDF5 file double2Darray.h5. The spreadsheet
> fails. The exception is visad.TypeException: ScalarType: name already used.
> 
> Does it mean I cannot use the same type name for different data files ?
> The domain names of a plain data array are given autimatically as 
> dim1, dim2, ..., etc. Surely there will be some name overlap for different
> data sets/files. What can I do to resolve this name conflict without change
> the way I name the domains (dim1, dim2, ...) ?

If the FITS adapter, I do something like this:

    RealType rt;
    try {
      rt = new RealType(name, null, null);
    } catch (TypeException e) {
      rt = RealType.getRealTypeByName(name);
    }

that is, if an attempt to create a RealType fails due to a TypeException,
it's likely that it already exists so just fetch it from the cache of
existing types.

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