yt.data_objects.image_array.ImageArray.write_hdf5

ImageArray.write_hdf5(filename, dataset_name=None)[source]

Writes ImageArray to hdf5 file.

Parameters:

filename: string :

The filename to create and write a dataset to :

dataset_name: string :

The name of the dataset to create in the file.

Examples

>>> im = np.zeros([64,128,3])
>>> for i in range(im.shape[0]):
...     for k in range(im.shape[2]):
...         im[i,:,k] = np.linspace(0.,0.3*k, im.shape[1])
>>> myinfo = {'field':'dinosaurs', 'east_vector':np.array([1.,0.,0.]),
...     'north_vector':np.array([0.,0.,1.]), 'normal_vector':np.array([0.,1.,0.]),
...     'width':0.245, 'units':'cm', 'type':'rendering'}
>>> im_arr = ImageArray(im, info=myinfo)
>>> im_arr.write_hdf5('test_ImageArray.h5')