mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::improc::imCenterRadon< transformT > Struct Template Reference

template<typename transformT>
struct mx::improc::imCenterRadon< transformT >

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.

Template Parameters
realTis 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...
 

Member Function Documentation

◆ center()

template<typename transformT >
int mx::improc::imCenterRadon< transformT >::center ( realT &  x,
realT &  y,
eigenImage< realT > &  im,
realT  x0,
realT  y0 
)
inline

Peform the grid search and fit.

Parameters
[out]xthe x-coordinate of the estimated center of rotational symmetry
[out]ythe y-coordinate estimated center of rotational symmetry
[in]imthe image to centroid
[in]x0an initial guess at the x-coordinate, the grid is centered about this point.
[in]y0an 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().

◆ dumpResults() [1/2]

template<typename transformT >
template<char comment = '#'>
std::ostream& mx::improc::imCenterRadon< transformT >::dumpResults ( )
inline

Output the results to std::cout.

Prints a result summary to std::cout

Template Parameters
commentis a comment character to start each line. Can be '\0'.

Definition at line 237 of file imCenterRadon.hpp.

◆ dumpResults() [2/2]

template<typename transformT >
template<typename iosT , char comment = '#'>
iosT& mx::improc::imCenterRadon< transformT >::dumpResults ( iosT &  ios)
inline

◆ fitGrid()

template<typename transformT >
int mx::improc::imCenterRadon< transformT >::fitGrid ( realT &  x,
realT &  y,
eigenImage< realT >  grid 
)
inline

Fit the transform grid.

A separate function for testing, does not normally need to be called independently

Todo:
This needs to be able to handle highly non-symmetric peaks much better.
Parameters
[out]xthe x-coordinate of the estimated center of rotational symmetry
[out]ythe 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().

Member Data Documentation

◆ m_angTolPix

template<typename transformT >
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().

◆ m_dPix

template<typename transformT >
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().

◆ m_dRad

template<typename transformT >
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().

◆ m_fit

template<typename transformT >
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().

◆ m_grid

template<typename transformT >
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().

◆ m_guessWidth

template<typename transformT >
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().

◆ m_maxPix

template<typename transformT >
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().

◆ m_maxRad

template<typename transformT >
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().

◆ m_minRad

template<typename transformT >
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().

◆ m_peakTol

template<typename transformT >
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().

◆ m_x0

template<typename transformT >
realT mx::improc::imCenterRadon< transformT >::m_x0

◆ m_y0

template<typename transformT >
realT mx::improc::imCenterRadon< transformT >::m_y0

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