Chandra X-Ray Observatory
Skip to the navigation links
Last modified: December 2010

Jump to: Description · Examples · See Also

AHELP for CIAO 4.3 Sherpa v1


Context: data


Apply user-defined quality flags to a data set


set_quality( [id,] val [,bkg_id=None] )


The set_quality command applies a user-defined array of quality flags to a data set, overriding any quality flags contained within the PHA file. An array element set to x >= 1 marks a good channel and an element set to x < 1 marks a bad channel. Bad channels indicated by the quality flags are filtered out using the command ignore_bad. The quality array associated with a data set can be viewed with the get_quality command, and an array of quality flags can be read from a FITS table file or column-based ASCII file and assigned to a data set with the load_quality command. The set_quality and get_quality commands require that the data set in question be a PHA data set.

  • id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
  • val - an array defining the quality flag. Must be the same length as the input data set. An element set to x >= 1 marks a good channel and an element set to x < 1 marks a bad channel.
  • bkg_id - the id of the background, if the quality is to be applied to the background data; default=None

Example 1

sherpa> set_quality([1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1,
-1, ...] )

The set_quality command is used to apply a user-defined array of quality flags to default data set id=1; the quality array contains as many elements as the data array.

Example 2

sherpa> grpsrc=get_quality(1)
sherpa> set_quality("src", grpsrc)
sherpa> set_quality("src", grpsrc, 1)

Retrieve the quality array of data set 1 and store it to the variable "grpsrc"; apply this quality to the source and background data arrays in the data set named "src".

See Also

set_conf_opt, set_covar_opt, set_proj_opt
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_sherpa, load_ascii, load_data, load_grouping, load_quality, set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_exposure, set_grouping, set_rmf, set_staterror, set_syserror, ungroup, unpack_ascii, unpack_data
get_filter, load_filter, set_filter
get_default_id, list_data_ids, list_response_ids
set_iter_method, set_iter_method_opt, set_method, set_method_opt
clean, get_par, set_bkg_model, set_full_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
save_error, save_filter, save_grouping, save_quality, save_staterror, save_syserror
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
contour, contour_data, contour_ratio, get_ratio, get_resid, histogram1d, histogram2d, image_data, image_setregion, rebin

Last modified: December 2010
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: Smithsonian Institution, Copyright © 1998-2019. All rights reserved.