SourceXtractorPlusPlus
0.19.2
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
PythonConfig
ObjectInfo.cpp
Go to the documentation of this file.
1
17
/*
18
* @file ObjectInfo.cpp
19
* @author Nikolaos Apostolakos <nikoapos@gmail.com>
20
*/
21
22
#include <
SEImplementation/PythonConfig/ObjectInfo.h
>
23
#include <
SEImplementation/Plugin/PixelCentroid/PixelCentroid.h
>
24
#include <
SEImplementation/Plugin/IsophotalFlux/IsophotalFlux.h
>
25
#include <
SEImplementation/Plugin/ShapeParameters/ShapeParameters.h
>
26
#include <
SEImplementation/Plugin/AssocMode/AssocMode.h
>
27
28
namespace
SourceXtractor
{
29
30
ObjectInfo::ObjectInfo
() {
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
++) {
40
std::stringstream
label
;
41
label
<<
"assoc_value_"
<<
i
;
42
emplace
(
std::make_pair
(
label
.str(), 0.));
43
}
44
}
45
46
ObjectInfo::ObjectInfo
(
const
SourceInterface
&
source
) {
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()) {
66
std::stringstream
label
;
67
label
<<
"assoc_value_"
<<
i
;
68
emplace
(
std::make_pair
(
label
.str(),
assoc_value
));
69
i
++;
70
}
71
72
}
73
}
74
75
}
AssocMode.h
IsophotalFlux.h
ObjectInfo.h
PixelCentroid.h
ShapeParameters.h
std::stringstream
SourceXtractor::AssocMode
Definition
AssocMode.h:33
SourceXtractor::IsophotalFlux
Computes the isophotal flux and magnitude.
Definition
IsophotalFlux.h:36
SourceXtractor::ObjectInfo::ObjectInfo
ObjectInfo()
Definition
ObjectInfo.cpp:30
SourceXtractor::PixelCentroid
The centroid of all the pixels in the source, weighted by their DetectionImage pixel values.
Definition
PixelCentroid.h:37
SourceXtractor::ShapeParameters
Definition
ShapeParameters.h:32
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
std::map< std::string, Attribute >::emplace
Attribute emplace(Attribute ... args)
std::function
std::make_pair
T make_pair(T... args)
SourceXtractor
Definition
Aperture.h:30
Generated by
1.9.8