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

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.10 Sherpa v1


Context: utilities


Return the measured count rate of a data set


get_rate( [id, filter=False, bkg_id] )


The get_rate() function returns the measured count rate of a source or background data set, by data id or bkg_id. For a data set in energy units, the count rate is Counts/sec/keV, for wavelength units the count rate is Counts/sec/Angstrom, and for channel units the count rate is Counts/sec.

If a data filter has been applied to the data set in question, e.g. ignore() or notice(), the count rate for either the filtered or unfiltered data set may be returned by setting the 'filter' argument to 'True' or 'False'. If set to 'True', the count rate array returned by get_rate() will be filtered, i.e. the array will be shorter in length than the unfiltered array (not padded with zeros).

  • 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")
  • filter - apply an established data filter to the data set before returning results? ; default=False
  • bkg_id - the id of the background to use, e.g. if more than one background is associated with the data; default is the first background dataset loaded


Example 1

sherpa> get_rate()

When called with no arguments, the get_rate() function returns the count rate array of the unfiltered default data set.

sherpa> get_rate()

array([ 0.        ,  0.        ,  0.        ,  0.        ,  0.        ,
        0.        ,  0.        ,  0.        ,  0.        ,  0.        ,
        0.        ,  0.00727432,  0.01212387,  0.00242477,  0.        ,
        0.        ,  0.00484955,  0.00484954,  0.01333627,  0.01454863,
        0.00484954,  0.00727431,  0.00484955,  0.00363716,  0.00606193,
 . . . . . . . . .,
       0.0012124 ,  0.00242481,  0.        ,  0.00363697,  0.00242481,
        0.        ,  0.0012124 ,  0.00242481,  0.00242465,  0.0012124 ,
        0.        ,  0.00363721,  0.0012124 ,  0.36006014])

Example 2

sherpa> get_rate(3, filter=True)

If a data set ID is supplied to get_rate(), the unfiltered count rate array of the specified data set is returned, unless the 'filter' argument is set to 'True'.

sherpa> notice()

sherpa> get_rate(3).size

sherpa> ignore(10.0, 12.0)

sherpa> get_rate(3, filter=True).size

Example 3

sherpa> get_rate(4, bkg_id=2)

To return the dependent variable array of a background associated with a data set, the background ID must be specified along with the data set ID. Here, the second background loaded for data set 4 is returned by get_rate().


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

See Also

get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
copy_data, dataspace1d, dataspace2d, datastack, 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_quality, get_rmf, get_specresp, get_staterror, get_syserror, group, 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_draws, 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_prior, get_sampler, get_stat
calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_mlr, calc_model_sum2d, calc_source_sum2d, get_analysis
contour, contour_data, contour_ratio, get_ratio, get_resid, histogram1d, histogram2d, image_data, image_getregion, rebin

Last modified: December 2013
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-2017. All rights reserved.