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

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.9 Sherpa v1


Context: data


Return the alternate grid of a data set


get_axes( [id, bkg_id] )


The get_axes() function returns the alternate grid of a 1- or 2-D data set by data id or bkg_id. For PHA spectra, the alternate grid corresponds to (E_MIN, E_MAX), the energy grid of the data set. For images, get_axes() returns the axes lengths in the current coordinate system, where the size of each axis array returned matches the size of the corresponding image dimension.

  • 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

Example 1

sherpa> get_axes()

When called with no arguments, get_axes() returns the (e_min, e_max) grid 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_axes()
(array([  7.3000e-03,   1.4600e-02,   2.9200e-02, ...,   1.4907e+01,
         1.4921e+01,   1.4936e+01]),
 array([  1.4600e-02,   2.9200e-02,   4.3800e-02, ...,   1.4921e+01,
         1.4936e+01,   1.4950e+01]))

Example 2

sherpa> get_axes(2)

If supplied with a data set ID, get_axes() returns the alternate grid of the specified data set. In this example, data set 2 is an image.

sherpa> print(get_data(2))
name      = image.fits
x0        = Float64[56376]
x1        = Float64[56376]
y         = Float64[56376]
shape     = (216, 261)
staterror = None
syserror  = None
sky       = physical
 crval    = [ 3798.5  4019.5]
 crpix    = [ 0.5  0.5]
 cdelt    = [ 2.  2.]
eqpos     = world
 crval    = [ 278.3866  -10.5893]
 crpix    = [ 4096.5  4096.5]
 cdelt    = [-0.0001  0.0001]
 crota    = 0
 epoch    = 2000
 equinox  = 2000
coord     = logical

sherpa> get_axes(2)
(array([   1.,    2.,    3., ...,  259.,  260.,  261.]),
 array([   1.,    2.,    3., ...,  214.,  215.,  216.]))


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_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, get_rate
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.