ChebyshevField#
- final class lsst.images.fields.ChebyshevField(bounds, coefficients, *, unit=None)#
Bases:
BaseFieldA 2-d Chebyshev polynomial over a rectangular region.
- Parameters:
bounds (
Bounds) – The region where this field can be evaluated. Thebboxof 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 ofT_p(y) T_q(x). Will be set to read-only in place.
Attributes Summary
The region over which this field can be evaluated (
Bounds).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 ofT_p(y) T_q(x).Whether the field is spatially constant (
bool).Maximum polynomial order in either dimension (
int).The units of the field (
astropy.units.UnitBaseorNone).Maximum polynomial order in the column dimension (
int).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.BackgroundMIinstance.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.PhotoCalibfor 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.
Convert to a legacy
lsst.afw.math.ChebyshevBoundedField.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 ofT_p(y) T_q(x).
- is_constant#
- unit#
Methods Documentation
- __call__(point=None, /, *, x=None, y=None, quantity=False)#
Call self as a function.
- 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 anastropy.units.Quantity, this sets the units of the field and theunitargument 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 asdata(providing the coordinates for all points directly), or be a 1-d array with the same size asdata.shape[0](whendatais a 2-d image andyprovides the coordinates of the rows).x (
ndarray) – X coordinates of the data points. Must have either the same shape asdata(providing the coordinates for all points directly), or be a 1-d array with the same size asdata.shape[1](whendatais a 2-d image andxprovides the coordinates of the columns).weight (
ndarray|None, default:None) – Weights to apply to the data points. Must have the same shape asdata.y_order (
int|None, default:None) – Maximum order for the Chebyshev polynomial iny. Requiresx_orderto also be provided. Incompatible withorder.x_order (
int|None, default:None) – Maximum order for the Chebyshev polynomial inx. Requiresy_orderto also be provided. Incompatible withorder.triangular (
bool, default:True) – IfTrue, only fit for coefficients ofT_p(y) T_q(x)wherep + q <= max(y_order, x_order).unit (
UnitBase|None, default:None) – Units of the returned field.
- Return type:
- 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.BoundedFieldobjects 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 oflegacy.
- Return type:
- static from_legacy_background(legacy_background, bounds=None, unit=None)#
Convert from a legacy
lsst.afw.math.BackgroundMIinstance.- 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 oflegacy_background.unit (
UnitBase|None, default:None) – The units of the returned field (lsst.afw.math.Backgroundobjects do not know their units).
- Return type:
- static from_legacy_function2(legacy_function2, bounds=None, unit=None)#
Convert from a legacy
lsst.afw.math.Chebyshev1Function2D.- Parameters:
- Return type:
- static make_legacy_photo_calib(image_unit)#
Make a legacy
lsst.afw.image.PhotoCalibfor an image with the given units, if that is possible without a photometric scaling field.
- render(bbox=None, *, dtype=None)#
Create an image realization of the field.
- serialize(archive)#
Serialize the Chebyshev field to an output archive.
- Parameters:
archive (
OutputArchive[Any]) – Archive to write to.- Return type:
- 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