Last modified: December 2014

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.12 Sherpa v1


Context: data


Load 1D data from a file


load_data( [id], filename, [options] )


The load_data command is a filetype-independent method of loading 1D data from a file (e.g. if the file-specific load command is unknown or if the filetype is unknown). It tries to load the file in the following order: load_pha, load_table, and load_ascii.

If the filetype is known, file-specific options may be included in the load_data command. They are:

Refer to the individual command ahelp files for specifics on the options.

Loading Multiple Data Sets

Multiple data sets can be loaded using the datastack syntax, where 'id' is replaced by the datastack identifier ('[]' as default) and the list of data sets is contained in the filename and input as "@filename", e.g. load_*([],'@filename'). See 'datastack' ahelp file for the full description.


Example 1

sherpa> load_data("data.filtered")

Using the default settings, load a data file into Sherpa.

Example 2

sherpa> load_data("src", "data.txt", ncols=3)

Load the first three columns of data.txt, using the dataset id "src". This example could also have been done using the load_ascii command.

Example 3

sherpa> load_data("src", "source.pha")

Data is loaded from the file source.pha with data id "src". This example could also have been done using the load_pha command.

Example 4

sherpa> load_data("rprofile_mid.fits[cols RMID,SUR_BRI,SUR_BRI_ERR]")
sherpa> load_data("rprofile_mid.fits",

These commands are equivalent ways of loading x=RMID, y=SUR_BRI, and staterror=SUR_BRI_ERR from rprofile_mid.fits, a radial profile for which the midpoint of the annular regions has been calculated. This example could also have been done using the load_table command.

Example 5

sherpa> load_data("test_data.dat", dstype=Data1DInt)
sherpa> load_data("test_data.dat[opt colnames=first]", dstype=Data1DInt)
sherpa> load_data("test_data.dat[cols xlo,xhi,y,staterror]",

This example shows three equivalent ways of loading four columns named 'xlo','xhi','y', and 'staterror' from the ASCII file test_data.dat, where the latter uses the CIAO Data Model ASCII kernel to select the desired columns.


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

See Also

copy_data, dataspace1d, 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_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