PCL
pcl::PSFData Class Reference

PSF fit parameters. More...

#include <PSFFit.h>

Public Types

using component = DPoint::component
 
using psf_fit_status = PSFFitStatus::value_type
 
using psf_function = PSFunction::value_type
 

Public Member Functions

 PSFData ()=default
 
 PSFData (const PSFData &)=default
 
 PSFData (PSFData &&)=default
 
DRect Bounds () const
 
String FunctionName () const
 
double FWHMx () const
 
double FWHMy () const
 
DRect FWTMBounds () const
 
double FWTMx () const
 
double FWTMy () const
 
bool HasCelestialCoordinates () const
 
 operator bool () const
 
 operator double () const
 
PSFDataoperator= (const PSFData &)=default
 
PSFDataoperator= (PSFData &&)=default
 
double operator[] (int i) const noexcept
 
String StatusText () const
 
void ToImage (Image &) const
 
double Volume () const
 

Static Public Member Functions

static double FWHM (psf_function function, double sigma, double beta=2)
 
static double FWTM (psf_function function, double sigma, double beta=2)
 
static double Volume (psf_function function, double sigma_x, double sigma_y, double beta=2)
 

Public Attributes

double A = 0
 Function amplitude (or estimated maximum) in pixel value units.
 
double B = 0
 Local background estimate in pixel value units.
 
DPoint b0 = 0.0
 Barycenter position (initial star detection position) in image coordinates.
 
double beta = 0
 Moffat beta or shape parameter (dimensionless).
 
DPoint c0 = 0.0
 Fitted centroid position in image coordinates.
 
bool celestial = false
 True iff equatorial coordinates are available.
 
bool circular = false
 Circular or elliptical PSF.
 
double flux = 0
 Total flux above the local background, measured over the rectangular fitting region.
 
psf_function function = PSFunction::Invalid
 Point spread function type (PSFunction namespace).
 
double mad = 0
 
DPoint q0 = 0.0
 Centroid equatorial coordinates, when celestial=true.
 
double signal = 0
 Total flux above the local background, measured over the elliptical PSF region.
 
unsigned signalCount = 0
 Number of pixels used for signal evaluation.
 
psf_fit_status status = PSFFitStatus::NotFitted
 Status code (PSFFitStatus namespace).
 
double sx = 0
 Function width in pixels on the X axis, sx >= sy.
 
double sy = 0
 Function width in pixels on the Y axis, sx >= sy.
 
double theta = 0
 Rotation angle of the sx axis in degrees, in the [0,180) range.
 

Detailed Description

Definition at line 146 of file PSFFit.h.

Member Typedef Documentation

◆ component

Represents a component of a centroid position vector (required for QuadTree compatibility).

Definition at line 162 of file PSFFit.h.

◆ psf_fit_status

using pcl::PSFData::psf_fit_status = PSFFitStatus::value_type

Represents a PSF fitting process status.

Definition at line 156 of file PSFFit.h.

◆ psf_function

using pcl::PSFData::psf_function = PSFunction::value_type

Represents a point spread function type.

Definition at line 151 of file PSFFit.h.

Constructor & Destructor Documentation

◆ PSFData() [1/3]

pcl::PSFData::PSFData ( )
default

Default constructor.

◆ PSFData() [2/3]

pcl::PSFData::PSFData ( const PSFData )
default

Copy constructor.

◆ PSFData() [3/3]

pcl::PSFData::PSFData ( PSFData &&  )
default

Move constructor.

Member Function Documentation

◆ Bounds()

DRect pcl::PSFData::Bounds ( ) const
inline

Returns the PSF bounding rectangle. The coordinates of the bounding rectangle r are calculated as follows:

r.x0 = c0.x - d
r.y0 = c0.y - d
r.x1 = c0.x + d
r.y1 = c0.y + d
where d is equal to:

FWHMx()/2 for a circular PSF,
Max( FWHMx(), FWHMy() )/2 for an elliptic PSF.

Definition at line 324 of file PSFFit.h.

References c0, circular, FWHMx(), FWHMy(), pcl::Max(), pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ FunctionName()

String pcl::PSFData::FunctionName ( ) const

Returns the name of the fitted PSF function. See the PSFunction namespace for supported functions.

◆ FWHM()

static double pcl::PSFData::FWHM ( psf_function  function,
double  sigma,
double  beta = 2 
)
inlinestatic

Returns the full width at half maximum (FWHM) corresponding to a supported function with the specified parameters.

Parameters
functionThe type of point spread function. See the PSFunction namespace for supported functions.
sigmaEstimated function width.
betaMoffat beta or VariableShape shape parameter. Must be > 0.

The returned value is the FWHM in sigma units, or zero if an invalid or unsupported function type has been specified.

Definition at line 382 of file PSFFit.h.

References beta, pcl::Pow(), pcl::Pow2(), and pcl::Sqrt().

Referenced by FWHMx(), and FWHMy().

◆ FWHMx()

double pcl::PSFData::FWHMx ( ) const
inline

Returns the full width at half maximum (FWHM) on the X axis in pixels.

For an elliptic PSF, the X axis corresponds to the orientation of the major function axis as projected on the image.

For a circular PSF, FWHMx() and FWHMy() are equivalent.

Definition at line 257 of file PSFFit.h.

References beta, FWHM(), and sx.

Referenced by Bounds(), and FWTMBounds().

◆ FWHMy()

double pcl::PSFData::FWHMy ( ) const
inline

Returns the full width at half maximum (FWHM) on the Y axis in pixels.

For an elliptic PSF, the Y axis corresponds to the orientation of the minor function axis as projected on the image.

For a circular PSF, FWHMx() and FWHMy() are equivalent.

Definition at line 270 of file PSFFit.h.

References beta, FWHM(), and sy.

Referenced by Bounds(), and FWTMBounds().

◆ FWTM()

static double pcl::PSFData::FWTM ( psf_function  function,
double  sigma,
double  beta = 2 
)
inlinestatic

Returns the full width at tenth maximum (FWTM) corresponding to a supported function with the specified parameters.

Parameters
functionThe type of point spread function. See the PSFunction namespace for supported functions.
sigmaEstimated function width.
betaMoffat beta or VariableShape shape parameter. Must be > 0.

The returned value is the FWTM in sigma units, or zero if an invalid or unsupported function type has been specified.

Definition at line 416 of file PSFFit.h.

References beta, pcl::Pow(), and pcl::Sqrt().

Referenced by FWTMx(), and FWTMy().

◆ FWTMBounds()

DRect pcl::PSFData::FWTMBounds ( ) const
inline

Returns the PSF bounding rectangle corresponding to the full width at tenth maximum (FWTM). The coordinates of the bounding rectangle r are calculated as follows:

r.x0 = c0.x - d
r.y0 = c0.y - d
r.x1 = c0.x + d
r.y1 = c0.y + d
where d is equal to:

FWTMx()/2 for a circular PSF,
Max( FWTMx(), FWTMy() )/2 for an elliptic PSF.

Definition at line 345 of file PSFFit.h.

References c0, circular, FWHMx(), FWHMy(), pcl::Max(), pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ FWTMx()

double pcl::PSFData::FWTMx ( ) const
inline

Returns the full width at tenth maximum (FWTM) on the X axis in pixels.

For an elliptic PSF, the X axis corresponds to the orientation of the major function axis as projected on the image.

For a circular PSF, FWTMx() and FWTMy() are equivalent.

Definition at line 283 of file PSFFit.h.

References beta, FWTM(), and sx.

◆ FWTMy()

double pcl::PSFData::FWTMy ( ) const
inline

Returns the full width at tenth maximum (FWTM) on the Y axis in pixels.

For an elliptic PSF, the Y axis corresponds to the orientation of the minor function axis as projected on the image.

For a circular PSF, FWTMx() and FWTMy() are equivalent.

Definition at line 296 of file PSFFit.h.

References beta, FWTM(), and sy.

◆ HasCelestialCoordinates()

bool pcl::PSFData::HasCelestialCoordinates ( ) const
inline

Returns true iff this object contains valid equatorial coordinates computed by an astrometric solution of the image for the centroid coordinates.

Definition at line 356 of file PSFFit.h.

References celestial.

◆ operator bool()

pcl::PSFData::operator bool ( ) const
inline

Returns true iff this object contained valid PSF fitting parameters. This happens (or should happen, under normal conditions) when the status data member is equal to PSFFitStatus::FittedOk.

Definition at line 212 of file PSFFit.h.

References status.

◆ operator double()

pcl::PSFData::operator double ( ) const
inline

Conversion to double operator. Returns the PSF signal estimate if nonzero, or the total flux otherwise. Useful for sorting and statistics calculations.

Definition at line 222 of file PSFFit.h.

References flux, and signal.

◆ operator=() [1/2]

PSFData& pcl::PSFData::operator= ( const PSFData )
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

PSFData& pcl::PSFData::operator= ( PSFData &&  )
default

Move assignment operator. Returns a reference to this object.

◆ operator[]()

double pcl::PSFData::operator[] ( int  i) const
inlinenoexcept

Returns a centroid coordinate. Returns the X centroid coordinate if the specified index i is zero, or the Y coordinate otherwise.

Note
This operator provides compatibility with the QuadTree class.

Definition at line 233 of file PSFFit.h.

References c0, pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ StatusText()

String pcl::PSFData::StatusText ( ) const

Returns a string with a brief description of the current fitting status.

◆ ToImage()

void pcl::PSFData::ToImage ( Image ) const

Returns an image representation (in 32-bit floating point format) of the fitted point spread function.

◆ Volume() [1/2]

double pcl::PSFData::Volume ( ) const
inline

Returns the double integral of the PSF, or the estimated volume over the XY plane for z > B.

Definition at line 305 of file PSFFit.h.

References A, beta, sx, and sy.

◆ Volume() [2/2]

static double pcl::PSFData::Volume ( psf_function  function,
double  sigma_x,
double  sigma_y,
double  beta = 2 
)
inlinestatic

Returns the double integral of a supported elliptical function with the specified parameters.

Parameters
functionThe type of point spread function. See the PSFunction namespace for supported functions.
sigma_xEstimated function width on the X axis.
sigma_yEstimated function width on the Y axis.
betaMoffat beta or VariableShape shape parameter. Must be > 0. Must be > 1 for Moffat functions.

The returned value is the volume of the PSF over the XY plane, or zero if an invalid or unsupported function type has been specified, or if the beta parameter is invalid for the type of PSF specified.

Note
The volume under a Lorentzian function (β = 1) is undefined, since the denominator of the double integral equation is β - 1 = 0.

Definition at line 456 of file PSFFit.h.

References beta.

Member Data Documentation

◆ mad

double pcl::PSFData::mad = 0

Goodness of fit estimate. A robust, mean absolute difference between the fitted PSF and the sample of source image pixels over the fitting region.

Definition at line 180 of file PSFFit.h.


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