SumField#
- final class lsst.images.fields.SumField(operands: Iterable[Field])#
Bases:
BaseFieldA field that sums other fields lazily.
Parameters#
- operands
Iterable[BaseField] The fields to sum together.
Attributes Summary
The region over which this field can be evaluated (
Bounds).The fields that are summed together (
tuple[BaseField, ...]).The units of the field (
astropy.units.UnitBaseorNone).Methods Summary
__call__(*, x, y[, quantity])Call self as a function.
deserialize(model, archive)Deserialize the field from an input archive.
evaluate(*, x, y[, quantity])Evaluate at non-gridded points.
from_legacy_background(legacy_background[, unit])Convert from a legacy
lsst.afw.math.BackgroundListinstance.multiply_constant(factor)Multiply by a constant, returning a new field of the same type.
render([bbox, dtype])Create an image realization of the field.
serialize(archive)Serialize the field to an output archive.
Attributes Documentation
- bounds#
- unit#
Methods Documentation
- __call__(*, x: ndarray, y: ndarray, quantity: bool = False) ndarray | Quantity#
Call self as a function.
- static deserialize(model: SumFieldSerializationModel, archive: InputArchive[Any]) SumField#
Deserialize the field from an input archive.
- evaluate(*, x: ndarray, y: ndarray, quantity: bool = False) ndarray | Quantity#
Evaluate at non-gridded points.
Parameters#
- x
X coordinates to evaluate at.
- y
Y coordinates to evaluate at; must be broadcast-compatible with
x.- quantity
If
True, return anastropy.units.Quantityinstead of anumpy.ndarray. IfunitisNone, the returned object will be a dimensionlessQuantity.
- static from_legacy_background(legacy_background: LegacyBackgroundList, unit: astropy.units.UnitBase | None = None) SumField#
Convert from a legacy
lsst.afw.math.BackgroundListinstance.
- multiply_constant(factor: float | Quantity | UnitBase) SumField#
Multiply by a constant, returning a new field of the same type.
Parameters#
- factor
Factor to multiply by. When this has units, those should multiply
self.unitor set the units of the returned field ifself.unit is None.
- render(bbox: Box | None = None, *, dtype: type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None = None) Image#
Create an image realization of the field.
Parameters#
- bbox
Bounding box of the image. If not provided,
self.bounds.bboxwill be used.- dtype
Pixel data type for the returned image.
- serialize(archive: OutputArchive[Any]) SumFieldSerializationModel#
Serialize the field to an output archive.
- operands