EllipticalROI

class glue.core.roi.EllipticalROI(xc=None, yc=None, radius_x=None, radius_y=None, theta=None)[source]

Bases: Roi

A 2D elliptical region of interest with semimajor/minor axes radius_[xy].

Parameters
xcfloat, optional

x coordinate of center.

ycfloat, optional

y coordinate of center.

radius_xfloat, optional

Semiaxis along x axis.

radius_yfloat, optional

Semiaxis along y axis.

thetafloat, optional

Angle of anticlockwise rotation around (xc, yc) in radian.

Notes

The radius_x, radius_y properties refer to the semiaxes along the x and y axes before any rotation is applied.

Methods Summary

bounds()

Returns (conservatively estimated) boundary values in x and y

contains(x, y)

Test which of a set of (x, y) points fall within the region of interest.

defined()

Returns True if the ROI is defined

get_center()

move_to(xdelta, ydelta)

Translate the ROI to a center of (x, y)

reset()

Reset the rectangular region

rotate_to(theta)

Rotate anticlockwise around center to position angle theta.

to_polygon()

Returns vertices vx, vy of a polygon approximating the Roi, where each is an array of vertex coordinates in x and y.

transformed([xfunc, yfunc])

A transformed version of the Roi

Methods Documentation

bounds()[source]

Returns (conservatively estimated) boundary values in x and y

contains(x, y)[source]

Test which of a set of (x, y) points fall within the region of interest.

Parameters
xfloat or array-like

x coordinate(s) of point(s).

yfloat or array-like

y coordinate(s) of point(s).

Returns
insidebool or ~numpy.ndarray

An boolean iterable, where each element is True if the corresponding (x, y) tuple is inside the Roi.

Raises
UndefinedROI

If not defined.

defined()[source]

Returns True if the ROI is defined

get_center()[source]
move_to(xdelta, ydelta)[source]

Translate the ROI to a center of (x, y)

reset()[source]

Reset the rectangular region

rotate_to(theta)[source]

Rotate anticlockwise around center to position angle theta.

Parameters
thetafloat

Angle of anticlockwise rotation around center in radian.

to_polygon()[source]

Returns vertices vx, vy of a polygon approximating the Roi, where each is an array of vertex coordinates in x and y.

transformed(xfunc=None, yfunc=None)[source]

A transformed version of the Roi