BaseField#

class lsst.images.fields.BaseField#

Bases: ABC

An abstract base class for parametric or interpolated 2-d functions, generally representing some sort of calculated image.

Notes#

The field hierarchy is closed to the types in this package, so we can enumerate all of the serializations and avoid any kind of extension system. All field types are immutable.

Field types implement the function call operator and both multiplication and division by a constant via operator overloading. See the named evaluate and multiply_constant methods (respectively) for more information about those operations.

This interface will probably change in the future to incorporate options for dealing with out-of-bounds positions. At present the behavior for such positions is implementation-specific and should not be relied upon.

Attributes Summary

bounds

The region over which this field can be evaluated (Bounds).

is_constant

Whether the field is spatially constant (bool).

unit

The units of the field (astropy.units.UnitBase or None).

Methods Summary

__call__()

Call self as a function.

make_legacy_photo_calib(image_unit)

Make a legacy lsst.afw.image.PhotoCalib for an image with the given units, if that is possible without a photometric scaling field.

render([bbox, dtype])

Create an image realization of the field.

to_legacy()

Convert to a legacy lsst.afw.math.BoundedField.

to_legacy_photo_calib(image_unit)

Convert to a legacy lsst.afw.image.PhotoCalib.

Attributes Documentation

bounds#

The region over which this field can be evaluated (Bounds).

is_constant#

Whether the field is spatially constant (bool).

unit#

The units of the field (astropy.units.UnitBase or None).

Methods Documentation

__call__(point: XY[int | float] | YX[int | float], /, *, quantity: Literal[False] = False) float#
__call__(point: XY[int | float] | YX[int | float], /, *, quantity: Literal[True]) Quantity
__call__(point: XY[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]] | YX[Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]], /, *, quantity: bool = False) ndarray | Quantity
__call__(*, x: int | float, y: int | float, quantity: Literal[False] = False) float
__call__(*, x: int | float, y: int | float, quantity: Literal[True]) Quantity
__call__(*, x: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], y: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], quantity: bool = False) ndarray | Quantity

Call self as a function.

static make_legacy_photo_calib(image_unit: astropy.units.UnitBase) LegacyPhotoCalib | None#

Make a legacy lsst.afw.image.PhotoCalib for an image with the given units, if that is possible without a photometric scaling field.

Parameters#

image_unit

Units of the image the photometric calibration applies to.

abstract 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.bbox will be used.

dtype

Pixel data type for the returned image.

to_legacy() LegacyBoundedField#

Convert to a legacy lsst.afw.math.BoundedField.

to_legacy_photo_calib(image_unit: astropy.units.UnitBase) LegacyPhotoCalib#

Convert to a legacy lsst.afw.image.PhotoCalib.

Parameters#

image_unit

The units of the pixels the returned PhotoCalib will be associated with.