SourceXtractorPlusPlus 0.19
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
ObjectInfo.cpp
Go to the documentation of this file.
1
17/*
18 * @file ObjectInfo.cpp
19 * @author Nikolaos Apostolakos <nikoapos@gmail.com>
20 */
21
27
28namespace SourceXtractor {
29
31 emplace(std::make_pair("centroid_x", 0.));
32 emplace(std::make_pair("centroid_y", 0.));
33 emplace(std::make_pair("isophotal_flux", 0.));
34 emplace(std::make_pair("radius", 0.));
35 emplace(std::make_pair("angle", 0.));
36 emplace(std::make_pair("aspect_ratio", 0.));
37 emplace(std::make_pair("assoc_match", false));
38 emplace(std::make_pair("assoc_size", 0.));
39 for (int i=0; i<100; i++) {
41 label << "assoc_value_" << i;
42 emplace(std::make_pair(label.str(), 0.));
43 }
44}
45
47 auto centroid = source.getProperty<PixelCentroid>();
48 auto iso_flux = source.getProperty<IsophotalFlux>();
49 auto shape = source.getProperty<ShapeParameters>();
50 auto assoc = source.getProperty<AssocMode>();
51
52 double aspect_guess = std::max<double>(shape.getEllipseB() / shape.getEllipseA(), 0.01);
53
54 emplace(std::make_pair("centroid_x", centroid.getCentroidX() + 1.0));
55 emplace(std::make_pair("centroid_y", centroid.getCentroidY() + 1.0));
56 emplace(std::make_pair("isophotal_flux", std::max<double>(iso_flux.getFlux(), 0.0001)));
57 emplace(std::make_pair("radius", std::max<double>(shape.getEllipseA() / 2.0, 0.01)));
58 emplace(std::make_pair("angle", shape.getEllipseTheta()));
59 emplace(std::make_pair("aspect_ratio", aspect_guess));
60
61 emplace(std::make_pair("assoc_match", assoc.getMatch()));
62 if (assoc.getMatch()) {
63 emplace(std::make_pair("assoc_size", (double) assoc.getAssocValues().shape()[0]));
64 int i=0;
65 for (auto assoc_value : assoc.getAssocValues()) {
67 label << "assoc_value_" << i;
68 emplace(std::make_pair(label.str(), assoc_value));
69 i++;
70 }
71
72 }
73}
74
75}
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
The SourceInterface is an abstract "source" that has properties attached to it.
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Attribute emplace(Attribute ... args)
T make_pair(T... args)
T str(T... args)