SourceXtractorPlusPlus
0.16
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 override |
int | getHeight () const override |
double | getPixelSampling () const override |
const std::vector< std::string > & | getComponents () const override |
std::shared_ptr< VectorImage< SeFloat > > | getPsf (const std::vector< double > &values) const override |
![]() | |
virtual | ~Psf ()=default |
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< std::string > | m_component_names |
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 PsfEx/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 48 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 std::back_inserter(), calculateExponents(), m_component_names, m_components, selfTest(), and std::transform().
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 42 of file VariablePsf.cpp.
References calculateExponents(), and selfTest().
|
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 149 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().
|
overridevirtual |
Implements SourceXtractor::Psf.
Definition at line 61 of file VariablePsf.cpp.
References m_component_names.
|
overridevirtual |
Implements SourceXtractor::Psf.
Definition at line 53 of file VariablePsf.cpp.
References m_coefficients.
Referenced by getPsf().
|
overridevirtual |
Implements SourceXtractor::Psf.
Definition at line 57 of file VariablePsf.cpp.
References m_pixel_sampling.
|
overridevirtual |
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 |
Implements SourceXtractor::Psf.
Definition at line 65 of file VariablePsf.cpp.
References SourceXtractor::VectorImage< T >::create(), std::exp(), getHeight(), getWidth(), m_coefficients, m_exponents, std::pow(), scaleProperties(), x, and y.
|
overridevirtual |
Implements SourceXtractor::Psf.
Definition at line 49 of file VariablePsf.cpp.
References m_coefficients.
Referenced by getPsf().
|
private |
Normalizes the values.
Definition at line 136 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 92 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 125 of file VariablePsf.h.
Referenced by calculateExponents(), getHeight(), getPsf(), getWidth(), and selfTest().
|
private |
Definition at line 123 of file VariablePsf.h.
Referenced by getComponents(), and VariablePsf().
|
private |
Definition at line 122 of file VariablePsf.h.
Referenced by calculateExponents(), scaleProperties(), selfTest(), and VariablePsf().
|
private |
Definition at line 126 of file VariablePsf.h.
Referenced by calculateExponents(), and getPsf().
|
private |
Definition at line 124 of file VariablePsf.h.
Referenced by calculateExponents(), and selfTest().
|
private |
Definition at line 121 of file VariablePsf.h.
Referenced by getPixelSampling().