Template Class MatrixBuilder

Class Documentation

template<typename T>
class MatrixBuilder

Class that evaluates a (multi-)shapelet basis at predefined points.

The output “matrix” has pixels along the rows, and basis elements along columns; this is the design matrix involved in a linear least squares fit for the basis coefficients.

A MatrixBuilder can be constructed in two ways: via one of its own constructors, or via a MatrixBuilderFactory. Using the latter allows the workspace arrays used by the MatrixBuilder to be shared between instances. See MatrixBuilderFactory and MatrixBuilderWorkspace for more information.

Public Types

typedef MatrixBuilderFactory<T> Factory

Factory type associated with this builder.

typedef MatrixBuilderWorkspace<T> Workspace

Workspace type associated with this builder.

Public Functions

MatrixBuilder(ndarray::Array<T const, 1, 1> const &x, ndarray::Array<T const, 1, 1> const &y, int order)

Create a MatrixBuilder that evaluates a simple non-compound shapelet basis.

Parameters
  • [in] x: column positions at which the basis should be evaluated.

  • [in] y: row positions at which the basis should be evaluated (same size as x).

  • [in] order: order of the shapelet basis

MatrixBuilder(ndarray::Array<T const, 1, 1> const &x, ndarray::Array<T const, 1, 1> const &y, int order, ShapeletFunction const &psf)

Create a MatrixBuilder that evaluates a simple non-compound shapelet basis after convolving it with a ShapeletFunction.

Parameters
  • [in] x: column positions at which the basis should be evaluated.

  • [in] y: row positions at which the basis should be evaluated (same size as x).

  • [in] order: order of the shapelet basis

  • [in] psf: function to convolve the basis with

MatrixBuilder(ndarray::Array<T const, 1, 1> const &x, ndarray::Array<T const, 1, 1> const &y, MultiShapeletBasis const &basis)

Create a MatrixBuilder that evaluates a MultiShapeletBasis object.

Parameters
  • [in] x: column positions at which the basis should be evaluated.

  • [in] y: row positions at which the basis should be evaluated (same size as x).

  • [in] basis: basis object defining the functions the matrix evaluates

MatrixBuilder(ndarray::Array<T const, 1, 1> const &x, ndarray::Array<T const, 1, 1> const &y, MultiShapeletBasis const &basis, MultiShapeletFunction const &psf)

Create a MatrixBuilder that evaluates a MultiShapeletBasis object after convolving it with a MultiShapeletFunction.

Parameters
  • [in] x: column positions at which the basis should be evaluated.

  • [in] y: row positions at which the basis should be evaluated (same size as x).

  • [in] basis: basis object defining the functions the matrix evaluates

  • [in] psf: function to convolve the basis with

int getDataSize() const

Return the number of data points.

int getBasisSize() const

Return the number of basis elements.

ndarray::Array<T, 2, -2> allocateOutput() const

Return a matrix appropriate for use as an output for operator().

void operator()(ndarray::Array<T, 2, -1> const &output, afw::geom::ellipses::Ellipse const &ellipse) const

Fill an array with the model matrix.

Parameters
  • [out] output: Matrix to fill, with dimensions (getDataSize(), getBasisSize()). Will be zeroed before filling.

  • [in] ellipse: Ellipse parameters of the model, with center relative to the x and y arrays passed at construction.

ndarray::Array<T, 2, -2> operator()(afw::geom::ellipses::Ellipse const &ellipse) const

Return a newly-allocated model matrix.

Parameters
  • [in] ellipse: Ellipse parameters of the model, with center relative to the x and y arrays passed at construction.