Module functions to get the energy/wavelength/channel grid of source and background datasets.
Struct_Type | Array_Type get_axes([Integer_Type])
Struct_Type | Array_Type get_baxes([Integer_Type])
Error Return Value: NULL
Arguments:
(1) data set number (default 1)
In Sherpa parlance, a ``dataspace'' is an
N-dimensional
grid defined by the independent variables of the dataset
(i.e., x_i in the expression
y = f(x_0, x_1,...,x_(N-1))).
Simple examples include the CHANNELS array in PHA
datasets and the pixel numbers along each axis of FITS images.
The get_axes() function retrieves the dataspace, or
filtered data set axes of the appropriate data set (if no argument
is given, the axes for data set 1 are retrieved). The units of
the axes are those appropriate for
the current Sherpa ANALYSIS setting. For instance, if one is
working with filtered PHA data in energy-space, what is returned are the
low and high bin boundaries in keV (quantities assigned by the EBOUNDS
extension of the RMF). (The get_baxes() function retrieves
the filtered axes for the background associated with the appropriate
data set.)
What is returned is an array of structures of length equal to the
number of dimensions (e.g., 2 for image data).
If the data are one-dimensional, a single Struct_Type variable
is returned. There are five structure fields:
- axistype: either Channels,
Energy, or Wavelength.
- axisunits: either unknown, keV,
or A.
- lo: the array of lower bin boundaries; is NULL
if there is no bin-width information available.
- hi: the array of upper bin boundaries; is NULL
if there is no bin-width information available.
- mid: NULL if bin-width information is available;
otherwise it contains the unbinned axis gridpoints.
One may display data et al. on the same grid output by
get_axes using the
Sherpa plotting commands
LPLOT DATA et al.
sherpa> data example.fits
sherpa> foo = get_axes()
sherpa> print(foo[0]) # image pixels, x-axis
axistype = Channels
axisunits = unknown
lo = Float_Type[512]
hi = Float_Type[512]
mid = NULL
sherpa> data example.pha
sherpa> instrument = rsp[a](example.rmf,example.arf)
sherpa> foo = get_axes()
sherpa> print(foo[0]) # energy grid for PHA data
axistype = Energy
axisunits = keV
lo = Float_Type[1024]
hi = Float_Type[1024]
mid = NULL
sherpa> data example.dat
sherpa> foo = get_axes()
sherpa> print(foo[0]) # channel grid for unbinned ASCII data
axistype = Channels
axisunits = unknown
lo = NULL
hi = NULL
mid = Float_Type[100]
- chandra
-
guide
- sherpa
-
get_analysis,
get_arf_axes,
get_coord,
get_data,
get_energy_axes,
get_errors,
get_filter,
get_filter_expr,
get_fit,
get_fluxed_spectrum,
get_ftest,
get_metadata,
get_photon_axes,
get_photon_energy_axes,
get_photon_wave_axes,
get_qvalue,
get_raw_axes,
get_record,
get_source,
get_statistic,
get_stats,
get_syserrors,
get_wave_axes,
get_weights,
record,
save,
write
|