BoxSliceFactory#
- class lsst.images.BoxSliceFactory(y: ~lsst.images._geom.IntervalSliceFactory = <lsst.images._geom.IntervalSliceFactory object>, x: ~lsst.images._geom.IntervalSliceFactory = <lsst.images._geom.IntervalSliceFactory object>)#
Bases:
objectA factory for
Boxobjects using array-slice syntax.Notes#
When
Box.factoryis indexed with a pair of slices, this returns aBoxwith exactly those bounds:assert ( Box.factory[3:6, -1:2] == Box(x=Interval(start=-1, stop=2), y=Interval(start=3, stop=6) )
A missing start bound is replaced by
0, but a missing stop bound is not allowed.When obtained from the
Box.absoluteproperty, indices are absolute coordinate values, but any omitted bounds are replaced with the parent box’s bounds:parent = Box.factory[3:6, -1:2] assert Box.factory[4:5, 0:2] == parent.absolute[:5, 0:]
The final box is also checked to be contained by the parent box.
When obtained from the
Box.localproperty, indices are interpreted as relative to the parent box, and negative indices are relative to the end (likeSequenceindexing):parent = Box.factory[3:6, -1:2] assert Box.factory[4:5, 0:2] == parent.local[1:-1, 1:]