XY#
- class lsst.images.XY(x: T, y: T)#
Bases:
NamedTuple,GenericA pair of per-dimension objects, ordered
(x, y).Notes#
XYis used for points and other 2-d pairs when the most natural ordering is(x, y). Because it is atuple, however, arithmetic operations behave as they would on acollections.abc.Sequence, not a mathematical vector (e.g. adding concatenates).In Pydantic models
XYis serialized as a JSON object withxandykeys rather than an array, so the dimension order is explicit in the serialized form. Validation also accepts a two-element[x, y]array, the form emitted before the object form was introduced and still present in files that cannot be rewritten. Pydantic only invokes the schema hooks that provide this for bareXYannotations, however, because it handles parameterized named tuples specially; model fields that need a member type (e.g.XY[float]) must be annotated withSerializableXYinstead.See Also#
YX
Attributes Summary
The x / column object.
The y / row object.
A tuple of the same objects in the opposite order.
Methods Summary
count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
map(func)Apply a function to both objects.
Convert to a legacy
lsst.geom.Extent2Dobject.Convert to a legacy
lsst.geom.Point2Dobject.Convert to a legacy
lsst.geom.Extent2Iobject.Convert to a legacy
lsst.geom.Point2Iobject.Attributes Documentation
- x: T#
The x / column object.
- y: T#
The y / row object.
- yx#
A tuple of the same objects in the opposite order.
Methods Documentation
- count(value, /)#
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)#
Return first index of value.
Raises ValueError if the value is not present.
- map(func: Callable[[T], U]) XY#
Apply a function to both objects.
Parameters#
- func
Callable applied to each of the two objects in turn.
- to_legacy_float_extent() LegacyExtent2D#
Convert to a legacy
lsst.geom.Extent2Dobject.
- to_legacy_float_point() LegacyPoint2D#
Convert to a legacy
lsst.geom.Point2Dobject.
- to_legacy_int_extent() LegacyExtent2I#
Convert to a legacy
lsst.geom.Extent2Iobject.
- to_legacy_int_point() LegacyPoint2I#
Convert to a legacy
lsst.geom.Point2Iobject.