Last modified: December 2023

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_data.html
Jump to: · Examples · PARAMETERS · Notes · Bugs · See Also


AHELP for CIAO 4.16 Sherpa

set_data

Context: data

Synopsis

Set a data set.

Syntax

set_data(id, data=None)

id - int or str, optional
data - instance of a sherpa.Data.Data-derived class

Examples

Example 1

>>> d1 = get_data(2)
>>> set_data(d1)

Example 2

Copy the background data from the default data set into a new data set identified as 'bkg':

>>> set_data('bkg', get_bkg())

PARAMETERS

The parameters for this function are:

Parameter Definition
id The data set. If not given then the default identifier is used, as returned by `get_default_id` .
data The new contents of the data set. This can be copied from an existing data set or loaded in from a file (e.g. `unpack_data` ).

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the `data` parameter. If given two un-named arguments, then they are interpreted as the `id` and `data` parameters, respectively.


Bugs

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

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
copy_data, dataspace1d, dataspace2d, datastack, delete_data, fake, get_axes, get_bkg_chisqr_plot, get_bkg_delchi_plot, get_bkg_fit_plot, get_bkg_model_plot, get_bkg_plot, get_bkg_ratio_plot, get_bkg_resid_plot, get_bkg_source_plot, get_counts, get_data, get_data_contour, get_data_contour_prefs, get_data_image, get_data_plot, get_data_plot_prefs, get_dep, get_dims, get_error, get_quality, get_specresp, get_staterror, get_syserror, group, group_adapt, group_adapt_snr, group_bins, group_counts, group_snr, group_width, load_ascii, load_data, load_grouping, load_quality, set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_dep, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror, ungroup, unpack_ascii, unpack_data
filtering
get_filter, load_filter, set_filter
info
get_default_id, list_data_ids, list_response_ids
methods
set_iter_method, set_iter_method_opt, set_method, set_method_opt
modeling
clean, get_par, get_xsabund, get_xscosmo, get_xsxsect, get_xsxset, set_bkg_model, set_bkg_source, set_full_model, set_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
plotting
plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
saving
save_error, save_filter, save_grouping, save_quality, save_staterror, save_syserror
statistics
set_prior, set_sampler, set_sampler_opt, set_stat
utilities
calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_mlr, calc_model_sum2d, calc_source_sum2d, get_rate, set_analysis, set_default_id
visualization
contour, contour_data, contour_ratio, histogram1d, histogram2d, image_data, image_setregion, rebin