DataSpace1D

class sherpa.data.DataSpace1D(filter, x)[source] [edit on github]

Bases: EvaluationSpace1D

Class for representing 1-D Data Space. Data Spaces are spaces that describe the data domain. As models can be evaluated over data spaces, data spaces can be considered evaluation spaces themselves. However this “is-a” relationship is in the code mostly for convenience and could be removed in future versions.

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?

midpoint_grid

The mid-points of the space.

start

The start (lowest value) of the space.

Methods

for_model(model)

Models can be defined over arbitrary evaluation spaces.

get([filter])

Get a filtered representation of this data set.

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?

midpoint_grid

The mid-points of the space.

start

The start (lowest value) of the space.

Methods Summary

for_model(model)

Models can be defined over arbitrary evaluation spaces.

get([filter])

Get a filtered representation of this data set.

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.

grid

The grid representation of the space.

Returns:
tuple

A tuple representing the x axis. The tuple will contain two arrays if the dataset is integrated, one otherwise.

is_ascending

Is the space ascending?

is_empty

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

is_integrated

Is the space integrated?

midpoint_grid

The mid-points of the space.

For non-integrated spaces this returns the X axis.

Returns:
array

Return the average point of the bins of integrated axes, for each bin, or the non-integrated x axis array.

start

The start (lowest value) of the space.

Methods Documentation

for_model(model)[source] [edit on github]

Models can be defined over arbitrary evaluation spaces. However, at evaluation time during a fit, the model’s evaluation space shall be done at the user’s request space only and set to 0 every where else.

Parameters:
modelThe model whose evaluation space needs to be joined with the dataset’s data space.
Returns:
DataSpace1D

A data space that joins this data space with the model’s evaluation space. if the model does not have an evaluation space assigned to itself then self is returned.

get(filter=False)[source] [edit on github]

Get a filtered representation of this data set. If filter is False this object is returned.

Parameters:
filterbool

whether the data set should be filtered before being returned

Returns:
DataSpace1D
overlaps(other) [edit on github]

Check if this evaluation space overlaps with another.

Parameters:
otherEvaluationSpace1D

The space to compare to.

Returns:
bool

True if they overlap, False if not

zeros_like() [edit on github]

Returns zeroes for each element of the space.

Returns:
array

A one-dimensional array.