Re: HDF5 Output in IDL [message #68648] |
Mon, 09 November 2009 07:11  |
Juggernaut
Messages: 83 Registered: June 2008
|
Member |
|
|
On Nov 8, 9:08 pm, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> Does anyone have an example of how to go about writing
> simple IDL variables to an HDF5 file with some variable
> attributes?
>
> Thanks,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
A very simple way is shown in the IDL help for h5_create.
simpleVariable = dblarr(10)
nels = n_elements(simpleVariable)
type = 'Double'
attr = {_TYPE:'Attribute', _DATA:{size: nels, type: type}}
dataset = {_Name: 'simpleVariable', _TYPE:'Dataset',
_DATA:simpleVariable, PROPERTIES:attr}
h5_create, dialog_pickfile(), dataset
If you know what you want your hdf5 structure to look like then it
becomes pretty simple to basically
build your IDL structure to look exactly the same way.
Not entirely sure if you were looking for something else but it's an
answer none-the-less
|
|
|