SourceXtractorPlusPlus  0.18
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObjectInfo.cpp
Go to the documentation of this file.
1 
17 /*
18  * @file ObjectInfo.cpp
19  * @author Nikolaos Apostolakos <nikoapos@gmail.com>
20  */
21 
26 
27 namespace SourceXtractor {
28 
30  emplace(std::make_pair("centroid_x", 0.));
31  emplace(std::make_pair("centroid_y", 0.));
32  emplace(std::make_pair("isophotal_flux", 0.));
33  emplace(std::make_pair("radius", 0.));
34  emplace(std::make_pair("angle", 0.));
35  emplace(std::make_pair("aspect_ratio", 0.));
36 }
37 
39  auto centroid = source.getProperty<PixelCentroid>();
40  auto iso_flux = source.getProperty<IsophotalFlux>();
41  auto shape = source.getProperty<ShapeParameters>();
42 
43  double aspect_guess = std::max<double>(shape.getEllipseB() / shape.getEllipseA(), 0.01);
44 
45  emplace(std::make_pair("centroid_x", centroid.getCentroidX() + 1.0));
46  emplace(std::make_pair("centroid_y", centroid.getCentroidY() + 1.0));
47  emplace(std::make_pair("isophotal_flux", std::max<double>(iso_flux.getFlux(), 0.0001)));
48  emplace(std::make_pair("radius", std::max<double>(shape.getEllipseA() / 2.0, 0.01)));
49  emplace(std::make_pair("angle", shape.getEllipseTheta()));
50  emplace(std::make_pair("aspect_ratio", aspect_guess));
51 }
52 
53 }
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Computes the isophotal flux and magnitude.
Definition: IsophotalFlux.h:36
The centroid of all the pixels in the source, weighted by their DetectionImage pixel values...
Definition: PixelCentroid.h:37
T make_pair(T...args)
Attribute emplace(Attribute...args)
The SourceInterface is an abstract &quot;source&quot; that has properties attached to it.