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.Attributes Summary
Methods Summary
contains([point, x, y])Test whether one or more points fall within these bounds.
intersection(other)Compute the intersection of this bounds object with another.
Convert a bounds instance into a serializable object.
Attributes Documentation
- bbox#
Methods Documentation
- contains(point=None, /, *, x=None, y=None)#
Test whether one or more points fall within these bounds.
- Parameters:
point (
Union[XY[Any],YX[Any],None], default:None) – AnXYorYXcoordinate pair to test for containment. Mutually exclusive withxandy.x (
int|float|TypeAliasType|None, default:None) – One or more X coordinates to test for containment, as a scalar or any array-like. Results are broadcast againsty. Mutually exclusive withpoint.y (
int|float|TypeAliasType|None, default:None) – One or more Y coordinates to test for containment, as a scalar or any array-like. Results are broadcast againstx. Mutually exclusive withpoint.
- Returns:
If
xandyare both scalars, a singleboolvalue. Ifxandyare array-like, a boolean array with their broadcasted shape.- Return type:
- intersection(other)#
Compute the intersection of this bounds object with another.
- serialize()#
Convert a bounds instance into a serializable object.
- Return type:
TypeAliasType
Notes
The returned object must support direct nesting with Pydantic models and have a
deserializemethod (taking no arguments) that converts back to thisBoundstype. It is common forserializeanddeserializeto just returnself, when the bounds object is natively serializable.