ChebyshevField#

final class lsst.images.fields.ChebyshevField(bounds, coefficients, *, unit=None)#

Bases: BaseField

A 2-d Chebyshev polynomial over a rectangular region.

Parameters:
  • bounds (Bounds) – The region where this field can be evaluated. The bbox of this region is grown by half a pixel on all sides and then used to remap coordinates to [-1, 1]x[-1, 1], which is the natural domain of a 2-d Chebyshev polynomial.

  • coefficients (ndarray) – Coefficients for the 2-d Chebyshev polynomial of the first kind, as a 2-d matrix in which element [p, q] corresponds to the coefficient of T_p(y) T_q(x). Will be set to read-only in place.

  • unit (UnitBase | None, default: None) – Units of the field.

Attributes Summary

bounds

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

coefficients

Coefficients for the 2-d Chebyshev polynomial of the first kind, as a 2-d matrix in which element [p, q] corresponds to the coefficient of T_p(y) T_q(x).

is_constant

Whether the field is spatially constant (bool).

order

Maximum polynomial order in either dimension (int).

unit

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

x_order

Maximum polynomial order in the column dimension (int).

y_order

Maximum polynomial order in the row dimension (int).

Methods Summary

__call__([point, x, y, quantity])

Call self as a function.

fit(bounds, data[, order, weight, y_order, ...])

Fit a Chebyshev field to data points using linear least squares.

from_legacy(legacy[, unit, bounds])

Convert from a legacy lsst.afw.math.ChebyshevBoundedField.

from_legacy_background(legacy_background[, ...])

Convert from a legacy lsst.afw.math.BackgroundMI instance.

from_legacy_function2(legacy_function2[, ...])

Convert from a legacy lsst.afw.math.Chebyshev1Function2D.

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.

serialize(archive)

Serialize the Chebyshev field to an output archive.

to_legacy()

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

to_legacy_function2()

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

to_legacy_photo_calib(image_unit)

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

Attributes Documentation

bounds#
coefficients#

Coefficients for the 2-d Chebyshev polynomial of the first kind, as a 2-d matrix in which element [p, q] corresponds to the coefficient of T_p(y) T_q(x).

is_constant#
order#

Maximum polynomial order in either dimension (int).

unit#
x_order#

Maximum polynomial order in the column dimension (int).

y_order#

Maximum polynomial order in the row dimension (int).

Methods Documentation

__call__(point=None, /, *, x=None, y=None, quantity=False)#

Call self as a function.

Parameters:
  • point (Union[XY[Any], YX[Any], None], default: None)

  • x (Any, default: None)

  • y (Any, default: None)

  • quantity (bool, default: False)

Return type:

float | ndarray | Quantity

static fit(bounds, data, order=None, *, y, x, weight=None, y_order=None, x_order=None, triangular=True, unit=None)#

Fit a Chebyshev field to data points using linear least squares.

Parameters:
  • bounds (Bounds) – Bounding box over which the Chebyshev field is defined.

  • data (ndarray | Quantity) – Data points to fit. If this is an astropy.units.Quantity, this sets the units of the field and the unit argument cannot also be provided.

  • order (int | None, default: None) – Maximum order for the Chebyshev polynomial in both dimensions.

  • y (ndarray) – Y coordinates of the data points. Must have either the same shape as data (providing the coordinates for all points directly), or be a 1-d array with the same size as data.shape[0] (when data is a 2-d image and y provides the coordinates of the rows).

  • x (ndarray) – X coordinates of the data points. Must have either the same shape as data (providing the coordinates for all points directly), or be a 1-d array with the same size as data.shape[1] (when data is a 2-d image and x provides the coordinates of the columns).

  • weight (ndarray | None, default: None) – Weights to apply to the data points. Must have the same shape as data.

  • y_order (int | None, default: None) – Maximum order for the Chebyshev polynomial in y. Requires x_order to also be provided. Incompatible with order.

  • x_order (int | None, default: None) – Maximum order for the Chebyshev polynomial in x. Requires y_order to also be provided. Incompatible with order.

  • triangular (bool, default: True) – If True, only fit for coefficients of T_p(y) T_q(x) where p + q <= max(y_order, x_order).

  • unit (UnitBase | None, default: None) – Units of the returned field.

Return type:

ChebyshevField

static from_legacy(legacy, unit=None, bounds=None)#

Convert from a legacy lsst.afw.math.ChebyshevBoundedField.

Parameters:
  • legacy (TypeAliasType) – Legacy field to convert.

  • unit (UnitBase | None, default: None) – The units of the returned field (lsst.afw.math.BoundedField objects do not know their units).

  • bounds (Bounds | None, default: None) – The bounds of the returned field, if they should be different from the bounding box of legacy.

Return type:

ChebyshevField

static from_legacy_background(legacy_background, bounds=None, unit=None)#

Convert from a legacy lsst.afw.math.BackgroundMI instance.

Parameters:
  • legacy_background (TypeAliasType) – Legacy background object to convert.

  • bounds (Bounds | None, default: None) – The bounds of the returned field, if they should be different from the bounding box of legacy_background.

  • unit (UnitBase | None, default: None) – The units of the returned field (lsst.afw.math.Background objects do not know their units).

Return type:

ChebyshevField

static from_legacy_function2(legacy_function2, bounds=None, unit=None)#

Convert from a legacy lsst.afw.math.Chebyshev1Function2D.

Parameters:
  • legacy_function2 (TypeAliasType) – Legacy function object to convert.

  • bounds (Bounds | None, default: None) – The bounds of the returned field, if they should be different from the bounding box of legacy_background.

  • unit (Unit | None, default: None) – The units of the returned field.

Return type:

ChebyshevField

static 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.

Parameters:

image_unit (UnitBase) – Units of the image the photometric calibration applies to.

Return type:

TypeAliasType | None

render(bbox=None, *, dtype=None)#

Create an image realization of the field.

Parameters:
  • bbox (Box | None, default: None) – Bounding box of the image. If not provided, self.bounds.bbox will be used.

  • dtype (TypeAliasType | None, default: None) – Pixel data type for the returned image.

Return type:

Image

serialize(archive)#

Serialize the Chebyshev field to an output archive.

Parameters:

archive (OutputArchive[Any]) – Archive to write to.

Return type:

ChebyshevFieldSerializationModel

to_legacy()#

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

Return type:

TypeAliasType

to_legacy_function2()#

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

Return type:

TypeAliasType

to_legacy_photo_calib(image_unit)#

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

Parameters:

image_unit (UnitBase) – The units of the pixels the returned PhotoCalib will be associated with.

Return type:

TypeAliasType

This page was last modified on .