| AHELP for CIAO 4.5 Sherpa v1 | save_quality |
Context: saving |
Synopsis
Save quality flags to a FITS table or ASCII file
Syntax
save_quality( [id=1], filename, [bkg_id=1,ascii=False,clobber=False] )
Description
The save_quality command saves the array of quality flags associated with a data set to a column in a FITS table file or column-based ASCII file, by data set id. A quality array element set to x >= 1 marks a good channel and an element set to x < 1 marks a bad channel.
- id - the id of the data set to which the quality array has been assigned; if not given, uses the default data set id (id=1 by default, see "ahelp get_default_id")
- filename - name of outfile
- bkd_id - the id of the background data set to use (e.g., bkg_id=1 represents the first background data set loaded in association with the source data set specified in the 'id' argument)
- ascii - outfile format specification; True to save outfile in ASCII format, False for FITS, default=False
- clobber - clobber outfile; default=False (do not clobber if file exists)
Example 1
sherpa> save_quality("quality.fits")The save_quality function can be called with just a filename, in which case all the default arguments will be used. In this example, the quality array associated with data set id=1 is written to the FITS table file 'quality.fits'.
ciao% dmlist quality.fits blocks
--------------------------------------------------------------------------------
Dataset: quality.fits
--------------------------------------------------------------------------------
Block Name Type Dimensions
--------------------------------------------------------------------------------
Block 1: PRIMARY Null
Block 2: TABLE Table 2 cols x 1024 rows
ciao% dmlist quality.fits data
--------------------------------------------------------------------------------
Data for Table Block TABLE
--------------------------------------------------------------------------------
ROW COL1 COL2
1 1.0 1
2 2.0 1
3 3.0 1
4 4.0 1
5 5.0 1
6 6.0 1
7 7.0 1
8 8.0 1
9 9.0 1
.
.
.
[rest of output omitted]
Example 2
sherpa> save_quality(2, "quality.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 quality array assigned to data set id=2 is written to the text file 'quality.txt'.
Example 3
sherpa> save_quality(2,"quality_bkg.fits", bkg_id=1, clobber=True)
The quality array associated with the first background data set loaded for source data set 2 is written to FITS file quality_bkg.fits (note the 'ascii' parameter default is False).
See Also
- contrib
- save_chart_spectrum
- data
- copy_data, dataspace1d, dataspace2d, 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
- filtering
- get_filter, load_filter, set_filter
- info
- get_default_id, list_bkg_ids, list_data_ids, list_response_ids
- modeling
- add_model, add_user_pars, clean, load_table_model, load_template_model, load_user_model, save_model, save_source
- plotting
- plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
- saving
- restore, save, save_all, save_arrays, save_data, save_delchi, save_error, save_filter, save_grouping, save_image, save_pha, save_resid, save_staterror, save_syserror, save_table, script
- statistics
- load_user_stat
- utilities
- calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_mlr, calc_model_sum2d, calc_source_sum2d, get_rate
- visualization
- contour, contour_data, contour_ratio, get_ratio, get_resid, histogram1d, histogram2d, image_data, rebin

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)