| AHELP for CIAO 4.5 Sherpa v1 | set_quality |
Context: data |
Synopsis
Apply user-defined quality flags to a data set
Syntax
set_quality( [id,] val [,bkg_id=None] )
Description
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
- confidence
- set_conf_opt, set_covar_opt, set_proj_opt
- 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_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
- filtering
- get_filter, load_filter, set_filter
- info
- get_default_id, list_data_ids, list_response_ids
- methods
- set_iter_method, set_iter_method_opt, set_method, set_method_opt
- modeling
- clean, get_par, set_bkg_model, set_full_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
- plotting
- plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
- saving
- save_error, save_filter, save_grouping, save_quality, save_staterror, save_syserror
- statistics
- set_prior, set_sampler, set_sampler_opt, set_stat
- utilities
- 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
- visualization
- contour, contour_data, contour_ratio, get_ratio, get_resid, histogram1d, histogram2d, image_data, image_setregion, rebin

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