Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2016

URL: http://cxc.harvard.edu/sherpa/ahelp/save_quality.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.9 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=True, 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=True
  • clobber - clobber outfile; default=False (do not clobber if file exists)

Example 1

sherpa> save_quality("quality.txt")

The channel and quality columns for the file in the default data set are written to the file quality.txt using an ASCII format:

sherpa> !head -5 /pool14/dburke/qual.dat
#TEXT/SIMPLE
# CHANNEL QUALITY
1.0 0
2.0 0
3.0 0

Example 2

sherpa> save_quality("quality.fits", ascii=False)

The data is written to a FITS format file:

sherpa> !dmlist quality.fits blocks

--------------------------------------------------------------------------------
Dataset: quality.fits
--------------------------------------------------------------------------------
 
     Block Name                          Type         Dimensions
--------------------------------------------------------------------------------
Block    1: PRIMARY                        Null        
Block    2: HDU2                           Table         2 cols x 1024     rows
sherpa> !dmlist quality.fits cols

--------------------------------------------------------------------------------
Columns for Table Block HDU2
--------------------------------------------------------------------------------
 
ColNo  Name                 Unit        Type             Range
   1   CHANNEL                           Real8          -Inf:+Inf            
   2   QUALITY                           Int2           -                   

Example 3

sherpa> save_quality(2,"quality_bkg.fits", bkg_id=1, ascii=False,
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.

Bugs

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

See Also

contrib
save_chart_spectrum
data
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
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

Last modified: December 2016
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:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.