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


Obtain the quality flags from a data set


get_quality( id [,bkg_id=None] )


The get_quality command returns the array of quality flags associated with a data set, by data set id (required argument). 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 of the data array using the command ignore_bad. 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, and the set_quality command is used to actually apply such an array to a data set. 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 (required) default=None
  • bkg_id - the id of the background, if the quality is to be applied to the background data; default=None

Example 1

sherpa> get_quality(1)

The get_quality function retrieves the quality flags associated withdata set id=1 (the data set id is a required argument).

Example 2

sherpa> get_quality(2)

Here, an array of quality flags is read from the ASCII file 'quality.txt' and assigned to data set 2 (3c273.pi). The set_quality function is used to apply the quality flags to data set 2, using the quality array which is returned by the get_quality function.

sherpa> load_pha(2, "3c273.pi")
sherpa> load_quality(2, "quality.txt")
sherpa> get_quality(2)

array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])

sherpa> set_quality(2, get_quality(2))

Example 3

sherpa> get_quality(2, 1)

The get_quality function is used to return the array of quality flags associated with the background of source data set 2 (bkg_id=1 represents the first background data set loaded in association with the source data set id=2).

See Also

get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
copy_data, dataspace1d, dataspace2d, delete_data, fake, get_areascal, get_arf, get_arf_plot, get_axes, get_backscal, get_bkg, get_bkg_plot, get_bkg_scale, get_coord, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_exposure, get_grouping, get_indep, get_rmf, get_specresp, get_staterror, get_syserror, group_sherpa, load_ascii, load_data, load_grouping, load_quality, set_data, set_quality, ungroup, unpack_ascii, unpack_data
get_filter, load_filter, set_filter
calc_stat_info, get_fit, get_stat_info
get_default_id, list_data_ids, list_response_ids, list_stats
get_iter_method_name, get_iter_method_opt, get_method
clean, get_model, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_response, get_source, get_source_component_image, get_source_component_plot, image_source
get_split_plot, plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
get_kernel, get_psf
save_error, save_filter, save_grouping, save_quality, save_staterror, save_syserror
get_chisqr_plot, get_delchi_plot, get_stat
calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_mlr, calc_model_sum2d, calc_source_sum2d, get_analysis, get_rate
contour, contour_data, contour_ratio, get_ratio, get_resid, histogram1d, histogram2d, image_data, image_getregion, 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.