IntervalSliceFactory#
- class lsst.images.IntervalSliceFactory(parent: Interval | None = None, is_local: bool = False)#
Bases:
objectA factory for
Intervalobjects using array-slice syntax.Notes#
When indexed with a single slice on the
Interval.factoryattribute, this returns anIntervalwith exactly the given bounds:assert Interval.factory[3:6] == 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
Interval.absoluteproperty, indices are absolute coordinate values, but any omitted bounds are replaced with the parent interval’s bounds:parent = Interval.factory[3:6] assert Interval.factory[4:5] == parent.absolute[:5]
The final interval is also checked to be contained by the parent interval.
When obtained from the
Interval.localproperty, indices are interpreted as relative to the parent interval, and negative indices are relative to the end (likeSequenceindexing):parent = Interval.factory[3:6] assert Interval.factory[4:5] == parent.local[1:-1]
When the stop bound is greater than the size of the parent interval, the returned interval is clipped to be contained by the parent (as in
Sequenceindexing).