mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Find the center of the image of a point source using circular symmetry of the PSF.
Conducts a grid search through possible center positions. Finds the point with the minimum total variance around concentric circles about that point. The cost grid is fit with a Gaussian.
realT | is a real floating point type. |
Definition at line 51 of file imCenterCircleSym.hpp.
#include <improc/imCenterCircleSym.hpp>
Public Member Functions | |
int | init (realT maxP, realT dP, realT minR, realT maxR, realT dR) |
Initialize the grid. More... | |
int | center (realT &x, realT &y, eigenImage< realT > &im, realT x0, realT y0) |
Peform the grid search and fit. More... | |
template<typename iosT , char comment = '#'> | |
iosT & | dumpResults (iosT &ios) |
Output the results to a stream. More... | |
template<char comment = '#'> | |
std::ostream & | dumpResults () |
Output the results to std::cout. More... | |
Public Attributes | |
eigenImage< realT > * | mask |
An optional pointer to a mask. If not NULL and the same size as the input image, any 0 pixels in this image are ignored. More... | |
eigenImage< realT > | grid |
The cost grid. More... | |
eigenImage< realT > | smGrid |
The smoothed cost grid. More... | |
realT | maxPix |
The maximum range of the grid search, the grid will be +/- maxPix. Default: 5.0. More... | |
realT | dPix |
The spacing of the points in the grid search. Default: 0.1. More... | |
realT | minRad |
The minimum radius to include in the cost function. Default: 1.0. More... | |
realT | maxRad |
The maximum radius to include in the cost function Default: 20.0. More... | |
realT | dRad |
The spacing of the radii. Default: 1.0. More... | |
realT | smWidth |
FWHM of the Guassian smoothing kernel. Default is 10 (seems to work well regardless of dPix). Set to 0 for no smoothing. More... | |
realT | guessWidth |
Guess in original pixels for the FWHM of the cost grid. Default is 0.5, which seems to work well in most cases. More... | |
mx::math::fit::fitGaussian2Dgen< realT > | fit |
The fitter for finding the centroid of the grid. You can use this to inspect the details of the fit if desired. More... | |
realT | _x0 |
Internal storage of the guess center position. More... | |
realT | _y0 |
Internal storage of the guess center position. More... | |
|
inline |
Peform the grid search and fit.
[out] | x | the x-coordinate of the estimated center of rotational symmetry |
[out] | y | the y-coordinate estimated center of rotational symmetry |
[in] | im | the image to centroid |
[in] | x0 | an initial guess at the x-coordinate, the grid is centered about this point. |
[in] | y0 | an initial guess at the y-coordinate, the grid is centered about this point. |
Definition at line 106 of file imCenterCircleSym.hpp.
References mx::improc::imCenterCircleSym< realT >::_x0, mx::improc::imCenterCircleSym< realT >::_y0, mx::improc::imCenterCircleSym< realT >::dPix, mx::improc::imCenterCircleSym< realT >::dRad, mx::improc::filterImage(), mx::improc::imCenterCircleSym< realT >::fit, mx::improc::imCenterCircleSym< realT >::grid, mx::improc::imCenterCircleSym< realT >::guessWidth, mx::astro::constants::k(), mx::improc::imCenterCircleSym< realT >::mask, mx::improc::imCenterCircleSym< realT >::maxPix, mx::improc::imCenterCircleSym< realT >::maxRad, mx::improc::imCenterCircleSym< realT >::minRad, mx::improc::imCenterCircleSym< realT >::smGrid, mx::improc::imCenterCircleSym< realT >::smWidth, mx::math::vectorMean(), and mx::math::vectorVariance().
|
inline |
Output the results to std::cout.
Prints a result summary to std::cout
comment | is a comment character to start each line. Can be '\0'. |
Definition at line 264 of file imCenterCircleSym.hpp.
|
inline |
Output the results to a stream.
Prints a result summary to the input stream.
iosT | is a std::ostream-like type. |
comment | is a comment character to start each line. Can be '\0'. |
Definition at line 230 of file imCenterCircleSym.hpp.
References mx::improc::imCenterCircleSym< realT >::_x0, mx::improc::imCenterCircleSym< realT >::_y0, mx::astro::constants::c(), mx::improc::imCenterCircleSym< realT >::dPix, mx::improc::imCenterCircleSym< realT >::dRad, mx::improc::imCenterCircleSym< realT >::fit, mx::improc::imCenterCircleSym< realT >::guessWidth, mx::improc::imCenterCircleSym< realT >::maxPix, mx::improc::imCenterCircleSym< realT >::maxRad, mx::improc::imCenterCircleSym< realT >::minRad, mx::math::func::sigma2fwhm(), and mx::improc::imCenterCircleSym< realT >::smWidth.
|
inline |
Initialize the grid.
[in] | maxP | the new value of maxPix |
[in] | dP | the new value of dPix |
[in] | minR | the new value of minRad |
[in] | maxR | the new value of maxRad |
[in] | dR | the new value of dRad |
Definition at line 90 of file imCenterCircleSym.hpp.
References mx::improc::imCenterCircleSym< realT >::dPix, mx::improc::imCenterCircleSym< realT >::dRad, mx::improc::imCenterCircleSym< realT >::maxPix, mx::improc::imCenterCircleSym< realT >::maxRad, and mx::improc::imCenterCircleSym< realT >::minRad.
realT mx::improc::imCenterCircleSym< realT >::_x0 |
Internal storage of the guess center position.
Definition at line 74 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), and mx::improc::imCenterCircleSym< realT >::dumpResults().
realT mx::improc::imCenterCircleSym< realT >::_y0 |
Internal storage of the guess center position.
Definition at line 75 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), and mx::improc::imCenterCircleSym< realT >::dumpResults().
realT mx::improc::imCenterCircleSym< realT >::dPix |
The spacing of the points in the grid search. Default: 0.1.
Definition at line 61 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), mx::improc::imCenterCircleSym< realT >::dumpResults(), and mx::improc::imCenterCircleSym< realT >::init().
realT mx::improc::imCenterCircleSym< realT >::dRad |
The spacing of the radii. Default: 1.0.
Definition at line 65 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), mx::improc::imCenterCircleSym< realT >::dumpResults(), and mx::improc::imCenterCircleSym< realT >::init().
mx::math::fit::fitGaussian2Dgen<realT> mx::improc::imCenterCircleSym< realT >::fit |
The fitter for finding the centroid of the grid. You can use this to inspect the details of the fit if desired.
Definition at line 72 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), and mx::improc::imCenterCircleSym< realT >::dumpResults().
eigenImage<realT> mx::improc::imCenterCircleSym< realT >::grid |
The cost grid.
Definition at line 56 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center().
realT mx::improc::imCenterCircleSym< realT >::guessWidth |
Guess in original pixels for the FWHM of the cost grid. Default is 0.5, which seems to work well in most cases.
Definition at line 68 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), and mx::improc::imCenterCircleSym< realT >::dumpResults().
eigenImage<realT>* mx::improc::imCenterCircleSym< realT >::mask |
An optional pointer to a mask. If not NULL and the same size as the input image, any 0 pixels in this image are ignored.
Definition at line 54 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center().
realT mx::improc::imCenterCircleSym< realT >::maxPix |
The maximum range of the grid search, the grid will be +/- maxPix. Default: 5.0.
Definition at line 60 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), mx::improc::imCenterCircleSym< realT >::dumpResults(), and mx::improc::imCenterCircleSym< realT >::init().
realT mx::improc::imCenterCircleSym< realT >::maxRad |
The maximum radius to include in the cost function Default: 20.0.
Definition at line 64 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), mx::improc::imCenterCircleSym< realT >::dumpResults(), and mx::improc::imCenterCircleSym< realT >::init().
realT mx::improc::imCenterCircleSym< realT >::minRad |
The minimum radius to include in the cost function. Default: 1.0.
Definition at line 63 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), mx::improc::imCenterCircleSym< realT >::dumpResults(), and mx::improc::imCenterCircleSym< realT >::init().
eigenImage<realT> mx::improc::imCenterCircleSym< realT >::smGrid |
The smoothed cost grid.
Definition at line 57 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center().
realT mx::improc::imCenterCircleSym< realT >::smWidth |
FWHM of the Guassian smoothing kernel. Default is 10 (seems to work well regardless of dPix). Set to 0 for no smoothing.
Definition at line 67 of file imCenterCircleSym.hpp.
Referenced by mx::improc::imCenterCircleSym< realT >::center(), and mx::improc::imCenterCircleSym< realT >::dumpResults().