SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourcePsfTask.cpp
Go to the documentation of this file.
1
18#include <numeric>
24
25namespace SourceXtractor {
26
29 return pixel_centroid.getCentroidX();
30}
31
34 return pixel_centroid.getCentroidY();
35}
36
38 {"X_IMAGE", getCoordX},
39 {"Y_IMAGE", getCoordY},
40 {"XWIN_IMAGE", getCoordX},
41 {"YWIN_IMAGE", getCoordY},
42 {"XPEAK_IMAGE", getCoordX},
43 {"YPEAK_IMAGE", getCoordY},
44 {"XMODEL_IMAGE", getCoordX},
45 {"YMODEL_IMAGE", getCoordY}
46};
47
49 : m_instance(instance), m_vpsf(vpsf) {
50}
51
53 if (m_vpsf != nullptr) {
55
56 for (auto component : m_vpsf->getComponents()) {
58 }
59
60 auto psf = m_vpsf->getPsf(component_values);
61 // The result may not be normalized!
62 auto psf_sum = std::accumulate(psf->getData().begin(), psf->getData().end(), 0.);
64 source.setIndexedProperty<SourcePsfProperty>(m_instance, m_vpsf->getPixelSampling(), psf_normalized);
65
66 // Check image
68 if (check_image) {
69 auto x = component_value_getters["X_IMAGE"](source, m_instance);
70 auto y = component_value_getters["Y_IMAGE"](source, m_instance);
71
73 check_image, psf_normalized, m_vpsf->getPixelSampling(), x, y);
74 }
75 } else {
76 source.setIndexedProperty<SourcePsfProperty>(m_instance, 1.0, nullptr);
77 }
78}
79
80}
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
T accumulate(T... args)
static CheckImages & getInstance()
The SourceInterface is an abstract "source" that has properties attached to it.
static std::map< std::string, ValueGetter > component_value_getters
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
std::shared_ptr< Psf > m_vpsf
SourcePsfTask(unsigned instance, const std::shared_ptr< Psf > &vpsf)
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
static double getCoordX(SourceXtractor::SourceGroupInterface &group, unsigned instance)
Definition PsfTask.cpp:33
static double getCoordY(SourceXtractor::SourceGroupInterface &group, unsigned instance)
Definition PsfTask.cpp:39
static void addImageToImage(ImageType &image1, const ImageType &image2, double scale, double x, double y)