SourceXtractorPlusPlus
0.18
SourceXtractor++, the next generation SExtractor
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
27
namespace
SourceXtractor {
28
29
ObjectInfo::ObjectInfo
() {
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
38
ObjectInfo::ObjectInfo
(
const
SourceInterface
& source) {
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
}
SourceXtractor::ObjectInfo::ObjectInfo
ObjectInfo()
Definition:
ObjectInfo.cpp:29
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition:
SourceInterface.h:57
SourceXtractor::IsophotalFlux
Computes the isophotal flux and magnitude.
Definition:
IsophotalFlux.h:36
ShapeParameters.h
ObjectInfo.h
SourceXtractor::PixelCentroid
The centroid of all the pixels in the source, weighted by their DetectionImage pixel values...
Definition:
PixelCentroid.h:37
PixelCentroid.h
std::make_pair
T make_pair(T...args)
std::map< std::string, Attribute >::emplace
Attribute emplace(Attribute...args)
SourceXtractor::ShapeParameters
Definition:
ShapeParameters.h:32
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
IsophotalFlux.h
Generated by
1.8.5