DataIMG
- class sherpa.astro.data.DataIMG(name, x0, x1, y, shape=None, staterror=None, syserror=None, sky=None, eqpos=None, coord='logical', header=None)[source] [edit on github]
Bases:
Data2D
Image data set, including functions for coordinate transformations
Attributes Summary
Return the coordinate setting.
Left for compatibility with older versions
The optional WCS object that converts to the world coordinate system.
The grid of the data space associated with this data set.
Mask array for dependent variable
The dimensionality of the dataset, if defined, or None.
The number of elements in the data set.
The optional WCS object that converts to the physical coordinate system.
The statistical error on the dependent axis, if set.
The systematic error on the dependent axis, if set.
kept for compatibility
kept for compatibility
The dependent axis.
Methods Summary
apply_filter
(data)eval_model
(modelfunc)Evaluate the model on the independent axis.
eval_model_to_fit
(modelfunc)Evaluate the model on the independent axis after filtering.
filter_region
(data)get_axes
()get_dep
([filter])Return the dependent axis of a data set.
get_dims
([filter])Return the dimensions of this data space as a tuple of tuples.
get_error
([filter, staterrfunc])Return the total error on the dependent variable.
get_img
([yfunc])Return the dependent axis as a 2D array.
get_indep
([filter])Return the independent axes of a data set.
get_max_pos
([dep])Return the coordinates of the maximum value.
get_staterror
([filter, staterrfunc])Return the statistical error on the dependent axis of a data set.
get_syserror
([filter])Return the statistical error on the dependent axis of a data set.
get_wcs
()get_x0
([filter])Return label for first dimension in 2-D view of independent axis/axes
get_x1
([filter])Return label for second dimension in 2-D view of independent axis/axes
get_y
([filter, yfunc, use_evaluation_space])Return dependent axis in N-D view of dependent variable
get_yerr
([filter, staterrfunc])Return errors in dependent axis in N-D view of dependent variable
get_ylabel
([yfunc])Return label for dependent axis in N-D view of dependent variable"
ignore
(*args, **kwargs)notice
([x0lo, x0hi, x1lo, x1hi, ignore])notice2d
([val, ignore])Apply a 2D filter.
set_coord
(coord)Change the
coord
attribute.set_dep
(val)Set the dependent variable values.
set_indep
(val)to_contour
([yfunc])to_fit
([staterrfunc])to_guess
()Attributes Documentation
- coord
Return the coordinate setting.
The attribute is one of ‘logical’, ‘physical’, or ‘world’. Use
set_coord
to change the setting.
- dep
Left for compatibility with older versions
- eqpos = None
The optional WCS object that converts to the world coordinate system.
- indep
The grid of the data space associated with this data set.
When set, the field must be set to a tuple, even for a one-dimensional data set. The “related” fields such as the dependent axis and the error fields are set to None if their size does not match.
Changed in version 4.14.1: The filter created by
notice
andignore
is now cleared when the independent axis is changed.- Return type:
tuple of array_like
- mask
Mask array for dependent variable
- Returns:
mask
- Return type:
- ndim = 2
The dimensionality of the dataset, if defined, or None.
- size
The number of elements in the data set.
- Returns:
size – If the size has not been set then None is returned.
- Return type:
int or None
- sky = None
The optional WCS object that converts to the physical coordinate system.
- staterror
The statistical error on the dependent axis, if set.
This must match the size of the independent axis.
- syserror
The systematic error on the dependent axis, if set.
This must match the size of the independent axis.
- x0
kept for compatibility
- x1
kept for compatibility
- y
The dependent axis.
If set, it must match the size of the independent axes.
Methods Documentation
- apply_filter(data) [edit on github]
- eval_model(modelfunc) [edit on github]
Evaluate the model on the independent axis.
- eval_model_to_fit(modelfunc) [edit on github]
Evaluate the model on the independent axis after filtering.
- filter_region(data)[source] [edit on github]
- get_axes()[source] [edit on github]
- get_bounding_mask()[source] [edit on github]
- get_dep(filter=False) [edit on github]
Return the dependent axis of a data set.
- Parameters:
filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is
False
.- Returns:
axis – The dependent axis values for the data set. This gives the value of each point in the data set.
- Return type:
array
See also
get_indep
Return the independent axis of a data set.
get_error
Return the errors on the dependent axis of a data set.
get_staterror
Return the statistical errors on the dependent axis of a data set.
get_syserror
Return the systematic errors on the dependent axis of a data set.
- get_dims(filter=False) [edit on github]
Return the dimensions of this data space as a tuple of tuples. The first element in the tuple is a tuple with the dimensions of the data space, while the second element provides the size of the dependent array.
- Return type:
- get_error(filter=False, staterrfunc=None) [edit on github]
Return the total error on the dependent variable.
- Parameters:
- Returns:
axis – The error for each data point, formed by adding the statistical and systematic errors in quadrature.
- Return type:
array or
None
See also
get_dep
Return the independent axis of a data set.
get_staterror
Return the statistical errors on the dependent axis of a data set.
get_syserror
Return the systematic errors on the dependent axis of a data set.
- get_filter() [edit on github]
- get_filter_expr()[source] [edit on github]
- get_image() [edit on github]
- get_img(yfunc=None)[source] [edit on github]
Return the dependent axis as a 2D array.
The data is not filtered.
- Parameters:
yfunc (sherpa.models.model.Model instance or None, optional) – If set then it is a model that is evaluated on the data grid and returned along with the dependent axis.
- Returns:
img – The data as a 2D array or a pair of 2D arrays when yfunc is set.
- Return type:
ndarray or (ndarray, ndarray)
- get_imgerr() [edit on github]
- get_indep(filter=False) [edit on github]
Return the independent axes of a data set.
- Parameters:
filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is
False
.- Returns:
axis – The independent axis values for the data set. This gives the coordinates of each point in the data set.
- Return type:
tuple of arrays
See also
get_dep
Return the dependent axis of a data set.
- get_logical()[source] [edit on github]
- get_max_pos(dep=None) [edit on github]
Return the coordinates of the maximum value.
- Parameters:
dep (ndarray or None, optional) – The data to search and it must match the current data filter. If not given then the dependent axis is used.
- Returns:
coords – The coordinates of the maximum location. The data values match the values returned by
get_x0
andget_x1
. If there is only one maximum pixel then a pair is returned otherwise a list of pairs is returned.- Return type:
pair or list of pairs
- get_physical()[source] [edit on github]
- get_staterror(filter=False, staterrfunc=None) [edit on github]
Return the statistical error on the dependent axis of a data set.
- Parameters:
- Returns:
axis – The statistical error for each data point. A value of
None
is returned if the data set has no statistical error array andstaterrfunc
isNone
.- Return type:
array or
None
See also
get_error
Return the errors on the dependent axis of a data set.
get_indep
Return the independent axis of a data set.
get_syserror
Return the systematic errors on the dependent axis of a data set.
- get_syserror(filter=False) [edit on github]
Return the statistical error on the dependent axis of a data set.
- Parameters:
filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is
False
.- Returns:
axis – The systematic error for each data point. A value of
None
is returned if the data set has no systematic errors.- Return type:
array or None
See also
get_error
Return the errors on the dependent axis of a data set.
get_indep
Return the independent axis of a data set.
get_staterror
Return the statistical errors on the dependent axis of a data set.
- get_wcs() [edit on github]
- get_world()[source] [edit on github]
- get_x0(filter=False) [edit on github]
- get_x0label()[source] [edit on github]
Return label for first dimension in 2-D view of independent axis/axes
- get_x1(filter=False) [edit on github]
- get_x1label()[source] [edit on github]
Return label for second dimension in 2-D view of independent axis/axes
- get_y(filter=False, yfunc=None, use_evaluation_space=False) [edit on github]
Return dependent axis in N-D view of dependent variable
- Parameters:
filter –
yfunc –
use_evaluation_space –
- get_yerr(filter=False, staterrfunc=None) [edit on github]
Return errors in dependent axis in N-D view of dependent variable
- Parameters:
filter –
staterrfunc –
- get_ylabel(yfunc=None) [edit on github]
Return label for dependent axis in N-D view of dependent variable”
- Parameters:
yfunc –
- ignore(*args, **kwargs) [edit on github]
- notice(x0lo=None, x0hi=None, x1lo=None, x1hi=None, ignore=False) [edit on github]
- notice2d(val=None, ignore=False)[source] [edit on github]
Apply a 2D filter.
- set_coord(coord)[source] [edit on github]
Change the
coord
attribute.Changed in version 4.14.1: The filter created by
notice2d
is now cleared when the coordinate system is changed.- Parameters:
coord ({'logical', 'image', 'physical', 'world', 'wcs'}) – The coordinate system to use. Note that “image” is a synomym for “logical” and “wcs” is a synomyn for “world”.
- set_dep(val) [edit on github]
Set the dependent variable values.
- Parameters:
val (sequence or number) – If a number then it is used for each element.
- set_indep(val) [edit on github]
- to_contour(yfunc=None)[source] [edit on github]
- to_fit(staterrfunc=None) [edit on github]
- to_guess() [edit on github]