Bounds#
- class lsst.images.Bounds(*args, **kwargs)#
Bases:
ProtocolA protocol for objects that represent the validity region for a function defined in 2-d pixel coordinates.
Notes#
Most objects natively have a simple 2-d bounding box as their bounds (typically the boundary of a sensor), and the
Boxclass is hence the most common bounds implementation. But sometimes a large chunk of that box may be missing due to vignetting or bad amplifiers, and we may want to transform from one coordinate system to another. The Bounds interface is intended to handle both of these cases as well.Methods Summary
boundary()Iterate over points on the boundary as
(y, x)tuples.contains()Test whether this box fully contains another or one or more points.
deserialize(serialized)Convert a serialized bounds object into its in-memory form.
Convert a bounds instance into a serializable object.
Methods Documentation
- contains(*, x: int, y: int) bool#
- contains(*, x: ndarray, y: ndarray) ndarray
Test whether this box fully contains another or one or more points.
Parameters#
- x
One or more integer X coordinates to test for containment. If an array, an array of results will be returned.
- y
One or more integer Y coordinates to test for containment. If an array, an array of results will be returned.
Returns#
bool|numpy.ndarrayIf
xandyare both scalars, a singleboolvalue. Ifxandyare arrays, a boolean array with their broadcasted shape.
- classmethod deserialize(serialized: SerializableBounds) Self#
Convert a serialized bounds object into its in-memory form.
- serialize() SerializableBounds#
Convert a bounds instance into a serializable object.