casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casa::LatConvEquation Class Reference

Implements the convolution equation. More...

#include <LatConvEquation.h>

Inheritance diagram for casa::LatConvEquation:
casa::LinearEquation< casacore::Lattice< casacore::Float >, casacore::Lattice< casacore::Float > > casa::ResidualEquation< casacore::Lattice< casacore::Float > > casa::IPLatConvEquation

Public Member Functions

 LatConvEquation (casacore::Lattice< casacore::Float > &psf, casacore::Lattice< casacore::Float > &dirtyImage)
 Construct the LatConvEquation setting the psf and measured data. More...
 
virtual ~LatConvEquation ()
 destroy More...
 
virtual casacore::Bool evaluate (casacore::Lattice< casacore::Float > &result, const LinearModel< casacore::Lattice< casacore::Float > > &model)
 Do the convolution of the model supplied by the LinearModel class with the internal psf. More...
 
casacore::Lattice
< casacore::Float > * 
evaluate (const casacore::IPosition &position, const casacore::Float amplitude, const casacore::IPosition &modelShape)
 Do the convolution of the a point source model at position 'position' with amplitude 'amplitude' and the internal psf. More...
 
casacore::Bool evaluate (casacore::Array< casacore::Float > &result, const casacore::IPosition &position, const casacore::Float amplitude, const casacore::IPosition &modelShape)
 Do the convolution of the a point source model at position 'position' with amplitude 'amplitude' and the internal psf. More...
 
virtual casacore::Bool residual (casacore::Lattice< casacore::Float > &result, const LinearModel< casacore::Lattice< casacore::Float > > &model)
 Calculate the convolution of the model (supplied by the LinearModel class) and the psf and the difference between this and the supplied (presumably measured) convolution. More...
 
virtual casacore::Bool residual (casacore::Lattice< casacore::Float > &result, casacore::Float &chisq, const LinearModel< casacore::Lattice< casacore::Float > > &model)
 Calculate the convolution of the model (supplied by the LinearModel class) and the psf and the difference between this and the supplied (presumably measured) convolution. More...
 
virtual casacore::Bool residual (casacore::Lattice< casacore::Float > &result, casacore::Float &chisq, casacore::Lattice< casacore::Float > &mask, const LinearModel< casacore::Lattice< casacore::Float > > &model)
 Calculate the convolution of the model (supplied by the LinearModel class) and the psf and the difference between this and the supplied (presumably measured) convolution. More...
 
casacore::IPosition psfSize ()
 return the psf size used in the convolution. More...
 
- Public Member Functions inherited from casa::LinearEquation< casacore::Lattice< casacore::Float >, casacore::Lattice< casacore::Float > >
virtual ~LinearEquation ()
 A virtual destructor may be necessary for use in derived classes. More...
 
- Public Member Functions inherited from casa::ResidualEquation< casacore::Lattice< casacore::Float > >
virtual ~ResidualEquation ()
 A virtual destructor may be necessary for use in derived classes. More...
 
virtual casacore::Bool residual (Domain &answer, const LinearModel< Domain > &model)=0
 The canonical member of this class defines a function which gives the residual when the model is propagated through the equation and compared with the data. More...
 
virtual casacore::Bool residual (Domain &answer, casacore::Float &chisq, const LinearModel< Domain > &model)=0
 Same as above, but also calculates Chi^2 (rms of residual image) More...
 
virtual casacore::Bool residual (Domain &answer, casacore::Float &chisq, Domain &mask, const LinearModel< Domain > &model)=0
 Same as above, but also calculates Chi^2 (rms of residual image) considering a mask image. More...
 

Protected Member Functions

 LatConvEquation ()
 Don't use this one, due to the casacore::Lattice<casacore::Float> &. More...
 

Protected Attributes

casacore::Lattice
< casacore::Float > * 
itsMeas
 
casacore::Lattice
< casacore::Float > * 
itsPsf
 
casacore::LatticeConvolver
< casacore::Float
itsConv
 
casacore::IPosition itsPsfOrigin
 
casacore::IPosition itsRealPsfSize
 
casacore::Bool itsVirgin
 

Detailed Description

Implements the convolution equation.

Intended use:

Internal

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This class implements convolution within the LinearEquation framework.

Synopsis

This class is used in conjunction with classes like HogbomCleanModel to implement deconvolution algorithms. This class contains the point spread function (psf) and the convolved data (dirty image), and is able to convolve a supplied model with the psf to produce a predicted output (using the evaluate() function), or to subtract the convolved data and produce a residual (using the residual() function).

See the documentation for HogbomCleanModel for an example of how this class can be used to perform deconvolution.

This class also contains specialised functions (like the version of evaluate() for a point source model) that speed up the calculation of the convolution. This specialised version of evaluate() does not need to actually perform the convolution and instead returns a suitable part of the psf (zero padded if necessary). When this function is called this class will get the psf from the convolver and cache it, on the assumption that many evaluations of this function will be requested (as occurs in Clean algorithms).

The size and shape of the psf and the supplied model may be different. The only restriction is that the dimension of the psf must be less than or equal to the dimension of the model. If the dimension of the model is larger than the dimension of the psf then the convolution will be repeated along the slowest moving (last) axis. The dirty image and the supplied model must be the same size and shape.

Example

casacore::PagedArray<casacore::Float> psf(2,4,4), dirty(2,20,20), model(2,20,20);
.... put some meaningful values into these Lattices...\.
// create a convolution equation, and a casacore::PagedArray model
LatConvEquation convEqn(psf, dirty);
LinearModel< casacore::Lattice<casacore::Float> > myModel(model);
// now calculate the convolution of the model and the psf
convEqn.evaluate(myModel, prediction);
// and calculate the difference between the predicted and actual convolution
convEqn.residual(mymodel, residual)

Motivation

This class was designed with deconvolution in mind.

To Do

Definition at line 120 of file LatConvEquation.h.

Constructor & Destructor Documentation

casa::LatConvEquation::LatConvEquation ( casacore::Lattice< casacore::Float > &  psf,
casacore::Lattice< casacore::Float > &  dirtyImage 
)

Construct the LatConvEquation setting the psf and measured data.

virtual casa::LatConvEquation::~LatConvEquation ( )
virtual

destroy

casa::LatConvEquation::LatConvEquation ( )
protected

Don't use this one, due to the casacore::Lattice<casacore::Float> &.

Member Function Documentation

virtual casacore::Bool casa::LatConvEquation::evaluate ( casacore::Lattice< casacore::Float > &  result,
const LinearModel< casacore::Lattice< casacore::Float > > &  model 
)
virtual

Do the convolution of the model supplied by the LinearModel class with the internal psf.

Return the answer in result.

Implements casa::LinearEquation< casacore::Lattice< casacore::Float >, casacore::Lattice< casacore::Float > >.

casacore::Lattice<casacore::Float>* casa::LatConvEquation::evaluate ( const casacore::IPosition position,
const casacore::Float  amplitude,
const casacore::IPosition modelShape 
)

Do the convolution of the a point source model at position 'position' with amplitude 'amplitude' and the internal psf.

Return the answer in result.

casacore::Bool casa::LatConvEquation::evaluate ( casacore::Array< casacore::Float > &  result,
const casacore::IPosition position,
const casacore::Float  amplitude,
const casacore::IPosition modelShape 
)

Do the convolution of the a point source model at position 'position' with amplitude 'amplitude' and the internal psf.

Return the answer in result, which is an array Calling this will result in throwing away creating a new PSF owned by this object;

casacore::IPosition casa::LatConvEquation::psfSize ( )

return the psf size used in the convolution.

The returned size does not include any zero padding

virtual casacore::Bool casa::LatConvEquation::residual ( casacore::Lattice< casacore::Float > &  result,
const LinearModel< casacore::Lattice< casacore::Float > > &  model 
)
virtual

Calculate the convolution of the model (supplied by the LinearModel class) and the psf and the difference between this and the supplied (presumably measured) convolution.

Implements casa::LinearEquation< casacore::Lattice< casacore::Float >, casacore::Lattice< casacore::Float > >.

Reimplemented in casa::IPLatConvEquation.

virtual casacore::Bool casa::LatConvEquation::residual ( casacore::Lattice< casacore::Float > &  result,
casacore::Float chisq,
const LinearModel< casacore::Lattice< casacore::Float > > &  model 
)
virtual

Calculate the convolution of the model (supplied by the LinearModel class) and the psf and the difference between this and the supplied (presumably measured) convolution.

Also return chisq.

Implements casa::LinearEquation< casacore::Lattice< casacore::Float >, casacore::Lattice< casacore::Float > >.

Reimplemented in casa::IPLatConvEquation.

virtual casacore::Bool casa::LatConvEquation::residual ( casacore::Lattice< casacore::Float > &  result,
casacore::Float chisq,
casacore::Lattice< casacore::Float > &  mask,
const LinearModel< casacore::Lattice< casacore::Float > > &  model 
)
virtual

Calculate the convolution of the model (supplied by the LinearModel class) and the psf and the difference between this and the supplied (presumably measured) convolution.

Also return chisq, considering mask

Implements casa::LinearEquation< casacore::Lattice< casacore::Float >, casacore::Lattice< casacore::Float > >.

Member Data Documentation

casacore::LatticeConvolver<casacore::Float> casa::LatConvEquation::itsConv
protected

Definition at line 182 of file LatConvEquation.h.

casacore::Lattice<casacore::Float>* casa::LatConvEquation::itsMeas
protected

Definition at line 180 of file LatConvEquation.h.

casacore::Lattice<casacore::Float>* casa::LatConvEquation::itsPsf
protected

Definition at line 181 of file LatConvEquation.h.

casacore::IPosition casa::LatConvEquation::itsPsfOrigin
protected

Definition at line 183 of file LatConvEquation.h.

casacore::IPosition casa::LatConvEquation::itsRealPsfSize
protected

Definition at line 184 of file LatConvEquation.h.

casacore::Bool casa::LatConvEquation::itsVirgin
protected

Definition at line 185 of file LatConvEquation.h.


The documentation for this class was generated from the following file: