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 52 of file imCenterRadon.hpp.
#include <improc/imCenterRadon.hpp>
Public Member Functions | |
int | center (realT &x, realT &y, eigenImage< realT > &im, realT x0, realT y0) |
Peform the grid search and fit. More... | |
int | fitGrid (realT &x, realT &y, eigenImage< realT > grid) |
Fit the transform grid. 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 > | m_grid |
The cost grid. More... | |
realT | m_maxPix {2} |
The maximum range of the grid search, the grid will be +/- maxPix. Default: 5.0. More... | |
realT | m_dPix {0.1} |
The spacing of the points in the grid search. Default: 0.1. More... | |
realT | m_peakTol {0.1} |
The tolerance for the peak finding. This is multiplicative with m_dPix. More... | |
realT | m_minRad {1.0} |
The minimum radius to include in the transform. Default: 1.0. More... | |
realT | m_maxRad {10} |
The maximum radius to include in the transform. Default: 10.0. More... | |
realT | m_dRad {0.1} |
The spacing of the radii. Default: 0.1. More... | |
realT | m_angTolPix {1.0} |
The angle tolerance in pixels at the maximum radius, sets the angular step size. Default is 1.0. More... | |
realT | m_guessWidth {0.5} |
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 > | m_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 | m_x0 |
Internal storage of the guess center position. More... | |
realT | m_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 84 of file imCenterRadon.hpp.
References mx::improc::imCenterRadon< transformT >::fitGrid(), mx::improc::imCenterRadon< transformT >::m_dPix, mx::improc::imCenterRadon< transformT >::m_dRad, mx::improc::imCenterRadon< transformT >::m_grid, mx::improc::imCenterRadon< transformT >::m_maxPix, mx::improc::imCenterRadon< transformT >::m_maxRad, mx::improc::imCenterRadon< transformT >::m_minRad, mx::improc::imCenterRadon< transformT >::m_x0, mx::improc::imCenterRadon< transformT >::m_y0, and mx::math::rtod().
|
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 237 of file imCenterRadon.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 203 of file imCenterRadon.hpp.
References mx::astro::constants::c(), mx::improc::imCenterRadon< transformT >::m_angTolPix, mx::improc::imCenterRadon< transformT >::m_dPix, mx::improc::imCenterRadon< transformT >::m_dRad, mx::improc::imCenterRadon< transformT >::m_fit, mx::improc::imCenterRadon< transformT >::m_guessWidth, mx::improc::imCenterRadon< transformT >::m_maxPix, mx::improc::imCenterRadon< transformT >::m_maxRad, mx::improc::imCenterRadon< transformT >::m_minRad, mx::improc::imCenterRadon< transformT >::m_x0, and mx::improc::imCenterRadon< transformT >::m_y0.
|
inline |
Fit the transform grid.
A separate function for testing, does not normally need to be called independently
[out] | x | the x-coordinate of the estimated center of rotational symmetry |
[out] | y | the y-coordinate estimated center of rotational symmetry |
Definition at line 160 of file imCenterRadon.hpp.
References mx::improc::imCenterRadon< transformT >::m_dPix, mx::improc::imCenterRadon< transformT >::m_fit, mx::improc::imCenterRadon< transformT >::m_guessWidth, mx::improc::imCenterRadon< transformT >::m_maxPix, mx::improc::imCenterRadon< transformT >::m_peakTol, mx::improc::imCenterRadon< transformT >::m_x0, and mx::improc::imCenterRadon< transformT >::m_y0.
Referenced by mx::improc::imCenterRadon< transformT >::center().
realT mx::improc::imCenterRadon< transformT >::m_angTolPix {1.0} |
The angle tolerance in pixels at the maximum radius, sets the angular step size. Default is 1.0.
Definition at line 67 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::dumpResults().
realT mx::improc::imCenterRadon< transformT >::m_dPix {0.1} |
The spacing of the points in the grid search. Default: 0.1.
Definition at line 60 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center(), mx::improc::imCenterRadon< transformT >::dumpResults(), and mx::improc::imCenterRadon< transformT >::fitGrid().
realT mx::improc::imCenterRadon< transformT >::m_dRad {0.1} |
The spacing of the radii. Default: 0.1.
Definition at line 65 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center(), and mx::improc::imCenterRadon< transformT >::dumpResults().
mx::math::fit::fitGaussian2Dgen<realT> mx::improc::imCenterRadon< transformT >::m_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 73 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::dumpResults(), and mx::improc::imCenterRadon< transformT >::fitGrid().
eigenImage<realT> mx::improc::imCenterRadon< transformT >::m_grid |
The cost grid.
Definition at line 57 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center().
realT mx::improc::imCenterRadon< transformT >::m_guessWidth {0.5} |
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 69 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::dumpResults(), and mx::improc::imCenterRadon< transformT >::fitGrid().
realT mx::improc::imCenterRadon< transformT >::m_maxPix {2} |
The maximum range of the grid search, the grid will be +/- maxPix. Default: 5.0.
Definition at line 59 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center(), mx::improc::imCenterRadon< transformT >::dumpResults(), and mx::improc::imCenterRadon< transformT >::fitGrid().
realT mx::improc::imCenterRadon< transformT >::m_maxRad {10} |
The maximum radius to include in the transform. Default: 10.0.
Definition at line 64 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center(), and mx::improc::imCenterRadon< transformT >::dumpResults().
realT mx::improc::imCenterRadon< transformT >::m_minRad {1.0} |
The minimum radius to include in the transform. Default: 1.0.
Definition at line 63 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center(), and mx::improc::imCenterRadon< transformT >::dumpResults().
realT mx::improc::imCenterRadon< transformT >::m_peakTol {0.1} |
The tolerance for the peak finding. This is multiplicative with m_dPix.
Definition at line 61 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::fitGrid().
realT mx::improc::imCenterRadon< transformT >::m_x0 |
Internal storage of the guess center position.
Definition at line 75 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center(), mx::improc::imCenterRadon< transformT >::dumpResults(), and mx::improc::imCenterRadon< transformT >::fitGrid().
realT mx::improc::imCenterRadon< transformT >::m_y0 |
Internal storage of the guess center position.
Definition at line 76 of file imCenterRadon.hpp.
Referenced by mx::improc::imCenterRadon< transformT >::center(), mx::improc::imCenterRadon< transformT >::dumpResults(), and mx::improc::imCenterRadon< transformT >::fitGrid().