Re: HDF4 dimension attributes in IDL [message #52394] |
Fri, 02 February 2007 10:06 |
Eric Winter
Messages: 4 Registered: December 2001
|
Junior Member |
|
|
Cool, that works great! Consider this another strike against the quality
of the IDL HDF "documentation"....
Thanks,
Eric
kuyper@wizard.net wrote:
> Eric Winter wrote:
>> Hi all,
>>
>> I'm having trouble with an IDL/HDF4 problem, and I was hoping someone
>> could point me at the correct solution. We are assigning attributes like
>> unitsCategory and scaleType to HDF dimension objects in our HDF4 files.
>> Not a big deal, in theory, since the HDF documentation from NCSA
>> discusses doing this.
>>
>> However, I can't seem to find a way to do it in IDL. I can easily add
>> and read attributes to SDS objects using IDL, but the only
>> dimension-related routines seem to be HDF_SD_DIMGET, HDF_SD_DIMSET, and
>> HDF_SD_DIMGETID. The documentation for those routines indicates you can
>> ask for a count of the attributes on a dimension, but there is no
>> mention on how to set or read those attributes.
>
> An HDF dimension is simply a specialized kind of one-dimensional SDS
> that is it's own only dimension. As a result, you can use the dim_id
> that you get from HDF_SD_DIMGETID() as the sds_id argument in all
> applicable HDF_SD_* functions.
>
> dim_id = HDF_SD_DIMGETID(sddataset_id, dimension_number)
>
> To write an attribute:
> HDF_SD_ATTRSET,dim_id, attribute_name, value_to_write
>
> To read an attribute:
> attr_index = HDF_SD_ATTRFIND(dim_id, attribute_name)
> HDF_SD_ATTRINFO, dim_id, attr_index, data=value_read
>
|
|
|
Re: HDF4 dimension attributes in IDL [message #52396 is a reply to message #52394] |
Fri, 02 February 2007 08:46  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Eric Winter wrote:
> Hi all,
>
> I'm having trouble with an IDL/HDF4 problem, and I was hoping someone
> could point me at the correct solution. We are assigning attributes like
> unitsCategory and scaleType to HDF dimension objects in our HDF4 files.
> Not a big deal, in theory, since the HDF documentation from NCSA
> discusses doing this.
>
> However, I can't seem to find a way to do it in IDL. I can easily add
> and read attributes to SDS objects using IDL, but the only
> dimension-related routines seem to be HDF_SD_DIMGET, HDF_SD_DIMSET, and
> HDF_SD_DIMGETID. The documentation for those routines indicates you can
> ask for a count of the attributes on a dimension, but there is no
> mention on how to set or read those attributes.
An HDF dimension is simply a specialized kind of one-dimensional SDS
that is it's own only dimension. As a result, you can use the dim_id
that you get from HDF_SD_DIMGETID() as the sds_id argument in all
applicable HDF_SD_* functions.
dim_id = HDF_SD_DIMGETID(sddataset_id, dimension_number)
To write an attribute:
HDF_SD_ATTRSET,dim_id, attribute_name, value_to_write
To read an attribute:
attr_index = HDF_SD_ATTRFIND(dim_id, attribute_name)
HDF_SD_ATTRINFO, dim_id, attr_index, data=value_read
|
|
|