Go to the documentation of this file.
52 #ifndef __PCL_PSFFit_h
53 #define __PCL_PSFFit_h
58 #include <pcl/Diagnostics.h>
125 namespace PSFFitStatus
151 using psf_function = PSFunction::value_type;
156 using psf_fit_status = PSFFitStatus::value_type;
164 psf_function
function = PSFunction::Invalid;
166 psf_fit_status
status = PSFFitStatus::NotFitted;
212 operator bool()
const
214 return status == PSFFitStatus::FittedOk;
222 operator double()
const
235 return (i == 0) ?
c0.
x :
c0.
y;
382 static double FWHM( psf_function
function,
double sigma,
double beta = 2 )
384 PCL_PRECONDITION(
beta > 0 )
387 case PSFunction::Gaussian:
return 2.3548200450309493 * sigma;
388 case PSFunction::Moffat:
return 2 * sigma *
Sqrt(
Pow2( 1/
beta ) - 1 );
389 case PSFunction::MoffatA:
return 0.5358113941912513 * sigma;
390 case PSFunction::Moffat8:
return 0.6016900619596693 * sigma;
391 case PSFunction::Moffat6:
return 0.6998915581984769 * sigma;
392 case PSFunction::Moffat4:
return 0.8699588840921645 * sigma;
393 case PSFunction::Moffat25:
return 1.1305006161394060 * sigma;
394 case PSFunction::Moffat15:
return 1.5328418730817597 * sigma;
395 case PSFunction::Lorentzian:
return 2 * sigma;
396 case PSFunction::VariableShape:
return 2 * sigma *
Pow(
beta*0.6931471805599453, 1/
beta );
416 static double FWTM( psf_function
function,
double sigma,
double beta = 2 )
418 PCL_PRECONDITION(
beta > 0 )
421 case PSFunction::Gaussian:
return 4.291932052578694 * sigma;
422 case PSFunction::Moffat:
return 2 * sigma *
Sqrt(
Pow( 10.0, 1/
beta ) - 1 );
423 case PSFunction::MoffatA:
return 1.017694279819175 * sigma;
424 case PSFunction::Moffat8:
return 1.155026289161115 * sigma;
425 case PSFunction::Moffat6:
return 1.367917055412454 * sigma;
426 case PSFunction::Moffat4:
return 1.764402913213331 * sigma;
427 case PSFunction::Moffat25:
return 2.459175822514185 * sigma;
428 case PSFunction::Moffat15:
return 3.816589489904712 * sigma;
429 case PSFunction::Lorentzian:
return 6 * sigma;
430 case PSFunction::VariableShape:
return 2 * sigma *
Pow(
beta*2.302585092994045, 1/
beta );
456 static double Volume( psf_function
function,
double sigma_x,
double sigma_y,
double beta = 2 )
458 PCL_PRECONDITION(
beta > 0 )
459 PCL_PRECONDITION(
function != PSFunction::Lorentzian && (
function != PSFunction::Moffat ||
beta > 1) )
462 case PSFunction::Gaussian:
return 6.2831853071795862 * sigma_x*sigma_y;
463 case PSFunction::Moffat:
return 3.1415926535897931 * sigma_x*sigma_y/(
beta - 1);
464 case PSFunction::MoffatA:
return 0.3490658503988659 * sigma_x*sigma_y;
465 case PSFunction::Moffat8:
return 0.4487989505128276 * sigma_x*sigma_y;
466 case PSFunction::Moffat6:
return 0.6283185307179586 * sigma_x*sigma_y;
467 case PSFunction::Moffat4:
return 1.0471975511965976 * sigma_x*sigma_y;
468 case PSFunction::Moffat25:
return 2.0943951023931953 * sigma_x*sigma_y;
469 case PSFunction::Moffat15:
return 6.2831853071795862 * sigma_x*sigma_y;
569 psf_function
function = PSFunction::Gaussian,
bool circular =
false,
570 float betaMin = 1.0F,
float betaMax = 4.0F,
571 double tolerance = 1.0e-08,
float bkgMaxVar = 0.1F,
float growthForFlux = 1.0F );
597 operator bool()
const
615 float m_growthForFlux = 1.0F;
619 mutable float m_beta;
623 friend class PSFFitEngine;
630 #endif // __PCL_PSFFit_h
double A
Function amplitude (or estimated maximum) in pixel value units.
String StatusText() const
PSFFit(const ImageVariant &image, const DPoint ¢er, const DRect &rect, psf_function function=PSFunction::Gaussian, bool circular=false, float betaMin=1.0F, float betaMax=4.0F, double tolerance=1.0e-08, float bkgMaxVar=0.1F, float growthForFlux=1.0F)
static double FWTM(psf_function function, double sigma, double beta=2)
double theta
Rotation angle of the sx axis in degrees, in the [0,180) range.
constexpr const T & Max(const T &a, const T &b) noexcept
A generic point in the two-dimensional space.
Generic dynamic matrix of arbitrary dimensions.
static double Volume(psf_function function, double sigma_x, double sigma_y, double beta=2)
double sx
Function width in pixels on the X axis, sx >= sy.
PSFFit & operator=(const PSFFit &x)=default
double operator[](int i) const noexcept
PSFunction::value_type psf_function
DPoint q0
Centroid equatorial coordinates, when celestial=true.
void ToImage(Image &) const
Complex< T1 > Pow(const Complex< T1 > &c, T2 x) noexcept
DPoint::component component
double flux
Total flux above the local background, measured over the rectangular fitting region.
bool celestial
True iff equatorial coordinates are available.
double beta
Moffat beta or shape parameter (dimensionless).
bool circular
Circular or elliptical PSF.
DPoint c0
Fitted centroid position in image coordinates.
A generic rectangle in the two-dimensional space.
PSFFitStatus::value_type psf_fit_status
bool HasCelestialCoordinates() const
Complex< T > Sqrt(const Complex< T > &c) noexcept
static double FWHM(psf_function function, double sigma, double beta=2)
double B
Local background estimate in pixel value units.
component x
Abscissa (horizontal, or X-axis coordinate).
double signal
Total flux above the local background, measured over the elliptical PSF region.
DPoint b0
Barycenter position (initial star detection position) in image coordinates.
double sy
Function width in pixels on the Y axis, sx >= sy.
unsigned signalCount
Number of pixels used for signal evaluation.
PSFData & operator=(const PSFData &)=default
Numerical Point Spread Function (PSF) fit to a source in an image.
component y
Ordinate (vertical, or Y-axis coordinate).
constexpr T Pow2(T x) noexcept
String FunctionName() const
Acts like a union for all types of images in PCL, with optional class-wide ownership of transported i...
PSFData::psf_function psf_function
Implements a generic, two-dimensional, shared or local image.
psf_fit_status status
Status code (PSFFitStatus namespace).