Axis

class sherpa.models.regrid.Axis(lo, hi)[source] [edit on github]

Bases: object

Represent the axes of a N-D object.

This supports both “integrated” and “non-integrated” (point) datasets.

Parameters
  • lo (array_like or None) – The starting point of the axis. If lo is None or empty then the data axis is said to be empty. The axis can be in ascending or descending order.

  • hi (array_like or None) – The ending point of the axis for “integrated” axes, i.e. those which have a low and high edge.

Attributes Summary

end

The ending point of the data axis

is_ascending

Is the axis ascending?

is_empty

Is the axis empty?

is_integrated

Is the axis integrated?

size

The size of the axis.

start

The starting point (lowest value) of the data axis.

Methods Summary

overlaps(other)

Check if this axis overlaps with another.

Attributes Documentation

end

The ending point of the data axis

If the data axis is ascending the end boundary is the last element of the hi array when the axis is integrated, otherwise it’s the last element of lo. Conversely, for descending axes, the last element is either the first element of the hi array or of the lo array, depending on whether the axis is integrated or not, respectively.

is_ascending

Is the axis ascending?

The axis is ascending if the elements in lo are sorted in ascending order. Only the first and last elements are checked, and it is assumed that the elements are sorted.

is_empty

Is the axis empty?

An empty axis has lo set to None or a zero-element array.

is_integrated

Is the axis integrated?

Is hi set and not a zero-element array?

size

The size of the axis.

start

The starting point (lowest value) of the data axis.

Methods Documentation

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

Check if this axis overlaps with another.

Parameters

other (Axis) – The axis to compare to.

Returns

True if they overlap, False if not

Return type

bool