dataspace2d¶
-
sherpa.ui.
dataspace2d
(dims, id=None, dstype=<class 'sherpa.data.Data2D'>)¶ 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.
Parameters: - dims (sequence of 2 number) – The dimensions of the grid in
(width,height)
order. - 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 Data2D (the default) and Data2DInt.
See also
dataspace1d()
- Create the independent axis for a 1D data set.
get_dep()
- Return the dependent axis of a data set.
get_indep()
- Return the independent axes of a data set.
set_dep()
- Set the dependent axis of a data set.
Examples
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")
- dims (sequence of 2 number) – The dimensions of the grid in