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 (array_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.

  • y (array_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 (array_like or None, optional) – The high end of the x and y data bins for integrated datasets.

  • yhi (array_like or None, optional) – The high end of the x and y data bins for integrated datasets.

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) – The end of the x and y axis arrays, respectively.

Return type:

(number, number)

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:

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

Return type:

tuple

is_ascending

Is the space ascending?

Returns:

(xflag, yflag) – True if the axis is ascending, False otherwise, for the x and y axes respectively.

Return type:

(bool, bool)

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) – The start of the x and y axis arrays, respectively.

Return type:

(number, number)

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:

other (EvaluationSpace2D) – The space to compare to.

Returns:

True if they overlap, False if not

Return type:

bool

zeros_like()[source] [edit on github]

Returns zeroes for each element of the space.

Returns:

A one dimensional array.

Return type:

array