| AHELP for CIAO 4.5 Sherpa v1 | load_quality |
Context: data |
Synopsis
Load quality flags from a FITS table or ASCII file
Syntax
load_quality( [id=1], filename, [bkg_id] )
Description
The load_quality command reads an array of quality flags from a FITS table file or column-based ASCII file and assigns it to a PHA data set, specified by data set ID. The second column of the supplied table is read as the quality array. Use the get_quality command to view the array of quality flags associated with a data set, and the set_quality command to apply such an array to a data set.
- id - the id of the data set to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
- filename - name of FITS table file or column-based ASCII file containing a quality array in the second column
- 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)
Example 1
sherpa> load_quality("quality.txt")The load_quality command can be called with just a filename and path argument, in which case the array of quality flags is assigned to data set id=1. Here, 'quality.txt' is read as a column-based ASCII table; the second column of that table is defined as the quality array for data set 1. The set_quality function is used to actually apply the quality flags to data set 1, using the array which is returned by the get_quality function. The set_quality and get_quality functions require that the data set in question be a PHA data set.
sherpa> load_pha("3c273.pi")
sherpa> load_quality("quality.txt")
sherpa> get_quality(1)
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(1, get_quality())
Example 2
sherpa> load_quality("quality.fits")In this case, 'quality.fits' is read as a FITS table; the second column of that table is defined as the filter array for data set 1.
Example 3
sherpa> load_quality(2, "quality.dat")
The file 'quality.dat' is read as a column-based ASCII table; the second column of that table is defined as the quality array for data set 2.
Example 4
sherpa> load_quality(2, "quality.dat", bkg_id=1)
The file 'quality.dat' is read as a column-based ASCII table; the second column of that table is defined as the quality array for the background associated with data set 2.
See Also
- 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_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
- save_arrays, save_data, save_delchi, save_error, save_filter, save_grouping, save_image, save_pha, save_quality, save_resid, save_staterror, save_syserror, save_table
- 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)