Last modified: December 2013

Jump to: Description · Examples · See Also

AHELP for CIAO 4.12 Sherpa v1


Context: saving


Save statistical errors to a FITS table or ASCII file


save_staterror( [id=1], filename, [bkg_id=1,ascii=False,clobber=False] )


The save_staterror command saves the array of statistical errors associated with the counts in a data set to a column in a FITS table file or column-based ASCII file, by data set id. The statistical error array associated with a data set may be viewed with the get_staterror command.


Example 1

sherpa> save_staterror("stat_error.fits")

The save_staterror function can be called with just a filename, in which case all the default arguments will be used. In this example, the statistical error array associated with the counts in data set 1 is written to the FITS table file 'stat_error.fits'.

ciao% dmlist stat_error.fits blocks

Dataset: stat_error.fits

     Block Name                          Type         Dimensions
Block    1: PRIMARY                        Null
Block    2: TABLE                          Table         2 cols x 46       rows
	ciao% dmlist stat_error.fits data

Data for Table Block TABLE

ROW    X                    ERR

     1     0.00146000005770         5.2130748866
     2     0.24819999933243         4.9686269666
     3     0.30660000443459         5.0926763859
     4     0.46720001101494         4.9686269666
     5     0.56940001249313         5.0926763859
     6     0.64240002632141         4.9686269666
     7     0.70080000162125         5.3301270189
     8     0.74459999799728         5.3301270189
     9     0.78839999437332         4.9686269666
[rest of output omitted] 

Example 2

sherpa> save_staterror(2, "stat_error.txt", ascii=True)

Here, the optional 'ascii' argument is set to True in order to produce an outfile in ASCII format (overriding the default setting ascii=False). The statistical error array associated with the counts in data set 2 is written to the text file 'stat_error.txt'.

Example 3

sherpa> save_staterror(2,"stat_error_bkg.fits", bkg_id=1, clobber=True)

The statistical error array associated with the first background data set loaded for source data set 2 is written to FITS file stat_error_bkg.fits (note the 'ascii' parameter default is False).

See Also

save_chart_spectrum, save_marx_spectrum
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_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
restore, save, save_all, save_arrays, save_data, save_delchi, save_error, save_filter, save_grouping, save_image, save_pha, save_quality, save_resid, save_syserror, save_table, script
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