hdf5/
mg_h5_writevariable.pro
topmg_h5_writevariable
mg_h5_writevariable, id, data, name
Write a variable to a file or group.
Parameters
- id in required type=long
HDF5 identifier of file or group to write variable into
- data in required type=any
IDL variable to write
- name in required type=string
name of variable in HDF5 file
Examples
For example, the following creates an HDF5 file:
IDL> filename = 'test.h5'
IDL> fid = h5f_create(filename)
IDL> mg_h5_writevariable, fid, 1.0, 'scalar'
IDL> mg_h5_writevariable, fid, findgen(10), 'array'
IDL> group = h5g_create(fid, 'group')
IDL> mg_h5_writevariable, group, 1.0, 'another_scalar'
IDL> mg_h5_writevariable, group, findgen(10), 'another_array'
IDL> h5g_close, group
IDL> h5f_close, fid
To browse the results:
IDL> ok = h5_browser(filename)
File attributes
| Modification date: | Fri Jun 27 17:15:32 2008 |
| Lines: | 51 |
| Docformat: | rst rst |
![[attach.png]](../idldoc-resources/attach.png)