Chandra X-Ray Observatory
Skip to the navigation links
Last modified: December 2013

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.9 Sherpa v1


Context: data


Create a blank 1D dataset


dataspace1d( start, stop, [step=1, numbins, id, bkg_id=None,
dstype=Data1DInt] )


The dataspace1d command creates a blank 1D integrated dataset with the specified grid. Alternatively, it can be used to create a PHA background data set. To create 2D data, use the dataspace2d command ("ahelp dataspace2d").

  • start - the minimum value for the grid
  • stop - the maximum value for the grid
  • step - the step size between grid points (default=1); an alternative is to specify the number of bins.
  • numbins - the number of bins to create (default=None); an alternative is to specify the step size.
  • id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id").
  • bkg_id - the id of the background, if creating background data; default is the first background associated with the id
  • dstype - dataset type: Data1D, Data1DInt (the default), or DataPHA

Example 1

sherpa> dataspace1d(0.1,10,0.1)

Create a blank dataset over the range 0.1:10 with a step size of 0.1

Example 2

sherpa> dataspace1d(0.1,10,numbins=200)

Create a blank dataset with 200 bins over the range 0.1:10.

Example 3

sherpa> dataspace1d(1, 5, dstype=Data1D)

Create a dataset with dstype=Data1D over the range 1:5; the default step size is used.

Example 4

sherpa> dataspace1d(0.1, 10, 0.01, dstype=DataPHA)

Create a blank PHA dataset over the range 0.1 to 10 with a step size of 0.01. The id defaults to 1.

Example 5

sherpa> dataspace1d(0.1, 10, 0.01, id=2, dstype=DataPHA)
sherpa> dataspace1d(0.1, 10, 0.01, id=1, bkg_id=1, dstype=DataPHA)

Here we create a blank PHA for dataset id 2 and also create an associated background dataset for it, with a background id of 1.


See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

copy_data, dataspace2d, datastack, delete_data, fake, get_axes, get_bkg_plot, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_quality, get_specresp, get_staterror, get_syserror, group, load_arf, load_arrays, load_ascii, load_bkg, load_bkg_arf, load_bkg_rmf, load_data, load_grouping, load_image, load_multi_arfs, load_multi_rmfs, load_pha, load_quality, load_rmf, load_staterror, load_syserror, load_table, pack_image, pack_pha, pack_table, set_data, set_quality, ungroup, unpack_arf, unpack_arrays, unpack_ascii, unpack_bkg, unpack_data, unpack_image, unpack_pha, unpack_rmf, unpack_table
get_filter, load_filter, set_filter
get_default_id, list_bkg_ids, list_data_ids, list_response_ids
add_model, add_user_pars, clean, load_table_model, load_template_model, load_user_model, save_model, save_source
plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
save_arrays, save_data, save_delchi, save_error, save_filter, save_grouping, save_image, save_pha, save_quality, save_resid, save_staterror, save_syserror, save_table
calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_mlr, calc_model_sum2d, calc_source_sum2d, get_rate
contour, contour_data, contour_ratio, get_ratio, get_resid, histogram1d, histogram2d, image_data, rebin

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: Smithsonian Institution, Copyright © 1998-2017. All rights reserved.