| AHELP for CIAO 4.5 Sherpa v1 | get_indep |
Context: data |
Synopsis
Return the independent variable array of a data set
Syntax
get_indep( [id, bkg_id] )
Description
The get_indep() function returns the independent variable array of a 1- or 2-D source or background data set, by data id or bkg_id. For PHA spectra, get_indep() returns the (energ_lo, energ_hi) array, where 'energ_lo' and 'energ_hi' represent the energies at the low and high ends of each bin, respectively. For images, get_indep() returns the (x0, x1) image grid in the current coordinate system.
- 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")
- 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_indep()
When called with no arguments, get_indep() returns the independent variable array of the default data set. In this example, data set 1 is a PHA spectrum.
sherpa> print(get_data())
name = simple.pi
channel = Float64[1024]
counts = Float64[1024]
staterror = None
syserror = None
bin_lo = None
bin_hi = None
grouping = None
quality = None
exposure = 56494.4943719
backscal = 9.36267570731e-05
areascal = 1.0
grouped = False
subtracted = False
units = energy
response_ids = [1]
background_ids = [1]
sherpa> get_indep()
(array([ 0.30000001, 0.31 , 0.31999999, 0.33000001,
0.34 , 0.34999999, 0.36000001, 0.37 ,
. . . . 10.93999958, 10.94999981, 10.96000004, 10.97000027,
10.97999954, 10.98999977]),
array([ 0.31 , 0.31999999, 0.33000001, 0.34 ,
0.34999999, 0.36000001, 0.37 , 0.38 ,
0.38999999, 0.40000001, 0.41 , 0.41999999,
. . . . 10.94999981, 10.96000004, 10.97000027, 10.97999954,
10.98999977, 11. ]))
Example 2
sherpa> get_indep(1, bkg_id=1)
To return the independent variable array of a background associated with a data set, the background ID must be specified along with the data set ID. Here, the first background loaded for data set 1 is returned by get_indep().
sherpa> get_indep(1, 1)
(array([ 0.30000001, 0.31 , 0.31999999, 0.33000001,
0.34 , 0.34999999, 0.36000001, 0.37 ,
. . . . 10.93999958, 10.94999981, 10.96000004, 10.97000027,
10.97999954, 10.98999977]),
array([ 0.31 , 0.31999999, 0.33000001, 0.34 ,
0.34999999, 0.36000001, 0.37 , 0.38 ,
0.38999999, 0.40000001, 0.41 , 0.41999999,
. . . . 10.94999981, 10.96000004, 10.97000027, 10.97999954,
10.98999977, 11. ]))
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- confidence
- get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
- contrib
- get_chart_spectrum
- data
- 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_quality, get_rmf, get_specresp, get_staterror, get_syserror
- filtering
- get_filter
- fitting
- calc_stat_info, get_fit, get_stat_info
- info
- get_default_id, list_stats
- methods
- get_draws, get_iter_method_name, get_iter_method_opt, get_method
- modeling
- 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
- plotting
- get_split_plot
- psfs
- get_kernel, get_psf
- statistics
- get_chisqr_plot, get_delchi_plot, get_prior, get_sampler, get_stat
- utilities
- get_analysis, get_rate
- visualization
- get_ratio, get_resid, image_getregion

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