dataspace2d(dims, id=None, dstype=<class 'sherpa.astro.data.DataIMG'>)¶
Create the independent axis for a 2D data set.
Create an “empty” two-dimensional data set by defining the grid on which the points are defined (the independent axis). The values are set to 0.
dims (sequence of 2 number) – The dimensions of the grid in
id (int or str, optional) – The identifier for the data set to use. If not given then the default identifier is used, as returned by get_default_id.
dstype (data class to use, optional) – What type of data is to be used. Supported values include DataIMG (the default), Data2D, and Data2DInt.
Create a 200 pixel by 150 pixel grid (number of columns by number of rows) and display it (each pixel has a value of 0):
>>> dataspace2d([200, 150]) >>> image_data()
Create a data space called “fakeimg”:
>>> dataspace2d([nx, ny], id="fakeimg")