pyhdf中SD的接口说明原文
笔者近期在使用pyhdf包做相关的数据处理,其中最常用的是其中的SD库。其中相关的说明如下。
'''
Classes summary
---------------
pyhdf wraps the SD API using different types of python classes::
SD HDF SD interface (almost synonymous with the subset of the
HDF file holding all the SD datasets)
SDS scientific dataset
SDim dataset dimension
SDAttr attribute (either at the file, dataset or dimension level)
SDC constants (opening modes, data types, etc)
In more detail::
SD The SD class implements the HDF SD interface as applied to a given
file. This class encapsulates the "SD interface" identifier
(referred to as "sd_id" in the C API documentation), and all
the SD API top-level functions.
To create an SD instance, call the SD() constructor.
methods:
constructors:
SD() open an existing HDF file or create a new one,
returning an SD instance
attr() create an SDAttr (attribute) instance to access
an existing file attribute or create a new one;
"dot notation" can also be used to get and set
an attribute
create() create a new dataset, returning an SDS instance
select() locate an existing dataset given its name or
index number, returning an SDS instance
file closing
end() end access to the SD interface and close the
HDF file
inquiry
attributes() return a dictionary describing every global
attribute attached to the H