Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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.

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690