EvaluationSpace2D

class sherpa.models.regrid.EvaluationSpace2D(x=None, y=None, xhi=None, yhi=None)[source] [edit on github]

Bases: object

Class for 2D Evaluation Spaces.

An Evaluation Space is a set of data axes representing the data space over which a model can be evaluated. A 2D Evaluation Space has two axes, x and y.

Parameters:
x, yarray_like or None, optional

The data array, or the low end of the x and y data bins if the dataset is “integrated”. These are not required to be the same length.

xhi, yhiarray_like or None, optional

The high end of the x and y data bins for integrated datasets.

Attributes:
end

The end (highest value) of the space.

grid

The grid representation of the space.

is_ascending

Is the space ascending?

is_empty

Is the space empty (the x axis has no elements)?

is_integrated

Is the space integrated?

shape

The sizes of the x and y axes.

start

The start (lowest value) of the space.

Methods

overlaps(other)

Check if this evaluation space overlaps with another.

zeros_like()

Returns zeroes for each element of the space.

Attributes Summary

end

The end (highest value) of the space.

grid

The grid representation of the space.

is_ascending

Is the space ascending?

is_empty

Is the space empty (the x axis has no elements)?

is_integrated

Is the space integrated?

shape

The sizes of the x and y axes.

start

The start (lowest value) of the space.

Methods Summary

overlaps(other)

Check if this evaluation space overlaps with another.

zeros_like()

Returns zeroes for each element of the space.

Attributes Documentation

end

The end (highest value) of the space.

Returns:
(xend, yend)(number, number)

The end of the x and y axis arrays, respectively.

grid

The grid representation of the space.

The x and y arrays in the grid are one-dimensional representations of the meshgrid obtained from the x and y axis arrays, as in numpy.meshgrid(x, y)[0].ravel()

Returns:
tuple

A two element (x, y) or 4 element (x, y, xhi, yhi) tuple.

is_ascending

Is the space ascending?

Returns:
(xflag, yflag)(bool, bool)

True if the axis is ascending, False otherwise, for the x and y axes respectively.

is_empty

Is the space empty (the x axis has no elements)?

is_integrated

Is the space integrated?

shape

The sizes of the x and y axes.

start

The start (lowest value) of the space.

Returns:
(xstart, ystart)(number, number)

The start of the x and y axis arrays, respectively.

Methods Documentation

overlaps(other)[source] [edit on github]

Check if this evaluation space overlaps with another.

Note that this is more stringent for 2D, as the boundaries need to coincide in this case.

Parameters:
otherEvaluationSpace2D

The space to compare to.

Returns:
bool

True if they overlap, False if not

zeros_like()[source] [edit on github]

Returns zeroes for each element of the space.

Returns:
array

A one dimensional array.