pack_image

sherpa.astro.io.pack_image(dataset)[source] [edit on github]

Convert a Sherpa data object into an I/O item (image).

Parameters

dataset (a sherpa.data.Data2D derived object) –

Returns

An object representing the data, the format of which depends on the I/O backend.

Return type

obj

See also

pack_image, pack_pha

Examples

>>> y, x = np.mgrid[:10, :5]
>>> z = (x-2)**2 + (y-2)**3
>>> d = sherpa.data.Data2D('img', x.flatten(), y.flatten(),
                           z.flatten(), shape=z.shape)
>>> img = pack_image(d)