Re: Need help with HDF_VD_WRITE!!! [message #32491] |
Sun, 13 October 2002 06:13  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Liam E. Gumley wrote:
>> Brian Huether wrote:
>>
>> I thought I had it. But man this is so complicated. Say I have one
>> column of data with one field. All the following fail:
>>
>> IDL> fileid=HDF_OPEN('e:\huether\test7.hdf',/CREATE)
>> IDL> Vdat = HDF_VD_ATTACH(fileID, -1, /WRITE)
>> IDL> HDF_VD_WRITE, Vdat, 'PX', indgen(1,10)
>
> [stuff deleted]
>
> Have you considered using the HDF Scientific Data Set model instead?
> It's much more flexible and easy to use IMHO. For example:
>
> ;- Create the file
> hdfid = hdf_sd_start('test.hdf', /create)
> varid = hdf_sd_create(hdfid, 'SS', [10, 10], /float)
> hdf_sd_adddata, varid, findgen(10, 10)
> hdf_sd_endaccess, varid
> hdf_sd_end, hdfid
>
> ;- Read the file
> hdfid = hdf_sd_start('test.hdf')
> index = hdf_sd_nametoindex(hdfid, 'SS')
> varid = hdf_sd_select(hdfid, index)
> hdf_sd_getdata, varid, data
> hdf_sd_endaccess, varid
> hdf_sd_end, hdfid
>
> For more details see my book Chapter 4, pp. 182-192, or the HDF routines
> at
Just for discussion:
Most time I am seeing HDF files the users don't care about coordination
variables or dimension names.
By the hand HDF was developed after netCDF and the mostly from the
declaration is nearly the same. Why not using the internal logic of
netCDF too.
Normally there is a bit of logic behind the data which is stored in a
scientific data format. But most people using HDF did not use the
internal mechanism. They always define for every variable all dimensions
again. So if you have 10 vectors by 10 values they wrote 10 dimensions
to the file. Normally one is enough. And for example if one of the
vectors has a realation to each of the others, e.g. time to temperature
then in netCDF the dimension name is 'time' and then you know by reading
'temperature' automaticly that's the vector 'time' belongs to this
parameter. By this mechanism it is very easy to mix multidimensional
data and vector data into one file and always to read the right
parameters. I won't wonder if they write a short_name as attribute to
the file.
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
|
|
|