SourceXtractorPlusPlus
0.11
Please provide a description of the project.
|
Implements a variable PSF using an arbitrary number of components (i.e. X, Y), and degrees. More...
#include <VariablePsf.h>
Classes | |
struct | Component |
Public Member Functions | |
VariablePsf (double pixel_sampling, const std::vector< Component > &components, const std::vector< int > &group_degrees, const std::vector< std::shared_ptr< VectorImage< SeFloat >>> &coefficients) | |
VariablePsf (double pixel_sampling, const std::shared_ptr< VectorImage< SeFloat >> &constant) | |
virtual | ~VariablePsf ()=default |
int | getWidth () const |
int | getHeight () const |
double | getPixelSampling () const |
const std::vector< Component > & | getComponents () const |
std::shared_ptr< VectorImage< SeFloat > > | getPsf (const std::vector< double > &values) const |
Private Member Functions | |
void | selfTest () |
Verify that the preconditions of getPsf are met at construction time. More... | |
std::vector< double > | scaleProperties (const std::vector< double > &values) const |
Normalizes the values. More... | |
void | calculateExponents () |
Private Attributes | |
double | m_pixel_sampling |
std::vector< Component > | m_components |
std::vector< int > | m_group_degrees |
std::vector< std::shared_ptr< VectorImage< SeFloat > > > | m_coefficients |
std::vector< std::vector< int > > | m_exponents |
Implements a variable PSF using an arbitrary number of components (i.e. X, Y), and degrees.
It is based on SExtractor logic, so based on a polynomial where the variables are some attributes of a source. For instance, if the components were X and Y, both in the same group, and the degree 2, the polynomial would be
\f$C + X + X^2 + XY + Y + Y^2\f$
The coefficients must be given on that order (note that the constant would be the first element)
Definition at line 49 of file VariablePsf.h.
SourceXtractor::VariablePsf::VariablePsf | ( | double | pixel_sampling, |
const std::vector< Component > & | components, | ||
const std::vector< int > & | group_degrees, | ||
const std::vector< std::shared_ptr< VectorImage< SeFloat >>> & | coefficients | ||
) |
Constructor
pixel_sampling | Unused by the class itself, it is an attribute of the PSF. It is the sampling step size of the PSF on image pixels. i.e. a value of 0.5 means that a PSF pixel has been sampled every 0.5 pixels on the corresponding image. |
components | List of components (or variables) to be used by the Variable PSF |
group_degrees | Polynomial degree. Each group has its own degree, so there has to be as many as different group_id there are on the components |
Definition at line 31 of file VariablePsf.cpp.
References calculateExponents(), and selfTest().
SourceXtractor::VariablePsf::VariablePsf | ( | double | pixel_sampling, |
const std::shared_ptr< VectorImage< SeFloat >> & | constant | ||
) |
Convenience constructor that initializes the variable PSF with just a constant value (So it is not variable anymore)
Definition at line 40 of file VariablePsf.cpp.
|
virtualdefault |
Destructor
|
private |
Calculates the exponents for each component per term of the polynomial.
For instance, for (X, Y) degree 2, this would generate the matrix
Definition at line 152 of file VariablePsf.cpp.
References std::vector< T >::begin(), e, std::vector< T >::end(), std::exp(), m_coefficients, m_components, m_exponents, m_group_degrees, and std::vector< T >::resize().
Referenced by VariablePsf().
const std::vector< VariablePsf::Component > & SourceXtractor::VariablePsf::getComponents | ( | ) | const |
Definition at line 59 of file VariablePsf.cpp.
References m_components.
Referenced by TestImage::mainMethod().
int SourceXtractor::VariablePsf::getHeight | ( | ) | const |
Definition at line 51 of file VariablePsf.cpp.
References m_coefficients.
Referenced by getPsf(), and TestImage::mainMethod().
double SourceXtractor::VariablePsf::getPixelSampling | ( | ) | const |
Definition at line 55 of file VariablePsf.cpp.
References m_pixel_sampling.
Referenced by TestImage::mainMethod().
std::shared_ptr< VectorImage< SeFloat > > SourceXtractor::VariablePsf::getPsf | ( | const std::vector< double > & | values | ) | const |
Reconstructs a PSF based on the given values for each of the component.
values | Component values. Note that they have to be in the same order (and as many) as components were passed to the constructor (none for constant PSF). |
If | the number of values does not match the number of components |
Definition at line 63 of file VariablePsf.cpp.
References SourceXtractor::VectorImage< T >::create(), std::exp(), getHeight(), getWidth(), m_coefficients, m_exponents, std::pow(), scaleProperties(), x, and y.
Referenced by TestImage::mainMethod().
int SourceXtractor::VariablePsf::getWidth | ( | ) | const |
Definition at line 47 of file VariablePsf.cpp.
References m_coefficients.
Referenced by getPsf(), and TestImage::mainMethod().
|
private |
Normalizes the values.
Definition at line 139 of file VariablePsf.cpp.
References m_components, and std::vector< T >::size().
Referenced by getPsf().
|
private |
Verify that the preconditions of getPsf are met at construction time.
Definition at line 95 of file VariablePsf.cpp.
References g, m_coefficients, m_components, m_group_degrees, and std::vector< T >::size().
Referenced by VariablePsf().
|
private |
Definition at line 126 of file VariablePsf.h.
Referenced by calculateExponents(), getHeight(), getPsf(), getWidth(), and selfTest().
|
private |
Definition at line 124 of file VariablePsf.h.
Referenced by calculateExponents(), getComponents(), scaleProperties(), and selfTest().
|
private |
Definition at line 127 of file VariablePsf.h.
Referenced by calculateExponents(), and getPsf().
|
private |
Definition at line 125 of file VariablePsf.h.
Referenced by calculateExponents(), and selfTest().
|
private |
Definition at line 123 of file VariablePsf.h.
Referenced by getPixelSampling().