idl 读取hdf 字段,比如我要读取他的波段信息,如波段数、波段名字等

发布网友 发布时间:2022-03-30 20:07

我来回答

3个回答

热心网友 时间:2022-03-30 21:36

看看这个源码,/idldir/examples/doc/sdf/hdf_info.pro,可以读取hdf所有字段的。

热心网友 时间:2022-03-30 22:54

IDL帮助里就有呀,你也可以去下载个HDF查看器的那种小软件去看
IDL读取后是一个结构体,HDF存储的波段数、波动名称的字段是不确定的,需要你自己先知道,可以查看以下代码:

File = FILEPATH('hdf5_test.h5', SUBDIR=['examples','data'])
Result = H5_PARSE(File)
help, Result, /STRUCTURE

;When the above commands are entered, IDL prints:
;** Structure <5f24468>, 13 tags, length=6872, data length=66, refs=1:
; _NAME STRING 'D:\ITT\idl63\examples\data\hdf5_test.h5'
;_ICONTYPE STRING 'hdf'
;_TYPE STRING 'GROUP'
;_FILE STRING 'D:\ITT\idl63\examples\data\hdf5_test.h5'
;_PATH STRING '/'
;_COMMENT STRING ''
;_2D_INT_ARRAY STRUCT -> <Anonymous> Array[1]
;A_NOTE STRUCT -> <Anonymous> Array[1]
;SL_TO_3D_INT_ARRAY
;STRUCT -> <Anonymous> Array[1]
;ARRAYS STRUCT -> <Anonymous> Array[1]
;DATATYPES STRUCT -> <Anonymous> Array[1]
;IMAGES STRUCT -> <Anonymous> Array[1]
;LINKS STRUCT -> <Anonymous> Array[1]
;Now print out the structure of a dataset within the “Images” group:

help, Result.images.eskimo, /STRUCTURE

;IDL prints:
;** Structure <16f1ca0>, 20 tags, length=840, data length=802, refs=2:
;_NAME STRING 'Eskimo'
;_ICONTYPE STRING 'binary'
;_TYPE STRING 'DATASET'
;_FILE STRING 'D:\ITT\debug\examples\data\hdf5_test.h5'
;_PATH STRING '/images'
;_DATA STRING '<unread>'
;_NDIMENSIONS LONG 2
;_DIMENSIONS ULONG Array[2]
;_NELEMENTS ULONG 3400
;_DATATYPE STRING 'H5T_INTEGER'
;_STORAGESIZE ULONG 1
;_PRECISION LONG 8
;_SIGN STRING 'unsigned'
;CLASS STRUCT -> <Anonymous> Array[1]
;IMAGE_VERSION STRUCT -> <Anonymous> Array[1]
;IMAGE_SUBCLASS STRUCT -> <Anonymous> Array[1]
;IMAGE_COLORMODEL
;STRUCT -> <Anonymous> Array[1]
;IMAGE_MINMAXRANGE
;STRUCT -> <Anonymous> Array[1]
;IMAGE_TRANSPARENCY
;STRUCT -> <Anonymous> Array[1]
;PALETTE STRUCT -> <Anonymous> Array[1]

热心网友 时间:2022-03-31 00:29

dfssdfsdfsd

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com